Errors making Nagios with mysql

Steve OBrien sobrien at ci.bend.or.us
Fri Aug 22 00:36:53 CEST 2003


Whoops, no this is the solution that worked for me not the last.... Sorry.

Steve O'Brien
City of Bend
Network Administrator
sobrien at ci.bend.or.us
541-322-6393



tnelson at starpoint.com 
08/21/2003 11:42 AM

To
Steve OBrien <sobrien at ci.bend.or.us>
cc

Subject
Re: [Nagios-users] Errors making Nagios with mysql







I got those same errors.. it has to do w/ the way the makefile is written 
(at least on slackware 9.0).. 

find the link lines in the make files.. and add -lmysqlclient -lz jusr 
before -o .. example.. from my base/Makefile 

nagios: nagios.c $(OBJS) nagios.h $(SRC_COMMON)/locations.h 
        $(CC) $(CFLAGS) $(LDFLAGS) nagios.c $(OBJS) $(PERLLIBS) 
$(MATHLIBS) -lmysqlclient -lz -o $@ 

It seems that the version of ld we have doesn't hang on to the symbols 
unless the libs are at the end.. 

Tony Nelson
Director of IT Operations
Starpoint Solutions
115 Broadway, 2nd Fl.
New York, NY 10006





Steve OBrien <sobrien at ci.bend.or.us> 
Sent by: nagios-users-admin at lists.sourceforge.net 
08/21/2003 10:40 AM 
        
        To:        <nagios-users at lists.sourceforge.net> 
        cc:         
        Subject:        [Nagios-users] Errors making Nagios with mysql




I am getting errors when I make all after configuring Nagios with mysql 
support.  I have seen references to these errors on google and the fix was 
to put LDFLAGS= -L/usr/lib/mysql -lmysqlclient in your Makefile, well mine 
already had it in there.  Anyone else had this problem, I already know 
that DB support is questionable for the future but to me it makes no sense 
to log this data to flat files. 

