[Nagios-devel] ndoutils startup error for config files

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] ndoutils startup error for config files

Post by Guest »

I have started testing Nagios 3.0 along with ndoutils 1.4b7 and have
some errors when ndo2db-3x starts. This is my first installation of
ndoutils so I do not have much experience with it or do I have any of
the older versions installed.

Here is what I get in the syslog:
Mar 14 16:10:14 az50cimlnx02 nagios: Local time is Fri Mar 14 16:10:14 MST 2008
Mar 14 16:10:14 az50cimlnx02 nagios: LOG VERSION: 2.0
Mar 14 16:10:14 az50cimlnx02 nagios: ndomod: NDOMOD 1.4b7 (10-31-2007)
Copyright (c) 2005-2007 Ethan Galstad ([email protected])
Mar 14 16:10:14 az50cimlnx02 nagios: ndomod: Could not open data sink!
I'll keep trying, but some output may get lost...
Mar 14 16:10:14 az50cimlnx02 nagios: Event broker module
'/cim/nagios/bin/ndomod-3x.o' initialized successfully.
Mar 14 16:10:14 az50cimlnx02 nagios: Finished daemonizing... (New PID=6242)
Mar 14 16:10:30 az50cimlnx02 nagios: ndomod: Still unable to connect
to data sink. 0 items lost, 382 queued items to flush.
Mar 14 16:10:46 az50cimlnx02 nagios: ndomod: Successfully connected to
data sink. 458 queued items to flush.
Mar 14 16:10:46 az50cimlnx02 nagios: ndomod: Successfully flushed 458
queued items to data sink.
Mar 14 16:10:46 az50cimlnx02 ndo2db-3x: Successfully connected to MySQL database
Mar 14 16:10:50 az50cimlnx02 ndo2db-3x: Error: mysql_query() failed
for 'INSERT INTO nagios_configfilevariables SET instance_id='1',
configfile_id='5', varname='cfg_file',
varvalue='/cim/nagios/etc/misccommands\.cfg''

It looks like what is happening is that when ndo inserts the
configfilevalues into the table it does not create a unique key for
each of the nagios.cfg cfg_file or cfg_dir entries.

I have only one entry in the configfiles table:
6 1 0 /cim/nagios/etc/nagios.cfg

I have only one entry in the configfilevariables for a varname of cfg_file
402 1 6 cfg_file /cim/nagios/etc/checkcommands.cfg

and only one for a varname of cfg_dir
403 1 6 cfg_dir /cim/nagios/etc/hostext

Both of these entries are the "first of their kind" in the nagios.cfg
file. All the other cfg_file or cfg_dir entries result in an error.

This seems to be an issue with how dbhandlers.c does the inserts. The
code in the ndo2db_handle_configfilevariables function does not handle
multiple configfilevariables with the same name. These inserts are
prevented by the unique index on configfilevariables called
instance_id(instance_id,configfile_id,varname). There is no increment
of the configfile_id or an insert into the configfiles for each new
cfg_file encountered.

If someone can provide me with some more information about the
database structure of configfiles and configfilevariables I might be
able to come up with a solution.

Keith





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked