PDA

View Full Version : zabbix 1.4 won't compile on freebsd


andrew.p
04-06-2007, 21:39
FreeBSD 6.0-STABLE, net-snmp-5.3.1, zabbix-1.4.

When using this configuration command:

./configure --with-mysql --enable-server --enable-agent --with-net-snmp

I get this error message:

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:

# /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:

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:
http://www.zabbix.com/forum/showthread.php?t=5993
http://www.zabbix.com/forum/showthread.php?t=6258
...but what I am in looks like a dead end.

proctozont
05-06-2007, 17:51
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

andrew.p
05-06-2007, 20:16
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.

proctozont
05-06-2007, 23:47
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

if test "x$_libnetsnmp_config" != "x" ; then

_libnetsnmp_libdir="`$_libnetsnmp_config --libs`"
_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} ${_libnetsnmp_libdir}"
;;
esac
done

Zabbix 1.4 confugure net-snmp section:line 10033

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.

andrew.p
06-06-2007, 22:32
proctozont,
Thank you! I made a change on line 10050:
changed this

_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

_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.

treyh
14-06-2007, 16:26
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

andrew.p
14-06-2007, 16:30
treyh,
what did your configure command look like?

treyh
14-06-2007, 16:36
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

treyh
14-06-2007, 16:54
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

proctozont
14-06-2007, 17:26
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.

treyh
14-06-2007, 17:32
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

FrankTM
04-09-2008, 16:01
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