[root at localhost nagios-1.1]# make all 
cd ./base && make 
make[1]: Entering directory `/home/system/src/nagios-1.1/base' 
gcc -g -O2 -I/usr/include/mysql -DHAVE_CONFIG_H -DNSCORE -L/usr/lib/mysql 
-lmysqlclient  nagios.c checks.o config.o commands.o flapping.o logging.o 
notifications.o sehandlers.o utils.o sretention.o ../xdata/xrddb.c 
../common/comments.c ../xdata/xcddb.c ../common/objects.c 
../xdata/xodtemplate.c ../common/statusdata.c ../xdata/xsddb.c perfdata.o 
../xdata/xpddefault.c ../common/downtime.c ../xdata/xdddb.c    -lm -o 
nagios 
/tmp/cc1pKEPG.o(.text+0x378): In function `xrddb_initialize': 
../xdata/xrddb.c:215: undefined reference to `mysql_init' 
/tmp/cc1pKEPG.o(.text+0x3f2): In function `xrddb_connect': 
../xdata/xrddb.c:252: undefined reference to `mysql_real_connect' 
/tmp/cc1pKEPG.o(.text+0x40d):../xdata/xrddb.c:254: undefined reference to 
`mysql_close' 
/tmp/cc1pKEPG.o(.text+0x464): In function `xrddb_disconnect': 
../xdata/xrddb.c:299: undefined reference to `mysql_close' 
/tmp/cc1pKEPG.o(.text+0x47c): In function `xrddb_query': 
../xdata/xrddb.c:329: undefined reference to `mysql_query' 
/tmp/cc1pKEPG.o(.text+0xd98): In function 
`xrddb_read_program_information': 
../xdata/xrddb.c:850: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0xdb3):../xdata/xrddb.c:854: undefined reference to 
`mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0xe79):../xdata/xrddb.c:867: undefined reference to 
`mysql_free_result' 
/tmp/cc1pKEPG.o(.text+0xf38): In function `xrddb_read_host_information': 
../xdata/xrddb.c:951: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0xf62):../xdata/xrddb.c:951: undefined reference to 
`mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0x1124):../xdata/xrddb.c:1004: undefined reference 
to `mysql_free_result' 
/tmp/cc1pKEPG.o(.text+0x11b8): In function 
`xrddb_read_service_information': 
../xdata/xrddb.c:1129: undefined reference to `mysql_store_result' 
/tmp/cc1pKEPG.o(.text+0x11e2):../xdata/xrddb.c:1129: undefined reference 
to `mysql_fetch_row' 
/tmp/cc1pKEPG.o(.text+0x1431):../xdata/xrddb.c:1195: undefined reference 
to `mysql_free_result' 
/tmp/ccTEGl8x.o(.text+0x378): In function `xcddb_initialize': 
../xdata/xcddb.c:234: undefined reference to `mysql_init' 
/tmp/ccTEGl8x.o(.text+0x3ea): In function `xcddb_connect': 
../xdata/xcddb.c:259: undefined reference to `mysql_real_connect' 
/tmp/ccTEGl8x.o(.text+0x405):../xdata/xcddb.c:261: undefined reference to 
`mysql_close' 
/tmp/ccTEGl8x.o(.text+0x45c): In function `xcddb_disconnect': 
../xdata/xcddb.c:303: undefined reference to `mysql_close' 
/tmp/ccTEGl8x.o(.text+0x474): In function `xcddb_query': 
../xdata/xcddb.c:329: undefined reference to `mysql_query' 
/tmp/ccTEGl8x.o(.text+0x5c3): In function `xcddb_validate_host_comments': 
../xdata/xcddb.c:477: undefined reference to `mysql_store_result' 
/tmp/ccTEGl8x.o(.text+0x5dd):../xdata/xcddb.c:477: undefined reference to 
`mysql_fetch_row' 
/tmp/ccTEGl8x.o(.text+0x673): In function 
`xcddb_validate_service_comments': 
../xdata/xcddb.c:566: undefined reference to `mysql_store_result' 
/tmp/ccTEGl8x.o(.text+0x68d):../xdata/xcddb.c:566: undefined reference to 
`mysql_fetch_row' 
/tmp/ccTEGl8x.o(.text+0x806): In function `xcddb_save_host_comment': 
../xdata/xcddb.c:748: undefined reference to `mysql_insert_id' 
/tmp/ccTEGl8x.o(.text+0x9da): In function `xcddb_save_service_comment': 
../xdata/xcddb.c:847: undefined reference to `mysql_insert_id' 
/tmp/cciRZnh0.o(.text+0x3e4): In function `xsddb_initialize': 
../xdata/xsddb.c:253: undefined reference to `mysql_init' 
/tmp/cciRZnh0.o(.text+0x45e): In function `xsddb_connect': 
../xdata/xsddb.c:286: undefined reference to `mysql_real_connect' 
/tmp/cciRZnh0.o(.text+0x479):../xdata/xsddb.c:288: undefined reference to 
`mysql_close' 
/tmp/cciRZnh0.o(.text+0x4e0): In function `xsddb_disconnect': 
../xdata/xsddb.c:335: undefined reference to `mysql_close' 
/tmp/cciRZnh0.o(.text+0x4f8): In function `xsddb_check_connection': 
../xdata/xsddb.c:363: undefined reference to `mysql_errno' 
/tmp/cciRZnh0.o(.text+0x571):../xdata/xsddb.c:369: undefined reference to 
`mysql_close' 
/tmp/cciRZnh0.o(.text+0x670): In function `xsddb_query': 
../xdata/xsddb.c:463: undefined reference to `mysql_query' 
/tmp/ccFlpGYl.o(.text+0x378): In function `xdddb_initialize': 
../xdata/xdddb.c:234: undefined reference to `mysql_init' 
/tmp/ccFlpGYl.o(.text+0x3ea): In function `xdddb_connect': 
../xdata/xdddb.c:259: undefined reference to `mysql_real_connect' 
/tmp/ccFlpGYl.o(.text+0x405):../xdata/xdddb.c:261: undefined reference to 
`mysql_close' 
/tmp/ccFlpGYl.o(.text+0x45c): In function `xdddb_disconnect': 
../xdata/xdddb.c:303: undefined reference to `mysql_close' 
/tmp/ccFlpGYl.o(.text+0x474): In function `xdddb_query': 
../xdata/xdddb.c:329: undefined reference to `mysql_query' 
/tmp/ccFlpGYl.o(.text+0x574): In function `xdddb_validate_host_downtime': 
../xdata/xdddb.c:473: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0x58d):../xdata/xdddb.c:473: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0x64c): In function 
`xdddb_validate_service_downtime': 
../xdata/xdddb.c:587: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0x665):../xdata/xdddb.c:587: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0x80a): In function `xdddb_save_host_downtime': 
../xdata/xdddb.c:788: undefined reference to `mysql_insert_id' 
/tmp/ccFlpGYl.o(.text+0x9e6): In function `xdddb_save_service_downtime': 
../xdata/xdddb.c:887: undefined reference to `mysql_insert_id' 
/tmp/ccFlpGYl.o(.text+0xc1d): In function `xdddb_read_host_downtime': 
../xdata/xdddb.c:1107: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0xc41):../xdata/xdddb.c:1107: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0xd23):../xdata/xdddb.c:1116: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xd40):../xdata/xdddb.c:1149: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xd95): In function `xdddb_read_service_downtime': 
../xdata/xdddb.c:1238: undefined reference to `mysql_store_result' 
/tmp/ccFlpGYl.o(.text+0xdb9):../xdata/xdddb.c:1238: undefined reference to 
`mysql_fetch_row' 
/tmp/ccFlpGYl.o(.text+0xe9f):../xdata/xdddb.c:1247: undefined reference to 
`mysql_free_result' 
/tmp/ccFlpGYl.o(.text+0xebc):../xdata/xdddb.c:1280: undefined reference to 
`mysql_free_result' 
collect2: ld returned 1 exit status 
make[1]: *** [nagios] Error 1 
make[1]: Leaving directory `/home/system/src/nagios-1.1/base' 
make: *** [all] Error 2 

Steve O'Brien
City of Bend
Network Administrator
sobrien at ci.bend.or.us
541-322-6393 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030821/3564bba9/attachment.html>


More information about the Users mailing list