Ad Widget

Collapse

zabbix 1.4 won't compile on freebsd

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andrew.p
    Junior Member
    • Jun 2007
    • 4

    #1

    zabbix 1.4 won't compile on freebsd

    FreeBSD 6.0-STABLE, net-snmp-5.3.1, zabbix-1.4.

    When using this configuration command:
    Code:
    ./configure --with-mysql --enable-server --enable-agent --with-net-snmp
    I get this error message:
    Code:
    checking for mysql_config... /usr/local/bin/mysql_config
    checking for main in -lmysqlclient ... yes
    checking for mysql_autocommit in MySQL... no
    checking for ZABBIX server database selection... ok
    checking for pkg-config... /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for gawk... (cached) nawk
    checking for curl-config... /usr/local/bin/curl-config
    checking for the version of libcurl... 7.16.1
    checking for libcurl >= version 7.15.1... yes
    checking for main in -lcurl... yes
    checking whether libcurl is usable... no
    checking for net-snmp-config... /usr/local/bin/net-snmp-config
    checking for main in -lnetsnmp ... no
    configure: error: Not found NET-SNMP library
    Some other info:
    Code:
    # /usr/local/bin/net-snmp-config --libs
    -rpath=/usr/lib:/usr/local/lib -L/usr/local/lib -lnetsnmp -lcrypto -lm -lkvm -ldevstat -lwrap
    # /usr/local/bin/net-snmp-config --version
    5.3.1
    # /usr/local/bin/net-snmp-config --cflags
    -DINET6 -O2 -pipe -Dfreebsd6 -DAPPLLIB_EXP=/usr/local/lib/perl5/5.8.7/BSDPAN -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/local/lib/perl5/5.8.7/mach/CORE -I. -I/usr/local/include
    Also, I don't know if it's related, but have you noticed "checking whether libcurl is usable... no" message above?
    When running configuration script with '--with-libcurl=/usr/local', I am getting this:
    Code:
    checking for mysql_config... /usr/local/bin/mysql_config
    checking for main in -lmysqlclient ... yes
    checking for mysql_autocommit in MySQL... no
    checking for ZABBIX server database selection... ok
    checking for pkg-config... /usr/local/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for gawk... (cached) nawk
    checking for curl-config... /usr/local
    configure: error: Not found Curl library
    Same os similar issues have been reported in the past:


    ...but what I am in looks like a dead end.
  • proctozont
    Junior Member
    • May 2007
    • 8

    #2
    To fix curl try
    ./configure --with-libcurl=/usr/local
    For me it helped.

    to fix net-snmp try to edit file configure
    variable _libnetsnmp_libdir not defined
    I just add
    _libnetsnmp_libdir="`$_libnetsnmp_config --libs`"
    ufter
    if test "x$_libnetsnmp_config" != "x" ; then
    Last edited by proctozont; 05-06-2007, 19:11.

    Comment

    • andrew.p
      Junior Member
      • Jun 2007
      • 4

      #3
      Originally posted by proctozont
      To fix curl try
      ./configure --with-libcurl=/usr/local
      For me it helped.

      to fix net-snmp try to edit file configure
      variable _libnetsnmp_libdir not defined
      I just add
      _libnetsnmp_libdir="`$_libnetsnmp_config --libs`"
      ufter
      if test "x$_libnetsnmp_config" != "x" ; then
      Can you tell me what what version you are using? I can not find such test condition in 1.4. Also, I have posted above an error I get when running ./configure --with-libcurl=/usr/local.

      Comment

      • proctozont
        Junior Member
        • May 2007
        • 8

        #4
        I'm using Zabbix 1.3.8 and both FreeBSD 5.5 and 6.2
        At configure stage I get mass problems.
        On FreeBSD 5.5 and FreeBSD 6.2 problems was different.
        Looks like Zabbix has problems with FreeBSD.

        1.4 configure looks different, but similar condition can be found at line 10033.

        Zabbix 1.3.8 confugure net-snmp section: line 9959
        Code:
        	if test "x$_libnetsnmp_config" != "x" ; then
        
        		[B][COLOR=Red]_libnetsnmp_libdir="`$_libnetsnmp_config --libs`"[/COLOR][/B]
        		_full_libnetsnmp_cflags="`$_libnetsnmp_config --cflags`"
        		for i in $_full_libnetsnmp_cflags; do
        			case $i in
        				-I*)
        					SNMP_CFLAGS="$SNMP_CFLAGS $i"
        
        			;;
        			esac
        		done
        
        		_full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
        		for i in $_full_libnetsnmp_libs; do
        			case $i in
        				-L*)
        					[B][COLOR=DarkGreen]SNMP_LDFLAGS="${SNMP_LDFLAGS} ${_libnetsnmp_libdir}"[/COLOR][/B]
        			;;
        			esac
        		done
        Zabbix 1.4 confugure net-snmp section:line 10033

        Code:
        	if test -f $_libnetsnmp_config; then
        
        		_full_libnetsnmp_cflags="`$_libnetsnmp_config --cflags`"
        		for i in $_full_libnetsnmp_cflags; do
        			case $i in
        				-I*)
        					SNMP_CFLAGS="$SNMP_CFLAGS $i"
        
        			;;
        			esac
        		done
        
        		_full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
        		for i in $_full_libnetsnmp_libs; do
        			case $i in
        				-L*)
        					SNMP_LDFLAGS="${SNMP_LDFLAGS} $i"
        			;;
        			esac
        		done
        In Zabbix 1.3.8 I add line marked red, but there was line I marked green, so I just guess that you maybe should fix it too. For me it helped, but absolutly no warranty that it can help with 1.4. Different problems was even betwen versions of FreeBSD.

        At FreeBSD 5.5 configure command was:
        ./configure \
        --prefix=/root/zabbix \
        --enable-server \
        --enable-agent \
        --with-mysql \
        --with-net-snmp \
        --with-libcurl=/usr/local

        At FreeBSD 6.2 configure command was:

        ./configure \
        --prefix=/usr/local \
        --sysconfdir=/usr/local/etc \
        --enable-server \
        --enable-agent \
        --with-mysql \
        --with-net-snmp

        Because on FreeBSD 5.5 I got CURL Error as your.
        I didn't compile 1.4, so if you will successfully compile it please write that you did.

        Comment

        • andrew.p
          Junior Member
          • Jun 2007
          • 4

          #5
          proctozont,
          Thank you! I made a change on line 10050:
          changed this
          Code:
          		_full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
          		for i in $_full_libnetsnmp_libs; do
          			case $i in
          				-L*)
          					SNMP_LDFLAGS="${SNMP_LDFLAGS} $i"
          			;;
          			esac
          		done
          to
          Code:
          		_full_libnetsnmp_libs="`$_libnetsnmp_config --libs` -lcrypto"
          		for i in $_full_libnetsnmp_libs; do
          			case $i in
          				-L*)
          					SNMP_LDFLAGS="${SNMP_LDFLAGS} ${_libnetsnmp_libdir}"
          			;;
          			esac
          		done
          And it worked.

          Comment

          • treyh
            Member
            • May 2007
            • 64

            #6
            freebsd 6.2

            I have tried your suggestions and I still get this using the modified configure and the original:

            checking for ZABBIX server database selection... ok
            checking for pkg-config... /usr/local/bin/pkg-config
            checking pkg-config is at least version 0.9.0... yes
            checking for gawk... (cached) nawk
            checking for curl-config... /usr/local/lib
            configure: error: Not found Curl library

            I did this to fix it:

            cp /usr/local/lib/libcurl* /usr/lib/

            I then received: Not found NET-SNMP library

            always fun stuff

            Comment

            • andrew.p
              Junior Member
              • Jun 2007
              • 4

              #7
              treyh,
              what did your configure command look like?

              Comment

              • treyh
                Member
                • May 2007
                • 64

                #8
                hey

                I've tried:

                ./configure --enable-server --with-net-snmp --with-mysql --with-libcurl --prefix=/var/apps/zabbix14

                ./configure --enable-server --with-net-snmp=/usr/local/ --with-mysql --with-libcurl --prefix=/var/apps/zabbix14

                ./configure --enable-server --with-net-snmp=/usr/local/bin/ --with-mysql --with-libcurl --prefix=/var/apps/zabbix14

                If i specify /usr/local or /usr/local/bin with libcurl it dies there, but it works when blank
                Last edited by treyh; 14-06-2007, 16:45.

                Comment

                • treyh
                  Member
                  • May 2007
                  • 64

                  #9
                  config.log

                  I also saw this in config.log

                  configure:10010: found /usr/local/bin/net-snmp-config
                  configure:10023: result: /usr/local/bin/net-snmp-config
                  configure:10159: checking for main in -lnetsnmp
                  configure:10188: gcc -o conftest -g -O2 -I/usr/local/include/mysql -fno-strict-aliasing -pipe -I/usr/local/include -L/usr/local/lib/mysql -L/
                  usr/local/lib conftest.c -lnetsnmp -lkvm -lm -lmysqlclient -lcurl >&5
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_DigestInit'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_DigestFinal'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_DigestFinal_ex'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `AES_set_encrypt_key'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_md5'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `HMAC'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_MD_CTX_cleanup'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `SSLeay'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_sha1'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_MD_CTX_init'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `EVP_DigestUpdate'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `RAND_bytes'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `DES_cbc_encrypt'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `DES_ncbc_encrypt'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `DES_key_sched'
                  /usr/local/lib/libnetsnmp.so: undefined reference to `AES_cfb128_encrypt'
                  configure:10194: $? = 1

                  Comment

                  • proctozont
                    Junior Member
                    • May 2007
                    • 8

                    #10
                    you should add line

                    _libnetsnmp_libdir="`$_libnetsnmp_config --libs`"

                    and fix
                    SNMP_LDFLAGS="${SNMP_LDFLAGS} $i"
                    to
                    SNMP_LDFLAGS="${SNMP_LDFLAGS} ${_libnetsnmp_libdir}"

                    See previous posts to see where to place this lines.
                    Last edited by proctozont; 14-06-2007, 17:30.

                    Comment

                    • treyh
                      Member
                      • May 2007
                      • 64

                      #11
                      fixed

                      thank you very very much, that worked

                      I also did a replace in vi like this, in case there was more than one reference:

                      vi configure
                      :%s/SNMP_LDFLAGS="${SNMP_LDFLAGS} $i"/SNMP_LDFLAGS="${SNMP_LDFLAGS} ${_libnetsnmp_libdir}"/g
                      Last edited by treyh; 14-06-2007, 17:36. Reason: vi fun

                      Comment

                      • FrankTM
                        Junior Member
                        • Jun 2007
                        • 10

                        #12
                        i used this thread to fix this on zabbix current nightly snapshots (to become 1.4.7)

                        i've added the patch as attachment to this post

                        i've used the following configure command:
                        ./configure --enable-server --enable-agent --with-mysql --with-net-snmp=/usr/local/bin/net-snmp-config
                        Attached Files

                        Comment

                        Working...