Mysql Errors using ndoutils and Event Broker API

Andreas Ericsson ae at op5.se
Wed Jan 18 10:44:45 CET 2006


Don Lewis wrote:
> Hello All,
> 
> Forgive me if this has been addresses already but I didn't see it on the
> archives.
> 
> Running rc2 here and everything seems to be working great until I
> installed the ndoutils mod.  I compiled my Nagios installation with
> '--enable-event-broker (not realizing it's by default now) and it
> compiled just fine and using an inserter seems to work as well.
> 
> My problem comes from when I installed the ndoutils package.  I used the
> database schema that came with it and it created all the
> tables/structures in my 'nagios' database.
> 
> After setting up the configs for ndo2db and starting the dameon and
> adding the line into nagios.cfg for the event broker and restarting
> nagios it hooked into my database and initialized just fine.  I queried
> the database on some tables to see if data was indeed getting fed into
> the database and it was.  Upon tailing /var/log/messages however I see
> tons of these scrolling by for query's trying to do INSERTS:
> ---------------------------------------------------------------------------
> Jan 17 16:29:46 nagios ndo2db: Error: mysql_query() failed for 'INSERT
> INTO ndo_programstatus SET instance_id='1',
> status_update_time=FROM_UNIXTIME(1137533385),
> program_start_time=FROM_UNIXTIME(1137533378), is_currently_running='1',
> process_id='25012', daemon_mode='1',
> last_command_check=FROM_UNIXTIME(1137533385),
> last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1',
> active_service_checks_enabled='1', passive_service_checks_enabled='1',
> active_host_checks_enabled='1', passive_host_checks_enabled='1',
> event_handlers_enabled='1', flap_detection_enabled='1',
> failure_prediction_enabled='1', process_performance_data='0',
> obsess_over_hosts='0', obsess_over_services='1',
> modified_host_attributes='0', modified_service_attributes='0',
> global_host_event_handler='', global_service_event_handler='' ON
> DUPLICATE KEY UPDATE instance_id='1',
> status_update_time=FROM_UNIXTIME(1137533385),
> program_start_time=FROM_UNIXTIME(1137533378), is_currently_running='1',
> process_id='25012', daemon_mode='1', last_command_check=FRO
> Jan 17 16:29:55 nagios ndo2db: Error: mysql_query() failed for 'INSERT
> INTO ndo_programstatus SET instance_id='1',
> status_update_time=FROM_UNIXTIME(1137533395),
> program_start_time=FROM_UNIXTIME(1137533378), is_currently_running='1',
> process_id='25012', daemon_mode='1',
> last_command_check=FROM_UNIXTIME(1137533395),
> last_log_rotation=FROM_UNIXTIME(0), notifications_enabled='1',
> active_service_checks_enabled='1', passive_service_checks_enabled='1',
> active_host_checks_enabled='1', passive_host_checks_enabled='1',
> event_handlers_enabled='1', flap_detection_enabled='1',
> failure_prediction_enabled='1', process_performance_data='0',
> obsess_over_hosts='0', obsess_over_services='1',
> modified_host_attributes='0', modified_service_attributes='0',
> global_host_event_handler='', global_service_event_handler='' ON
> DUPLICATE KEY UPDATE instance_id='1',
> status_update_time=FROM_UNIXTIME(1137533395),
> program_start_time=FROM_UNIXTIME(1137533378), is_currently_running='1',
> process_id='25012', daemon_mode='1', last_command_check=FRO
> -------------------------------------------------------------------------
> 
> This looks to be because it's trying to insert over what's already in
> the database so it considers it's a duplicate and not allowing it to
> rewrite since it's not an UPDATE.
> 

It should really be a "REPLACE INTO" since it updates all columns in the 
table (a replace is much cheaper in a properly indexed table).

> 
> Jan 17 16:30:30 nagios nagios: ndomod: NDOMOD 1.2 Copyright (c)
> 2005-2006 Ethan Galstad (nagios at nagios.org)
> Jan 17 16:30:30 nagios nagios: ndomod: Successfully connected to data
> sink.  0 queued items to flush.
> Jan 17 16:30:30 nagios nagios: Event broker module
> '/usr/local/nagios/bin/ndomod.o' initialized successfully. 
> Jan 17 16:30:30 nagios ndo2db: Successfully connected to MySQL database
> 
> But I don't think it would be brokering still and getting the info into
> the database with updates if the Broker config='0', any thoughts ?
> 

It doesn't get any events to pass, but the module is still loaded and 
does its initialization (it could check if event_broker_options is 0 and 
then not even do that, but it doesn't).

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642




More information about the Developers mailing list