NDOUtils inserting into nagios_configfilevariables error Pl

I am getting some insert errors for the nagios_configfilevariables table when I load NDOUtils I was wondering if any one knows how to fix this. Any help would be greatly appreciated.

Oct 3 08:12:05 cactor ndo2db-3x: Successfully connected to MySQL database
Oct 3 08:12:05 cactor ndo2db-3x: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘2’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/contacts.cfg’‘
Oct 3 08:12:05 cactor ndo2db-3x: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘2’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/timeperiods.cfg’‘
Oct 3 08:12:05 cactor ndo2db-3x: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘2’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/templates.cfg’‘
Oct 3 08:12:05 cactor ndo2db-3x: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘2’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/localhost.cfg’'
Oct 3 08:12:05 cactor nagios: ndomod: Successfully flushed 1308 queued items to data sink.

Corey

Hi,
Did you give permissions to nagios user for mysql. If not, try it by giving permissions. I think it will work.

512

I have this issue as well, it’s only for the configfile entries and I think that this is a ‘legacy’ problem from where nagios moved to multiple config files from a single one they forgot to reconfigure the broker to account for that.

I’m having the same problem.

Nagios v 3.0.5
NDOUtils v 1.4b7

I can manually add records to the table as the nagios user, but I get these errors when I restart Nagios:

Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/contacts.cfg’‘
Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/timeperiods.cfg’‘
Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/templates.cfg’‘
Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/switch.cfg’‘
Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/snmpservices.cfg’‘
Nov 21 10:49:25 localhost ndo2db: Error: mysql_query() failed for ‘INSERT INTO nagios_configfilevariables SET instance_id=‘1’, configfile_id=‘3’, varname=‘cfg_file’, varvalue=’/usr/local/nagios/etc/objects/servers.cfg’’

Anyone have any ideas? Maybe in the source of either Nagios or NDOUtils? If I know what to look for, I might be able to find it and correct it, if it is in the code.

Well, it seems that things are working (as far as there is data going into tables).

I still get the same sql_query() errors whenever I restart nagios. I don’t know. Maybe I’ll let it run for a while and see what happens?

Solution
I re created the Index.

ALTER TABLE nagios_configfilevariables DROP INDEX instance_id , ADD INDEX instance_id ( instance_id , configfile_id );.

after that I didn’t get any errors

-Eva