# Zabbix with SSH2 support on FBSD8?



## kooper (Mar 16, 2010)

Hi all


Got myself FreeBSD 8.0 and loving it so far. Ran into a bit of a problem with installing Zabbix Server 1.8.1 though, specifically getting it to support SSH2.

I've asked on Zabbix' forums, but doesn't seem like anyone has a solution.

Has anyone tried getting Zabbix server installed on FreeBSD 8.0 with SSH2 support? I'm hoping there's a way to accomplish this via the ports.

Please, please, _please_ help...


Thanks,
Kooper.


----------



## DutchDaemon (Mar 16, 2010)

This is just a guess, but this is what a quick search turned up:

http://www.zabbix.com/documentation/1.8/complete -> 


```
2.4. Server requirements
Requirement	Description
OpenIPMI 	Required for IPMI support
libssh2 	Required for SSH support. Version 1.0 or higher.
```

Ports tree:

security/libssh2

From its pkg-descr:

```
libssh2 is a library implementing the SSH2 protocol as defined by
Internet Drafts: SECSH-TRANS(22), SECSH-USERAUTH(25), SECSH-CONNECTION(23),
SECSH-ARCH(20), SECSH-FILEXFER(06)*, SECSH-DHGEX(04), and SECSH-NUMBERS(10).

WWW: http://www.libssh2.org/
```

From its pkg-plist:


```
include/libssh2.h
include/libssh2_publickey.h
include/libssh2_sftp.h
lib/libssh2.so
lib/libssh2.so.1
lib/libssh2.la
lib/libssh2.a
libdata/pkgconfig/libssh2.pc
```

Looks like this might correspond with the -lssh2 in your compile output.

A quick Google on 'libssh2 zabbix' appears to confirm that.

Try.


----------



## kooper (Mar 16, 2010)

Thanks for the speedy help DutchDaemon. I've definitely got libssh2 installed:


```
[root@TSG-BSD /usr/ports/security/libssh2]# make deinstall
===>  Deinstalling for security/libssh2
===>   Deinstalling libssh2-1.2.4,2
[root@TSG-BSD /usr/ports/security/libssh2]# make reinstall
===>  Installing for libssh2-1.2.4,2
```

Adding libssh as well just in case:


```
[root@TSG-BSD /usr/ports/security/libssh]# make install
===>  Found saved configuration for libssh-0.4.1
=> libssh-0.4.1.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from [url]http://www.libssh.org/files/[/url].
libssh-0.4.1.tar.gz                           100% of  246 kB  103 kBps
===>  Extracting for libssh-0.4.1
=> MD5 Checksum OK for libssh-0.4.1.tar.gz.
=> SHA256 Checksum OK for libssh-0.4.1.tar.gz.
===>  Patching for libssh-0.4.1
===>   libssh-0.4.1 depends on file: /usr/local/bin/cmake - not found
===>    Verifying install for /usr/local/bin/cmake in /usr/ports/devel/cmake
=> cmake-2.8.0.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=> Attempting to fetch from [url]http://www.cmake.org/files/v2.8/[/url].
cmake-2.8.0.tar.gz                            100% of 3469 kB   96 kBps 00m00s
===>  Extracting for cmake-2.8.0_3
=> MD5 Checksum OK for cmake-2.8.0.tar.gz.
=> SHA256 Checksum OK for cmake-2.8.0.tar.gz.
===>  Patching for cmake-2.8.0_3
===>  Applying FreeBSD patches for cmake-2.8.0_3
===>  Configuring for cmake-2.8.0_3
---------------------------------------------
...
...
...
...

===>   Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===>   Registering installation for libssh-0.4.1
===> SECURITY REPORT:
      This port has installed the following files which may act as network
      servers and may therefore pose a remote security risk to the system.
/usr/local/lib/libssh.so.4.0.1

      If there are vulnerabilities in these programs there may be a security
      risk to the system. FreeBSD makes no guarantee about the security of
      ports included in the Ports Collection. Please type 'make deinstall'
      to deinstall the port if this is a concern.

      For more information, and contact details about the security
      status of this software, see the following webpage:
[url]http://www.libssh.org/[/url]
```


I'm going to try to compile zabbix-server again one more time, will keep you posted on how it turns out.


And thanks again for the help so far.

Cheers,
Derick


----------



## kooper (Mar 16, 2010)

Reinstalling zabbix-server:


```
===>  Deinstalling for net-mgmt/zabbix-server
===>   Deinstalling zabbix-server-1.8.1,2
[root@TSG-BSD /usr/ports/net-mgmt/zabbix-server]# make clean
===>  Cleaning for zabbix-server-1.8.1,2
```


