Ad Widget

Collapse

Zabbix 1.8.1 and compiled problem when used SSH2 option

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ufocek
    Senior Member
    • Aug 2006
    • 161

    #1

    Zabbix 1.8.1 and compiled problem when used SSH2 option

    Hi,

    I try installed zabbix 1.8.1 with option --with-ssh2 on debian lenny 5.0 but it's not work, after when I run make install I get errror:

    Code:
    cc -DHAVE_CONFIG_H -I. -I../../../include     -g -O2    -I/usr/include/postgresql    -I/usr/local/include -I/usr/lib/perl/5.10/CORE -I. -I/usr/include  -Iusr/include   -I/usr/include -MT checks_ssh.o -MD -MP -MF .deps/checks_ssh.Tpo -c -o checks_ssh.o checks_ssh.c
    checks_ssh.c: In function ‘waitsocket’:
    checks_ssh.c:64: error: ‘LIBSSH2_SESSION_BLOCK_INBOUND’ undeclared (first use in this function)
    checks_ssh.c:64: error: (Each undeclared identifier is reported only once
    checks_ssh.c:64: error: for each function it appears in.)
    checks_ssh.c:67: error: ‘LIBSSH2_SESSION_BLOCK_OUTBOUND’ undeclared (first use in this function)
    make[3]: *** [checks_ssh.o] Błąd 1
    make[3]: Opuszczenie katalogu `/opt/zabbix-1.8.1/src/zabbix_server/poller'
    make[2]: *** [install-recursive] Błąd 1
    make[2]: Opuszczenie katalogu `/opt/zabbix-1.8.1/src/zabbix_server'
    make[1]: *** [install-recursive] Błąd 1
    make[1]: Opuszczenie katalogu `/opt/zabbix-1.8.1/src'
    make: *** [install-recursive] Błąd 1
    Configure:
    Code:
    ./configure --prefix=/usr/local/zabbix --with-pgsql --with-jabber --with-libcurl --with-net-snmp --enable-server --enable-agent --with-openipmi --with-ssh2
    Code:
    Configuration:
    
      Detected OS:           linux-gnu
      Install path:          /usr/local/zabbix
      Compilation arch:      linux
    
      Compiler:              gcc
      Compiler flags:        -g -O2    -I/usr/include/postgresql    -I/usr/local/include -I/usr/lib/perl/5.10/CORE -I. -I/usr/include  -I$/usr/include   -I/usr/include
    
      Enable server:         yes
      With database:         PostgreSQL
      WEB Monitoring via:    cURL
      Native Jabber:         yes
      SNMP:                  net-snmp
      IPMI:                  openipmi
      Linker flags:             -L/usr/lib -lOpenIPMI -lOpenIPMIposix     -L/usr/lib -lpq -liksemel    -lcurl  -L/usr/lib -lnetsnmp -lcrypto  -L/usr/lib -lnetsnmp -lcrypto -L$/usr/lib
      Libraries:             -lm  -lresolv       -liksemel -lcurl  -lnetsnmp  -lssh2
    
      Enable proxy:          no
    
      Enable agent:          yes
      Linker flags:             -L/usr/lib -lOpenIPMI -lOpenIPMIposix
      Libraries:             -lm  -lresolv 
    
      LDAP support:          no
      IPv6 support:          no
    dpkg -l |grep libssh
    ii libssh-2 0.2+svn20070321-4 A tiny C SSH library
    ii libssh-2-dev 0.2+svn20070321-4 A tiny C SSH library. Development files
    ii libssh2-1 0.18-1 SSH2 client-side library
    ii libssh2-1-dev 0.18-1 SSH2 client-side library (development header
  • Firm
    Senior Member
    • Dec 2009
    • 342

    #2
    Try to explicitly set LDFLAGS='-lssh2' before executing configure script.

    P.S. It seems you need libssh2 version 1.0 or later. Check http://www.zabbix.com/forum/showthread.php?t=14536
    Last edited by Firm; 28-01-2010, 13:06.

    Comment

    • ufocek
      Senior Member
      • Aug 2006
      • 161

      #3
      Hi,

      Thanks for pointing to the problem, when I install libssh2 1.x now it's evrything ok.

      Comment

      • kruczol
        Junior Member
        • Mar 2009
        • 6

        #4
        libssh2

        Hi,
        can you write what package exactly you installed - I stuck on this at all.

        Thanks.

        Comment

        • machtech
          Junior Member
          • Jan 2010
          • 11

          #5
          Hi, we solved this as follows.................


          Unfortunately, we need >1.0 of libssh2 to do SSH checking, and this is not yet in the main Ubuntu repo's (for Ubuntu 9.04), see:
          * http://packages.debian.org/search?keywords=libssh2

          You can see what you have by entering:

          Code:
          dpkg -l | grep libssh2
          Will see something like:

          Code:
          ii  libssh2-1         0.18-1     SSH2 client-side library
          ii  libssh2-1-dev     0.18-1     SSH2 client-side library (development header
          Go ahead and uninstall the (old version):

          Code:
          apt-get remove libssh2-1-dev
          Now we will install from source (http://www.libssh2.org/). By default, it will install to /usr/local, but we will place it in a specific directory that we will advise (only) the Zabbix configure script of (i.e. we are putting in a weird dir, so that no other app/package will see the files and get confused).

          Code:
          cd /usr/src
          mkdir libssh2
          cd libssh2
          wget http://www.libssh2.org/download/libssh2-1.2.3.tar.gz
          tar xzj libssh2-1.2.3.tar.gz
          cd libssh2-1.2.3
          ./configure --prefix=/usr/local/libssh2_zabbix
          make
          make check
          make install
          This will build and install libssh2 into /usr/local/libssh2_zabbix/bin and /usr/local/libssh2_zabbix/include

          When you get to configure/compile zabbix, enter this flag:
          Code:
          --with-ssh2=/usr/local/libssh2_zabbix
          Good to go!

          Comment

          • kruczol
            Junior Member
            • Mar 2009
            • 6

            #6
            its working

            Thanks for fast answer,
            that solution works - as You already now

            Second problem is option --with-curl && --with-ssh2 on Debian Lenny
            Lib dependency exclude that combination

            Thanks again.

            Comment

            • init0
              Junior Member
              • Feb 2010
              • 5

              #7
              Hi

              Originally posted by kruczol
              Second problem is option --with-curl && --with-ssh2 on Debian Lenny
              Lib dependency exclude that combination
              For compiling zabbix on Debian Lenny with both options just compile libcurl by yourself as you already did with libssh2.

              I did it like this:
              1. Download latest version from http://curl.haxx.se/download.html
              2. unpack the tarball
              3. configure curl like this (I took almost the same options as the Debian package uses -> no IPv6)
              Code:
              ./configure --with-ca-path=/etc/ssl/certs --enable-ldaps --with-lber-lib=lber --enable-manual --enable-versioned-symbols --with-libssh2=/usr/local/lib/
              4.
              Code:
              make && make install
              5. configure zabbix again (your options may differ):
              Code:
              ./configure --enable-server --enable-agent --with-mysql --with-libcurl --with-net-snmp --with-ldap --with-openipmi --with-ssh2=/usr/local --with-jabber
              6.
              Code:
              make
              => compiles without errors

              Comment

              • kruczol
                Junior Member
                • Mar 2009
                • 6

                #8
                Debian lenny zabbix 1.8

                Thanks for answer,
                yep I was suppose that steps for curl build are similar.

                I have a question - this non standard libs are needed only when we make binary ? Or we will need that lib on target system (i want use the same binary on others system - Debian leeny)

                Second question what distro you guys using for zabbix ?

                Ps.
                Soory for my eng.

                Comment

                • init0
                  Junior Member
                  • Feb 2010
                  • 5

                  #9
                  Well, with the options I configured zabbix the libraries are linked dynamically. This means you need this self-compiled libraries on the other systems as well.

                  You can check if the binary loads libraries dynamically:
                  Code:
                  # ldd /usr/local/sbin/zabbix_server 
                  	linux-gate.so.1 =>  (0xb7ef8000)
                  	libiksemel.so.3 => /usr/lib/libiksemel.so.3 (0xb7ee6000)
                  	libcurl.so.4 => /usr/local/lib/libcurl.so.4 (0xb7e94000)
                  	libnetsnmp.so.15 => /usr/lib/libnetsnmp.so.15 (0xb7de2000)
                  	libcrypto.so.0.9.8 => /usr/lib/i686/cmov/libcrypto.so.0.9.8 (0xb7c8f000)
                  	libldap_r-2.4.so.2 => /usr/lib/libldap_r-2.4.so.2 (0xb7c4c000)
                  	libOpenIPMI.so.0 => /usr/lib/libOpenIPMI.so.0 (0xb7b7d000)
                  	libOpenIPMIposix.so.0 => /usr/lib/libOpenIPMIposix.so.0 (0xb7b78000)
                  	libmysqlclient.so.15 => /usr/lib/libmysqlclient.so.15 (0xb798e000)
                  	libssh2.so.1 => /usr/local/lib/libssh2.so.1 (0xb796a000)
                  	libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb7944000)
                  	libresolv.so.2 => /lib/i686/cmov/libresolv.so.2 (0xb7930000)
                  	libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb77d5000)
                  	liblber-2.4.so.2 => /usr/lib/liblber-2.4.so.2 (0xb77c8000)
                  	libgnutls.so.26 => /usr/lib/libgnutls.so.26 (0xb772a000)
                  	libidn.so.11 => /usr/lib/libidn.so.11 (0xb76f9000)
                  	librt.so.1 => /lib/i686/cmov/librt.so.1 (0xb76f0000)
                  	libssl.so.0.9.8 => /usr/lib/i686/cmov/libssl.so.0.9.8 (0xb76a9000)
                  	libz.so.1 => /usr/lib/libz.so.1 (0xb7694000)
                  	libdl.so.2 => /lib/i686/cmov/libdl.so.2 (0xb768f000)
                  	libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb7678000)
                  	libpthread.so.0 => /lib/i686/cmov/libpthread.so.0 (0xb765f000)
                  	libOpenIPMIutils.so.0 => /usr/lib/libOpenIPMIutils.so.0 (0xb7658000)
                  	libncurses.so.5 => /lib/libncurses.so.5 (0xb7626000)
                  	libcrypt.so.1 => /lib/i686/cmov/libcrypt.so.1 (0xb75f3000)
                  	libnsl.so.1 => /lib/i686/cmov/libnsl.so.1 (0xb75da000)
                  	/lib/ld-linux.so.2 (0xb7ef9000)
                  	libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb75ca000)
                  	libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb75c6000)
                  	libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb755e000)
                  But there is the option --enable-static which should do what you want. There is one caveat: in case a library has security issues and needs an update you have to recompile and distribute the zabbix binaries to all your systems. If you don't compile statically you can update your system (i.e. via apt) and then just reload the daemons which use that library.

                  In case you want to do it the Debian way, you can create your own Debian package or maybe you'll even find the new zabbix version in testing (and recompile that).

                  We are using our self-compiled zabbix (1.8.1) on Debian Lenny.

                  Comment

                  • init0
                    Junior Member
                    • Feb 2010
                    • 5

                    #10
                    In fact there is already a Zabbix 1.8.1 backport for Debian Lenny available:



                    Comment

                    • non7top
                      Junior Member
                      • Jun 2010
                      • 1

                      #11
                      I've created packages with libssh support for Lenny. Those from backports don't support ssh.




                      Comment

                      Working...