NDO utils bug/explanation
Frassinelli, Marco
marco.frassinelli at eds.com
Fri Sep 18 12:25:55 CEST 2009
Hi,
I think is not a correct behavior because visualization software as nagvis and others uses the table programstatus to check if nagios is running.
I saw that often this table is empty. Code calculates the difference between now() and status_update_time. If the record is null this difference is far more than the configurable interval, tipical 180 sec.
The problem is that this difference suddenly vary from near 0 to infinity.
Perhaps this is a problem in my ndo setup, and those deletes normally occurs rarely. But I saw them every 60 seconds.
Here ndo2db log:
[1253268542.667382] [002.0] [pid=22380] DELETE FROM nagios_hoststatus WHERE instance_id='1'
[1253268542.669377] [002.0] [pid=22380] DELETE FROM nagios_servicestatus WHERE instance_id='1'
[1253268542.702713] [002.0] [pid=22380] DELETE FROM nagios_contactstatus WHERE instance_id='1'
[1253268542.714290] [002.0] [pid=22380] DELETE FROM nagios_timedeventqueue WHERE instance_id='1'
[1253268542.721312] [002.0] [pid=22380] DELETE FROM nagios_comments WHERE instance_id='1'
[1253268542.722317] [002.0] [pid=22380] DELETE FROM nagios_scheduleddowntime WHERE instance_id='1'
[1253268542.723311] [002.0] [pid=22380] DELETE FROM nagios_runtimevariables WHERE instance_id='1'
[1253268542.724306] [002.0] [pid=22380] DELETE FROM nagios_customvariablestatus WHERE instance_id='1'
[1253268542.725313] [002.0] [pid=22380] DELETE FROM nagios_configfiles WHERE instance_id='1'
[1253268542.726695] [002.0] [pid=22380] DELETE FROM nagios_configfilevariables WHERE instance_id='1'
[1253268542.773375] [002.0] [pid=22380] DELETE FROM nagios_customvariables WHERE instance_id='1'
[1253268542.779765] [002.0] [pid=22380] DELETE FROM nagios_commands WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_timeperiods WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_timeperiod_timeranges WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_contactgroups WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_contactgroup_members WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_hostgroups WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_hostgroup_members WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_servicegroups WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_servicegroup_members WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_hostescalations WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_hostescalation_contacts WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_serviceescalations WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_serviceescalation_contacts WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_hostdependencies WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_servicedependencies WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_contacts WHERE instance_id='1'
[1253268542.780387] [002.0] [pid=22380] DELETE FROM nagios_contact_addresses WHERE instance_id='1'
[1253268542.781384] [002.0] [pid=22380] DELETE FROM nagios_contact_notificationcommands WHERE instance_id='1'
[1253268542.781385] [002.0] [pid=22380] DELETE FROM nagios_hosts WHERE instance_id='1'
[1253268542.782384] [002.0] [pid=22380] DELETE FROM nagios_host_parenthosts WHERE instance_id='1'
[1253268542.782384] [002.0] [pid=22380] DELETE FROM nagios_host_contacts WHERE instance_id='1'
[1253268542.782384] [002.0] [pid=22380] DELETE FROM nagios_services WHERE instance_id='1'
[1253268542.784370] [002.0] [pid=22380] DELETE FROM nagios_service_contacts WHERE instance_id='1
[....]
[1253268601.894373] [002.0] [pid=22671] DELETE FROM nagios_hoststatus WHERE instance_id='1'
[1253268601.897396] [002.0] [pid=22671] DELETE FROM nagios_servicestatus WHERE instance_id='1'
[1253268601.906408] [002.0] [pid=22671] DELETE FROM nagios_contactstatus WHERE instance_id='1'
[1253268601.907455] [002.0] [pid=22671] DELETE FROM nagios_timedeventqueue WHERE instance_id='1'
[1253268601.911438] [002.0] [pid=22671] DELETE FROM nagios_comments WHERE instance_id='1'
[1253268601.912334] [002.0] [pid=22671] DELETE FROM nagios_scheduleddowntime WHERE instance_id='1'
[1253268601.913350] [002.0] [pid=22671] DELETE FROM nagios_runtimevariables WHERE instance_id='1'
[1253268601.914454] [002.0] [pid=22671] DELETE FROM nagios_customvariablestatus WHERE instance_id='1'
[1253268601.915378] [002.0] [pid=22671] DELETE FROM nagios_configfiles WHERE instance_id='1'
[1253268601.916336] [002.0] [pid=22671] DELETE FROM nagios_configfilevariables WHERE instance_id='1'
[1253268601.918447] [002.0] [pid=22671] DELETE FROM nagios_customvariables WHERE instance_id='1'
[1253268601.919356] [002.0] [pid=22671] DELETE FROM nagios_commands WHERE instance_id='1'
[1253268601.921328] [002.0] [pid=22671] DELETE FROM nagios_timeperiods WHERE instance_id='1'
[1253268601.922388] [002.0] [pid=22671] DELETE FROM nagios_timeperiod_timeranges WHERE instance_id='1'
[1253268601.923332] [002.0] [pid=22671] DELETE FROM nagios_contactgroups WHERE instance_id='1'
[1253268601.924317] [002.0] [pid=22671] DELETE FROM nagios_contactgroup_members WHERE instance_id='1'
[1253268601.925318] [002.0] [pid=22671] DELETE FROM nagios_hostgroups WHERE instance_id='1'
[1253268601.926308] [002.0] [pid=22671] DELETE FROM nagios_hostgroup_members WHERE instance_id='1'
[1253268601.927392] [002.0] [pid=22671] DELETE FROM nagios_servicegroups WHERE instance_id='1'
[1253268601.928311] [002.0] [pid=22671] DELETE FROM nagios_servicegroup_members WHERE instance_id='1'
[1253268601.930321] [002.0] [pid=22671] DELETE FROM nagios_hostescalations WHERE instance_id='1'
[1253268601.932344] [002.0] [pid=22671] DELETE FROM nagios_hostescalation_contacts WHERE instance_id='1'
[1253268601.933312] [002.0] [pid=22671] DELETE FROM nagios_serviceescalations WHERE instance_id='1'
[1253268601.934299] [002.0] [pid=22671] DELETE FROM nagios_serviceescalation_contacts WHERE instance_id='1'
[1253268601.935316] [002.0] [pid=22671] DELETE FROM nagios_hostdependencies WHERE instance_id='1'
[1253268601.936415] [002.0] [pid=22671] DELETE FROM nagios_servicedependencies WHERE instance_id='1'
[1253268601.937305] [002.0] [pid=22671] DELETE FROM nagios_contacts WHERE instance_id='1'
[1253268601.938296] [002.0] [pid=22671] DELETE FROM nagios_contact_addresses WHERE instance_id='1'
[1253268601.939302] [002.0] [pid=22671] DELETE FROM nagios_contact_notificationcommands WHERE instance_id='1'
[1253268601.940374] [002.0] [pid=22671] DELETE FROM nagios_hosts WHERE instance_id='1'
[1253268601.941320] [002.0] [pid=22671] DELETE FROM nagios_host_parenthosts WHERE instance_id='1'
[1253268601.943300] [002.0] [pid=22671] DELETE FROM nagios_host_contacts WHERE instance_id='1'
[1253268601.944362] [002.0] [pid=22671] DELETE FROM nagios_services WHERE instance_id='1'
[1253268601.948335] [002.0] [pid=22671] DELETE FROM nagios_service_contacts WHERE instance_id='1'
1253268542 - 1253268601 = 59
As you can see the ndo2db pid varies, I think that when it has no more data the child exits, an a new one is forked. The new child then deletes records in db.
Thanks
Marco
From: Michael Friedrich [mailto:michael.friedrich at univie.ac.at]
Sent: giovedì 17 settembre 2009 17.53
To: Nagios Developers List
Subject: Re: [Nagios-devel] NDO utils bug/explanation
Hi,
Frassinelli, Marco wrote the following on 17.09.2009 17:11:
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_PROGRAMSTATUS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_HOSTSTATUS]);
ndo2db_db_clear_table(idi,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICESTATUS]);
What makes you believe that this cleanup is wrong? Did you do a deeper look at the conditional statement above which makes sure that old data compared to real time data won't stay in the database?
Of course, it causes a heavy load on the database throwing big delete statements. Worst case scenario, that the queries take too long and everythings screws up.
Kind regards,
Michael
--
DI (FH) Michael Friedrich
michael.friedrich at univie.ac.at
Tel: +43 1 4277 14359
Vienna University Computer Center
Universitaetsstrasse 7
A-1010 Vienna, Austria
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20090918/6955b355/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel
More information about the Developers
mailing list