Now just ran a make, going form there:


```
[root@TSG-BSD /usr/ports/net-mgmt/zabbix-server/work/zabbix-1.8.1]# ./configure --enable-server --with-ssh2 --with-net-snmp --with-mysql 
--with-jabber --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/ --build=i386-portbld-freebsd8.0
[root@TSG-BSD /usr/ports/net-mgmt/zabbix-server/work/zabbix-1.8.1]# make install
...
...
...
   -liconv
test -z "/usr/local/sbin" || ../.././install-sh -c -d "/usr/local/sbin"
  /usr/bin/install -c 'zabbix_server' '/usr/local/sbin/zabbix_server'
Making install in create
Making install in man
test -z "/usr/local/man/man1" || .././install-sh -c -d "/usr/local/man/man1"
test -z "/usr/local/man/man8" || .././install-sh -c -d "/usr/local/man/man8"
 /usr/bin/install -c -m 644 './zabbix_server.man' '/usr/local/man/man8/zabbix_server.8'
Making install in misc
Making install in upgrades
```


Starting it up and checking logfile:


```
[root@TSG-BSD /usr/local/bin]# which zabbix_server
/usr/local/sbin/zabbix_server
[root@TSG-BSD /usr/local/bin]# /usr/local/sbin/zabbix_server
[root@TSG-BSD /usr/local/bin]# cd /tmp/
[root@TSG-BSD /tmp]# vi zabbix_server.log
 34373:20100316:174451.312 **** Enabled features ****
 34373:20100316:174451.312 SNMP monitoring:       YES
 34373:20100316:174451.312 IPMI monitoring:        NO
 34373:20100316:174451.312 WEB monitoring:        YES
 34373:20100316:174451.312 Jabber notifications:  YES
 34373:20100316:174451.312 ODBC:                   NO
 34373:20100316:174451.312 SSH2 support:           NO
 34373:20100316:174451.312 IPv6 support:           NO
 34373:20100316:174451.312 **************************
```


I'm starting to think I'm doing something wrong somewhere by manually configuring and installing, but I don't know how to pass the --with-ssh2 argument directly to the port itself.


----------



## kooper (Mar 16, 2010)

If I configure the port directly in /usr/ports/net-mngmt/zabbix-server/work/zabbix-1.8.1/ and afterwards install in by going to /usr/ports/net-mngmt/zabbix-server and doing a make install, will that use the arguments I used when configuring directly in the work subdirectory?


----------



## DutchDaemon (Mar 16, 2010)

You could try adding 


```
CONFIGURE_ARGS+=        --with-ssh2
```

in the port's Makefile. Maybe expand the existing --with-net-snmp one that's already in there.

I also see someone playing with paths, http://www.zabbix.com/forum/showthread.php?t=14536. No idea if that helps.


----------



## DutchDaemon (Mar 16, 2010)

As a last resort: see if the port maintainer has an idea of what's going on.


----------



## kooper (Mar 16, 2010)

Thanks for the assistance so far DutchDaemon, I'll keep you posted on how I get on.


----------



## kooper (Mar 17, 2010)

This has now been solved, "Rincewind" over on Zabbix' forums provided a couple of files that sorted it out. Many thanks for the assistance DutchDaemon, much appreciated.

Solution here.


----------



## DutchDaemon (Mar 17, 2010)

So to your (or Rincewind's) understanding, is this something _Zabbix_ should fix, or the Zabbix _port maintainer_ should fix? If the latter, please point the port maintainer to this thread so he knows there's something in the pipeline.


----------



## Rincewind (Mar 18, 2010)

DutchDaemon said:
			
		

> So to your (or Rincewind's) understanding, is this something _Zabbix_ should fix, or the Zabbix _port maintainer_ should fix? If the latter, please point the port maintainer to this thread so he knows there's something in the pipeline.



It is actually a Zabbix should fix. I've contribute modified files to Zabbix dev team, but it is either not confirmed nor rejected. Anyway, I think it is possible to proceed small patch to FreeBSD port to avoid this problem before Zabbix team fix it in next version, but unfortunately I don't know what should I do.


----------



## DutchDaemon (Mar 18, 2010)

I'll see if I can get the port maintainer to chime in. Maybe he can incorporate a patch based on your findings.


----------



## kooper (Mar 19, 2010)

Hi DutchDaemon, Rincewind


Just raised this on Zabbix' bug tracking system as ZBX-2198. Hopefully they'll include your fix in their next update Rincewind. Thanks again for those fixes, much appreciated


----------



## jhriggs (Mar 29, 2010)

I have added an SSH option to the 1.8.2 port update I am about to submit.  It did not require any patches to Zabbix or its configure setup.


----------

