View Full Version : make issue --with-net-snmp FreeBSD X
pls replace line 2 in zabbix/src/zabbix_server/poller/Makefile.am with.
INCLUDES=-I@top_srcdir@/include @MYSQL_INCLUDE@ @SNMP_INCLUDE@
remove zabbix/src/zabbix_server/poller/Makefile.in and run automake in zabbix.
this mistake is annoying because its reported again and again since alpha10/11.
pls. fix. thanks a lot, marc
alexei did you read this? :) sorry for bothering but i just want this sorted in beta1 if possible.
Seems to have the same problem in 1.1beta1 trying to find the net-snmp lib/inc's.
Alexei, do you have a preferred method of posting patches to make it easier for you? Are diff's preferred?
Thanks.
Sorry, I missed this patch. Just fixed it in CVS. Diff is ok for small patches.
thanks for solving it finally :)
Hi!
I recently tried to upgrade from 1.1alpha6 to 1.1beta1. I get the error above when trying to compile and made the suggested changes to Makefile.am in src/zabbix_server/poller/.
I removed Makefile.in and ran automake in /zabbix1.1beta1 without errors.
But i still get the same error when trying to compile:
server.o(.text+0x99b): I funktionen "main":
/root/zabbix-1.1beta1/src/zabbix_server/server.c:576: undefined reference to `init_snmp'
poller/libzbxpoller.a(checks_snmp.o)(.text+0x53): I funktionen "get_value_snmp":
/root/zabbix-1.1beta1/src/zabbix_server/poller/checks_snmp.c:52: undefined reference to `snmp_sess_init'
Have i missed something? If i cat Makefile.am and Makefile.in the INCLUDE line has @SNMP_INCLUDE@ in both of them and it looks correct.
Thanks!
Roger
James Wells
22-09-2005, 17:06
Have i missed something? If i cat Makefile.am and Makefile.in the INCLUDE line has @SNMP_INCLUDE@ in both of them and it looks correct.
Check your Makefile.am file, line 7 should look like this;
zabbix_server_LDFLAGS=@MYSQL_LFLAGS@ @PGSQL_LFLAGS@ @SNMP_LFLAGS@
Not sure why, it would happen, but I suspect you are missing the SNMP linker flags.
Thanks for your help!
Actually, line 7 in /src/zabbix_server/Makefile.am contains @SNMP_INCLUDE@ so it looks correct. Still no compile though. I checked Makefile.in and it contains that row also. Ive checked every Makefile.am and .in i could find for missing @SNMP_INCLUDE@ but it looks correct everywhere. Maybe i missed something somewhere?
But it seems that alpha6 binaries still works with the database upgrades done for beta1 so my system is at least running. Would be nice to try beta1 though.
Here is the gcc command and the error message if that helps to see whats missing? Im not a developer so this is a little bit over my head, if there's any info i could provide you with please ask. Thanks.
gcc -g -O2 -o zabbix_server -L/usr/lib/mysql -lmysqlclient -lm -lz -L/usr/lib -lnetsnmp -lcrypto evalfunc.o expression.o actions.o zlog.o functions.o server.o ../libs/zbxsysinfo/libzbxsysinfo.a ../libs/zbxlog/libzbxlog.a ../libs/zbxpid/libzbxpid.a ../libs/zbxconf/libzbxconf.a ../libs/zbxdbhigh/libzbxdbhigh.a ../libs/zbxcrypto/libzbxcrypto.a ../libs/zbxnet/libzbxnet.a pinger/libzbxpinger.a poller/libzbxpoller.a escalator/libzbxescalator.a housekeeper/libzbxhousekeeper.a alerter/libzbxalerter.a timer/libzbxtimer.a trapper/libzbxtrapper.a ../libs/zbxemail/libzbxemail.a ../libs/zbxcommon/libzbxcommon.a -lresolv -lnsl
server.o(.text+0x99b): I funktionen "main":
/root/zabbix-1.1beta1/src/zabbix_server/server.c:576: undefined reference to `init_snmp'
Out of curiousity, what version of FreeBSD/Net-SNMP are you running?
Im running Fedora Core 3 and net-snmp version 5.2.1.2
OS: FreeBSD carbon 4.9-STABLE
zabbix: beta1-2 (cvs)
ldap: openldap-client-2.2.27 Open source LDAP client implementation
net-snmp: net-snmp-5.2.1.2 An extendable SNMP implementation
perl: perl-5.6.2_2 Practical Extraction and Report Language
testing with beta1 tarball and * from cvs..
i downloaded zabbix-1.1beta1, and cp`ed my cvs dir about the beta1 files because i dont know in wich order to run autoheader and autoconf and wich versions i need. maybe some1 have a minute to explain the right procedure.
./configure --with-net-snmp --with-mysql --with-ldap --enable-server --enable-agent
<SNIP>
checking for getloadavg... yes
checking for socket... yes
checking for strtod... yes
checking for snprintf... yes
checking for vasprintf... yes
checking for asprintf... yes
checking for vsnprintf... yes
checking for MySQL support... yes
checking for floor... no
checking for floor in -lm... yes
checking for compress in -lz... yes
checking for PostgreSQL support... no
checking for NET-SNMP support... checking for main in -lcrypto... yes
yes
checking for UCD-SNMP support... no
checking for LDAP support... yes
ok (freebsd4.9)
</SNIP>
if i run make, i get this error:
carbon:/home/marc/zabbix-1.1beta1# make
Making all in src
Making all in libs
Making all in zbxlog
source='log.c' object='log.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c log.c
rm -f libzbxlog.a
ar cru libzbxlog.a log.o
ranlib libzbxlog.a
Making all in zbxcrypto
source='md5.c' object='md5.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c md5.c
rm -f libzbxcrypto.a
ar cru libzbxcrypto.a md5.o
ranlib libzbxcrypto.a
Making all in zbxpid
source='pid.c' object='pid.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c pid.c
rm -f libzbxpid.a
ar cru libzbxpid.a pid.o
ranlib libzbxpid.a
Making all in zbxnet
source='security.c' object='security.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c security.c
rm -f libzbxnet.a
ar cru libzbxnet.a security.o
ranlib libzbxnet.a
Making all in zbxconf
source='cfg.c' object='cfg.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c cfg.c
rm -f libzbxconf.a
ar cru libzbxconf.a cfg.o
ranlib libzbxconf.a
Making all in zbxsysinfo
source='cpu.c' object='cpu.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I../../../include -g -O2 -c cpu.c
cpu.c:136: ldap.h: No such file or directory
*** Error code 1
Stop in /home/marc/zabbix-1.1beta1/src/libs/zbxsysinfo.
*** Error code 1
Stop in /home/marc/zabbix-1.1beta1/src/libs/zbxsysinfo.
*** Error code 1
Stop in /home/marc/zabbix-1.1beta1/src/libs.
*** Error code 1
Stop in /home/marc/zabbix-1.1beta1/src.
*** Error code 1
Stop in /home/marc/zabbix-1.1beta1.
i think its just an @LDAP_INCLUDE@ issue but dunno.
if i build:
./configure --with-net-snmp --with-mysql --enable-server --enable-agent
anything works fine.
-rwxr-xr-x 1 root zabbix 417692 Sep 26 10:31 src/zabbix_server/zabbix_server*
help would be great... if anything is needed for debugging, let me know.
marc
i made this patch.. there is a problem with the declaration of process function. i guess you forgot some changes.
also, iam building a freebsd zabbix-devel port now, hopefully i can commit it with beta2. anyone here running FreeBSD and likes to test?
pls check and change:
less zabbix-devel/files/patch-src-include-sysinfo.h
--- include/sysinfo.h.orig Mon Sep 19 16:31:04 2005
+++ include/sysinfo.h Mon Sep 26 13:24:05 2005
@@ -36,7 +36,7 @@
char *parameter;
};
-int process(char *command, char *value);
+int process(char *command, char *value, int test);
void init_metrics();
void add_user_parameter(char *key,char *command);
James Wells
26-09-2005, 16:30
Actually, line 7 in /src/zabbix_server/Makefile.am contains @SNMP_INCLUDE@ so it looks correct. Still no compile though. I checked Makefile.in and it contains that row also. Ive checked every Makefile.am and .in i could find for missing @SNMP_INCLUDE@ but it looks correct everywhere. Maybe i missed something somewhere?
That looks like the problem. Line 7 is where you list the libraries to link against. In your case, you are saying to link against the include files. Just to be sure, please copy and paste the contents of zabbix/src/zabbix_server/Makefile.am
James Wells
26-09-2005, 16:33
i think its just an @LDAP_INCLUDE@ issue but dunno.
if i build:
./configure --with-net-snmp --with-mysql --enable-server --enable-agent
anything works fine.
Please apply the patch I posted in PATCH: Zabbix 1.1 beta1 LDAP issue (http://www.zabbix.com/forum/showthread.php?t=1389) again please. Looks like it wasn't applied.
dear james,
thanks for your answere... here is what i have done:
zabbix-devel.tgz (http://user.pilgerer.org/marc/zabbix-devel.tgz).
just extract and move to /usr/ports/net-mgmt.
cd /usr/ports/net-mgmt/zabbix-devel and run:
make WITH_MYSQL=yes WITH_NET_SNMP=yes WITH_LDAP=yes
your patch is already included in the port..
on a FreeBSD5.X its all fine. on FreeBSD4.9 i get this error...
carbon:/usr/ports/net-mgmt/zabbix-devel# make WITH_NET_SNMP=yes WITH_MYSQL=yes WITH_LDAP=yes
===> Building for zabbix-devel-1.1beta1
Making all in src
Making all in libs
Making all in zbxlog
Making all in zbxcrypto
Making all in zbxpid
Making all in zbxnet
Making all in zbxconf
Making all in zbxsysinfo
source='sysinfo.c' object='sysinfo.o' libtool=no DEPDIR=.deps depmode=gcc /bin/sh ../../../depcomp cc -DHAVE_CONFIG_H -I. -I. -I../../../include -I/usr/local/include -O -pipe -march=pentiumpro -c sysinfo.c
sysinfo.c: In function `check_ldap':
sysinfo.c:1539: syntax error before `*'
sysinfo.c:1564: `attr' undeclared (first use in this function)
sysinfo.c:1564: (Each undeclared identifier is reported only once
sysinfo.c:1564: for each function it appears in.)
sysinfo.c:1564: `ber' undeclared (first use in this function)
sysinfo.c:1565: `valRes' undeclared (first use in this function)
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel/work/zabbix-1.1beta1/src/libs/zbxsysinfo.
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel/work/zabbix-1.1beta1/src/libs/zbxsysinfo.
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel/work/zabbix-1.1beta1/src/libs.
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel/work/zabbix-1.1beta1/src.
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel/work/zabbix-1.1beta1.
*** Error code 1
Stop in /usr/ports/net-mgmt/zabbix-devel.
any further ideas?
btw. i know the port isnt finished yet. its just for you if you like to test.
regards,
marc
ok.. i found out that it could be a missing header file for freebsd 4.
lber.h defines BerElement functions at FreeBSD4.x (if iam right)
i added an include in work/zabbix-1.1beta1/src/libs/zbxsysinfo/sysinfo.c but still no success. anyone know a bit c and may can tell me if this could be the problem?
just as a note - on FBSD5.4 with native packages I had the same problem. All i did to fix it is just add @SNMP_LDFLAGS@ in src/zabbix_server/poller/Makefile.[am|in], similar to fix of James Wells for LDAP support: http://www.zabbix.com/forum/attachment.php?attachmentid=89
this helped several bugs ago but has nothing to do with this :/
Full solution:
1) Add @SNMP_INCLUDE@ to
1.1) line 2 on src/zabbix_server/poller/Makefile.am
1.2) line 180 on src/zabbix_server/poller/Makefile.in
2) Add @SNMP_LFLAGS@ to
2.1) line 6 on src/zabbix_server/Makefile.am
2.1) line 182 on src/zabbix_server/Makefile.in
PS: i don`t use LDAP, so it works for me ;)
as i said earlier. i mixed 2 threads by mistake. i added all this INCLUDES.. its all building and fine on BSD 5.x even ldap is building. on BSD 4 ldap wont build even with this patch.
ok.. i found out that it could be a missing header file for freebsd 4.
lber.h defines BerElement functions at FreeBSD4.x (if iam right)
i added an include in work/zabbix-1.1beta1/src/libs/zbxsysinfo/sysinfo.c but still no success. anyone know a bit c and may can tell me if this could be the problem?