Ad Widget

Collapse

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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • flako
    Member
    • Sep 2011
    • 40

    #1

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

    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), compile and install libssh2-1.2.3.

    The set of zabbix I'm running is: "../configure --enable-server --with-mysql=yes --with-ssh2=/usr/local/libssh2_zabbi && make" this ends well (I put the settings below) . Then when I compile line failure:

    Code:
    	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
    	make[3]: *** [zabbix_server] Error 1
    I have my ssh2 libssh2_session_block_directions, as you can see:

    Code:
    	objdump -T /usr/local/libssh2_zabbix/lib/libssh2.so | grep libssh2_session_block_directions
    	0000000000013400 g    DF .text	0000000000000007  Base        libssh2_session_block_directions
    Searching the internet, I found the link (https://support.zabbix.com/browse/ZB...nel#issue-tabs
    y http://www.zabbix.com/forum/showthread.php?t=16484) which recommend running the configure with LDFLAGS and CFLAGS, of the form:

    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:

    Code:
    	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)


    What else I can do, what is happening and I can not see?
    Not if it's a bug or my lack of knowledge of gcc

    Thanks for being here, and forgive the google translate (do what you can)

    -----------------------------
    # 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
    Code:
    	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
    	
    	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>                    *
    	***********************************************************
Working...