[ZBX-2438] [PATCH] zabbix-server: broken ssh2 support on FreeBSD Created: 2010 May 17  Updated: 2017 May 30  Resolved: 2010 May 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 1.8.2
Fix Version/s: 1.8.3, 1.9.0 (alpha)

Type: Incident report Priority: Major
Reporter: Alex Deiter Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD 9.0-CURRENT-r207844-p9 amd64



 Description   

script configure contain invalid test operators:

./configure --enable-server --with-net-snmp --with-pgsql --with-ldap --with-openipmi --with-jabber --with-ssh2 --prefix=/usr/local
..
checking for SSH2 support... test: xyes: unexpected operator
...

Please review patch:

— configure.orig 2010-05-17 15:38:52.189911152 +0400
+++ configure 2010-05-17 15:39:13.793087125 +0400
@@ -12472,7 +12472,7 @@
fi #if test "x$_libssh2_dir" = "xno"; then
fi # if test "x$want_ssh2" != "xno"; then

  • if test "x$found_ssh2" == "xyes"; then
    + if test "x$found_ssh2" = "xyes"; then
    am_save_cflags="$CFLAGS"
    am_save_ldflags="$LDFLAGS"
    am_save_libs="$LIBS"
    @@ -12537,7 +12537,7 @@
    LDFLAGS="$am_save_ldflags"
    LIBS="$am_save_libs"
  • if test "x$found_ssh2" == "xyes"; then
    + if test "x$found_ssh2" = "xyes"; then
    cat >>confdefs.h <<_ACEOF
    #define HAVE_SSH2 1

Thanks a lot!



 Comments   
Comment by Aleksandrs Saveljevs [ 2010 May 18 ]

Thanks! Fix available in pre-1.8.3 in r12048.

Comment by Oleksii Zagorskyi [ 2010 May 19 ]

FreeBSD 8.0-RELEASE-p2
libssh2-1.2.5,2 A library implementing the SSH2 protocol

Not compile --with-ssh2

checking for net-snmp-config... /usr/local/bin/net-snmp-config
checking for main in -lnetsnmp ... yes
checking for localname in struct snmp_session... yes
checking for SSH2 support... no
configure: error: SSH2 library not found

See attached log on forum http://www.zabbix.com/forum/showpost.php?p=64774&postcount=20

Comment by Alex Deiter [ 2010 May 19 ]

Hi Oleksiy ,

You config.log
...
configure:12462: checking for SSH2 support
configure:12570: gcc -o conftest -g -O2 -I/usr/local/include/mysql -pipe -fno-strict-aliasing -I/usr/local/include -I/usr/local/lib/perl5/5.8.9/mach/CORE -I/usr/local/include -I. -I/usr/local/include -I$/usr/local/include -L$/usr/local/lib conftest.c -lkvm -lm -ldevstat -lssh2 >&5
/usr/bin/ld: cannot find -lssh2
configure:12576: $? = 1
...

1. Could you please install Zabbix from FreeBSD ports collection ?

cd /usr/ports/net-mgmt/zabbix-server && make install
cd /usr/ports/net-mgmt/zabbix-agent && make install
cd /usr/ports/net-mgmt/zabbix-frontend && make install

2. If you want install Zabbix from source tarball, please check libssh2 and use CPPFLAGS/CFLAGS/LDFLAGS shell environment for configure script:

$ pkg_info |grep libssh
libssh2-1.2.5,2 A library implementing the SSH2 protocol

$ CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib" ./configure --enable-server --with-pgsql --with-net-snmp --with-ldap --with-ssh2 | grep -i ssh
checking for SSH2 support... yes
Libraries: -lkvm -lm -ldevstat -liconv -lcurl -lnetsnmp -lssh2

without CPPFLAGS/CFLAGS/LDFLAGS shell environment configure script not found libssh2:

$ ./configure --enable-server --with-pgsql --with-net-snmp --with-ldap --with-ssh2 | grep -i ssh
configure: error: SSH2 library not found
checking for SSH2 support... no

Thanks!

Comment by Aleksandrs Saveljevs [ 2010 May 19 ]

If SSH2 is installed in a directory other than those that configure script checks by default (/usr and /usr/local), you can also try --with-ssh2=DIR option.

Comment by Aleksandrs Saveljevs [ 2010 May 19 ]

In m4/libssh2.m4 there are lines like:

SSH2_CFLAGS=-I$/usr/include
SSH2_LDFLAGS=-L$/usr/lib

The dollar sign does not seem to be needed. Maybe that is what is causing your problem.

Comment by Aleksandrs Saveljevs [ 2010 May 19 ]

Dollar sign fix available in pre-1.8.3 in r12069.

Comment by Oleksii Zagorskyi [ 2010 May 19 ]

Alex Deiter,
install Zabbix from FreeBSD ports collection GUD (zabbix-server 1.8.2_1,2 with 'Use libssh2 for SSH-based checks').

I try script configure with last changes r12069 (removed Dollar sign) and now it work without error, thanks.

Generated at Sat Apr 20 14:24:33 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.