Problem when using postgre or mysql
Martin, Jeremy
jmartin at gsi-kc.com
Thu Oct 7 18:54:11 CEST 2004
Hi,
I'm having some problems getting Nagios 1.2 to compile using pgsql or
mysql. I was asked to get it working with pgsql but I had no luck with
either. I've set up lots of 'normal' Nagios servers but this is the
first time I attempted to use a database instead of the normal log file.
The reason I was asked to set this up is so we could set up some
automated email reports showing the total number alerts for servers etc
once in a while.
I tried using postgre sql in RedHat9 with Nagios 1.2 and
postgresql-7.3.2-3 / postgresql-server-7.3.2-3 / postgresql-libs-7.3.2-3
/ postgresql-devel-7.3.2-3 from RedHat... Also I tried in CentOS 3.3
(free RedHat ES3 clone) using rh-postgresql-7.3.4-9 /
rh-postgresql-devel-7.3.4-9 / rh-postgresql-libs-7.3.4-9 /
rh-postgresql-docs-7.3.4-9 ... For MySQL I tried in CentOS 3.3 using
MySQL 4.0.20 from mysql.com. I was going to try using something from
postgre's website but it was having problems last night and I couldn't
get the 'download' page to come up.
For both postgre and mysql the compile errors looked pretty similar. I
could ./configure fine but make all would fail. Anyone have an idea of
how to get this set up? I did some searching but couldn't find anything.
I was asked to try to use postgre if possible though I'm much more used
to mysql...
Cheers!
####################################################################
./configure --with-mysql-comments --with-mysql-extinfo
--with-mysql-retention --with-mysql-downtime --with-mysql-status
--with-mysql-xdata --with-mysql-lib=/var/lib/mysql/
--with-mysql-inc=/usr/include/mysql/
General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagios
Embedded Perl: no
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Init directory: /etc/rc.d/init.d
Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /bin/traceroute
External Data Routines:
------------------------
Status data: Database (MySQL)
Object data: Template-based (text file)
Comment data: Database (MySQL)
Downtime data: Database (MySQL)
Retention data: Database (MySQL)
Peformance data: Default (external commands)
Extended info data: Database (MySQL)
[root at orinoco nagios-1.2]# make all
cd ./base && make
make[1]: Entering directory `/usr/local/src/nagios-1.2/base'
gcc -g -O2 -I/usr/include/mysql/ -DHAVE_CONFIG_H -DNSCORE
-L/var/lib/mysql/ 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
sretention.o(.text+0x27): In function `save_state_information':
/usr/local/src/nagios-1.2/base/sretention.c:86: undefined reference to
`xrddefault_save_state_information'
sretention.o(.text+0x87): In function `read_initial_state_information':
/usr/local/src/nagios-1.2/base/sretention.c:122: undefined reference to
`xrddefault_read_state_information'
/tmp/ccDreMLr.o(.text+0x378): In function `xrddb_initialize':
../xdata/xrddb.c:215: undefined reference to `mysql_init'
/tmp/ccDreMLr.o(.text+0x3f2): In function `xrddb_connect':
../xdata/xrddb.c:252: undefined reference to `mysql_real_connect'
/tmp/ccDreMLr.o(.text+0x40d):../xdata/xrddb.c:254: undefined reference
to `mysql_close'
<snip>
../xdata/xdddb.c:1107: undefined reference to `mysql_store_result'
/tmp/cclf8JjX.o(.text+0xc41):../xdata/xdddb.c:1107: undefined reference
to `mysql_fetch_row'
/tmp/cclf8JjX.o(.text+0xd23):../xdata/xdddb.c:1116: undefined reference
to `mysql_free_result'
/tmp/cclf8JjX.o(.text+0xd40):../xdata/xdddb.c:1149: undefined reference
to `mysql_free_result'
/tmp/cclf8JjX.o(.text+0xd95): In function `xdddb_read_service_downtime':
../xdata/xdddb.c:1238: undefined reference to `mysql_store_result'
/tmp/cclf8JjX.o(.text+0xdb9):../xdata/xdddb.c:1238: undefined reference
to `mysql_fetch_row'
/tmp/cclf8JjX.o(.text+0xe9f):../xdata/xdddb.c:1247: undefined reference
to `mysql_free_result'
/tmp/cclf8JjX.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 `/usr/local/src/nagios-1.2/base'
make: *** [all] Error 2
####################################################################
(I can't seem to find "libpq-fe.h" anywhere)
./configure --with-pgsql-comments --with-pgsql-extinfo
--with-pgsql-retention --with-pgsql-downtime--with-pgsql-status
--with-pgsql-xdata; --with-pgsql-lib=/var/lib/pgsql/
--with-pgsql-inc=/usr/include/pgsql/
General Options:
-------------------------
Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagios
Embedded Perl: no
Install ${prefix}: /usr/local/nagios
Lock file: ${prefix}/var/nagios.lock
Init directory: /etc/rc.d/init.d
Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /bin/traceroute
External Data Routines:
------------------------
Status data: Database (PostgreSQL)
Object data: Template-based (text file)
Comment data: Database (PostgreSQL)
Downtime data: Database (PostgreSQL)
Retention data: Database (PostgreSQL)
Peformance data: Default (external commands)
Extended info data: Database (PostgreSQL)
## in CentOS 3.3
[root at orinoco nagios-1.2]# make all
cd ./base && make
make[1]: Entering directory `/usr/local/src/nagios-1.2/base'
gcc -g -O2 -DHAVE_CONFIG_H -DNSCORE -lpq 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
../xdata/xrddb.c:46:28: pgsql/libpq-fe.h: No such file or directory
../xdata/xrddb.c:63: syntax error before '*' token
../xdata/xrddb.c:63: warning: data definition has no type or storage
class
../xdata/xrddb.c:64: syntax error before '*' token
../xdata/xrddb.c:64: warning: data definition has no type or storage
class
../xdata/xrddb.c: In function `xrddb_connect':
<snip>
../xdata/xdddb.c:1304: warning: passing arg 1 of `atoi' makes pointer
from integer without a cast
../xdata/xdddb.c:1307: warning: passing arg 1 of `strtoul' makes pointer
from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 1 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 2 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 4 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 5 of `add_service_downtime'
makes pointer from integer without a cast
make[1]: *** [nagios] Error 1
make[1]: Leaving directory `/usr/local/src/nagios-1.2/base'
make: *** [all] Error 2
## in RedHat 9
[root at fbdnms01 nagios-1.2]# make all
cd ./base && make
make[1]: Entering directory `/root/nagios-1.2/base'
gcc -g -O2 -I/usr/include/pgsql/ -DHAVE_CONFIG_H -DNSCORE
-L/var/lib/pgsql/ -lpq 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
../xdata/xrddb.c:46:28: pgsql/libpq-fe.h: No such file or directory
../xdata/xrddb.c:63: parse error before '*' token
../xdata/xrddb.c:63: warning: data definition has no type or storage
class
../xdata/xrddb.c:64: parse error before '*' token
../xdata/xrddb.c:64: warning: data definition has no type or storage
class
<snip>
../xdata/xdddb.c: In function `xdddb_read_service_downtime':
../xdata/xdddb.c:1292: warning: passing arg 1 of `atoi' makes pointer
from integer without a cast
../xdata/xdddb.c:1295: warning: passing arg 1 of `strtoul' makes pointer
from integer without a cast
../xdata/xdddb.c:1298: warning: passing arg 1 of `strtoul' makes pointer
from integer without a cast
../xdata/xdddb.c:1301: warning: passing arg 1 of `strtoul' makes pointer
from integer without a cast
../xdata/xdddb.c:1304: warning: passing arg 1 of `atoi' makes pointer
from integer without a cast
../xdata/xdddb.c:1307: warning: passing arg 1 of `strtoul' makes pointer
from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 1 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 2 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 4 of `add_service_downtime'
makes pointer from integer without a cast
../xdata/xdddb.c:1310: warning: passing arg 5 of `add_service_downtime'
makes pointer from integer without a cast
make[1]: *** [nagios] Error 1
make[1]: Leaving directory `/root/nagios-1.2/base'
make: *** [all] Error 2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20041007/63b83079/attachment.html>
More information about the Users
mailing list