Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-4397

zabbix_server build support --with-ssh2 ssh specify my own path

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Won't fix
    • Icon: Minor Minor
    • None
    • 1.8.7
    • Installation (I)
    • SLES SUSE Linux Enterprise Server 11 SP1 x86_64

      Hello,
      I tried to compile ssh zabbix_server (zabbix-1.8.7) support (--with-ssh2) in SLES 11 SP1 (x86_64), based on the link (http://www.zabbix.com/forum/showthre...A+SSH2+library ,https://support.zabbix.com/browse/ZB...nel#issue-tabs y http://www.zabbix.com/forum/showthread.php?t=16484 ),

      Using LDFLAGS and CFLAGS, run the configure with:

                     make clean && LDFLAGS="-L/usr/local/libssh2_zabbix/lib" CFLAGS="-I/usr/local/libssh2_zabbix/include" ./configure --enable-server --with-mysql=yes --with-ssh2=/usr/local/libssh2_zabbix && make
      

      This generates the parameters for gcc and zabbix_server as:

      gcc -DZABBIX_DAEMON -I/usr/local/libssh2_zabbix/include -I/usr/include/mysql -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -fno-strict-aliasing -I/usr/local/libssh2_zabbix/include -L/usr/lib64/mysql **-L/usr/lib64** -L/usr/local/libssh2_zabbix/lib -rdynamic -L/usr/local/libssh2_zabbix/lib -o zabbix_server zabbix_server-actions.o zabbix_server-operations.o zabbix_server-events.o zabbix_server-zlog.o zabbix_server-server.o alerter/libzbxalerter.a dbsyncer/libzbxdbsyncer.a dbconfig/libzbxdbconfig.a discoverer/libzbxdiscoverer.a pinger/libzbxpinger.a poller/libzbxpoller.a housekeeper/libzbxhousekeeper.a timer/libzbxtimer.a trapper/libzbxtrapper.a nodewatcher/libzbxnodewatcher.a utils/libzbxutils.a httppoller/libzbxhttppoller.a watchdog/libzbxwatchdog.a escalator/libzbxescalator.a proxypoller/libzbxproxypoller.a selfmon/libzbxselfmon.a ../../src/libs/zbxsysinfo/libzbxserversysinfo.a ../../src/libs/zbxsysinfo/linux/libspecsysinfo.a ../../src/libs/zbxsysinfo/common/libcommonsysinfo.a ../../src/libs/zbxsysinfo/simple/libsimplesysinfo.a ../../src/libs/zbxlog/libzbxlog.a ../../src/libs/zbxdbcache/libzbxdbcache.a ../../src/libs/zbxmemory/libzbxmemory.a ../../src/libs/zbxalgo/libzbxalgo.a ../../src/libs/zbxnix/libzbxnix.a ../../src/libs/zbxsys/libzbxsys.a ../../src/libs/zbxconf/libzbxconf.a ../../src/libs/zbxmedia/libzbxmedia.a ../../src/libs/zbxcommon/libzbxcommon.a ../../src/libs/zbxcrypto/libzbxcrypto.a ../../src/libs/zbxcomms/libzbxcomms.a ../../src/libs/zbxcommshigh/libzbxcommshigh.a ../../src/libs/zbxjson/libzbxjson.a ../../src/libs/zbxexec/libzbxexec.a ../../src/libs/zbxself/libzbxself.a ../../src/libs/zbxserver/libzbxserver.a ../../src/libs/zbxicmpping/libzbxicmpping.a ../../src/libs/zbxdbhigh/libzbxdbhigh.a ../../src/libs/zbxdb/libzbxdb.a -lmysqlclient -lssh2 -lm -lresolv
      

      where it fails again:

              poller/libzbxpoller.a(checks_ssh.o): In function `waitsocket':
      	/usr/src/misCompilaciones/zabbix-1.8.7/src/zabbix_server/poller/checks_ssh.c:64: undefined reference to `libssh2_session_block_directions'
      	collect2: ld returned 1 exit status
      

      If you remove -L/usr/lib64, zabbix_server is compiled, but you can see that zabbix_server used libssh2.so.1 => / usr/lib64/libssh2.so.1, not that I have in /usr/local/ libssh2_zabbix so you should not walk the ssh

      ldd zabbix_server
      linux-vdso.so.1 => (0x00007fff3c952000)
      libmysqlclient.so.15 => / usr/lib64/libmysqlclient.so.15 (0x00007f2de2ca1000)
      libssh2.so.1 => / usr/lib64/libssh2.so.1 (0x00007f2de2a7d000)
      libm.so.6 => / lib64/libm.so.6 (0x00007f2de2827000)
      libresolv.so.2 => / lib64/libresolv.so.2 (0x00007f2de2610000)
      libc.so.6 => / lib64/libc.so.6 (0x00007f2de22b2000)
      libcrypt.so.1 => / lib64/libcrypt.so.1 (0x00007f2de2077000)
      libnsl.so.1 => / lib64/libnsl.so.1 (0x00007f2de1e5f000)
      libssl.so.0.9.8 => / usr/lib64/libssl.so.0.9.8 (0x00007f2de1c0b000)
      libcrypto.so.0.9.8 => / usr/lib64/libcrypto.so.0.9.8 (0x00007f2de1890000)
      libz.so.1 => / lib64/libz.so.1 (0x00007f2de167a000)
      / Lib64/ld-linux-x86-64.so.2 (0x00007f2de2ffd000)
      libdl.so.2 => / lib64/libdl.so.2 (0x00007f2de1476000)
      

      I really do not know if this is a bug which causes the configure, or simplemete my inability to see where else to look ...

      They can also find some more detail in the link (http://www.zabbix.com/forum/showthread.php?t=24078), but I think the important thing is here.

      The configuration generated by configure:

      	LDFLAGS="-L/usr/local/libssh2_zabbix/lib" CFLAGS="-I/usr/local/libssh2_zabbix/include" ./configure --enable-server --with-mysql=yes   --with-ssh2=/usr/local/libssh2_zabbix  
      	
      	Configuration:
      	
      	  Detected OS:           linux-gnu
      	  Install path:          /usr/local
      	  Compilation arch:      linux
      	
      	  Compiler:              gcc
      	  Compiler flags:        -I/usr/local/libssh2_zabbix/include  -I/usr/include/mysql  -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -fno-strict-aliasing        -I/usr/local/libssh2_zabbix/include   
      	
      	  Enable server:         yes
      	  Server details:
      	    With database:         MySQL
      	    WEB Monitoring via:    no
      	    Native Jabber:         no
      	    SNMP:                  no
      	    IPMI:                  no
      	    SSH:                   yes
      	    Linker flags:          -rdynamic -L/usr/local/libssh2_zabbix/lib      -L/usr/lib64/mysql -L/usr/lib64        -L/usr/local/libssh2_zabbix/lib 
      	    Libraries:             -lm  -lresolv    -lmysqlclient        -lssh2 
      	
      	  Enable proxy:          no
      	
      	  Enable agent:          no
      	
      	  LDAP support:          no
      	  IPv6 support:          no
      	
      	***********************************************************
      	* Now run 'make install'                       *
      	* *
      	* Thank you for using Zabbix!                  *
      	* <http://www.zabbix.com>                    *
      	***********************************************************
      

            Unassigned Unassigned
            flako flako
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: