Re: [Nagios-devel] Mysql Errors using ndoutils and Event Broker API
Posted: Wed Jan 18, 2006 1:44 am
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 ([email protected])
> 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
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
> 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 ([email protected])
> 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
...[email truncated]...
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]