Page 1 of 1

How to mass "un-acknowledge"?

Posted: Thu Feb 09, 2012 1:20 pm
by srosenst
Hello there!

I have a Nagios XI server (2011R2.0) running on Centos (used the VM image from Nagios) in my vCenter with SSL turned on. I used this system to replace Nagios Core. I had no problems importing all files file (~300 hosts), but since the NSClient++ and NRPE plugins couldn't connect (due to a different IP) I did a mass acknowledge of alerts. This may have been a mistake on my part. Now the server is up on production and all (OK, a lot) of services have been marked acknowledged. To make matters worse, on some of them I double acknowledged them. So there are around 700 acknowledgements that I want to get rid of, clicking the "X" is an option, but not a very attractive or practical one. I turned on debugging on the mysql queries to monitor the queries sent when I click remove acknowledgment, but it looks like the entire instance is being rewritten:
[1328788891.566966] [002.0] [pid=11434] INSERT INTO nagios_servicestatus SET instance_id='1', service_object_id='969', status_update_time=FROM_UNIXTIME(1328788890), output='NRPE v2\.12', long_output='', perfdata='', current_state='0', has_been_checked='1', should_be_scheduled='1', current_check_attempt='1', max_check_attempts='3', last_check=FROM_UNIXTIME(1328788889), next_check=FROM_UNIXTIME(1328789489), check_type='0', last_state_change=FROM_UNIXTIME(1328722281), last_hard_state_change=FROM_UNIXTIME(1328722281), last_hard_state='0', last_time_ok=FROM_UNIXTIME(1328788889), last_time_warning=FROM_UNIXTIME(0), last_time_unknown=FROM_UNIXTIME(0), last_time_critical=FROM_UNIXTIME(1328721674), state_type='1', last_notification=FROM_UNIXTIME(0), next_notification=FROM_UNIXTIME(0), no_more_notifications='0', notifications_enabled='1', problem_has_been_acknowledged='0', acknowledgement_type='0', current_notification_number='0', passive_checks_enabled='1', active_checks_enabled='1', event_handler_enabled='1', flap_detection_enabled='1', is_flapping='0', percent_state_change='0.000000', latency='0.480000', execution_time='0.359470', scheduled_downtime_depth='0', failure_prediction_enabled='1', process_performance_data='1', obsess_over_service='1', modified_service_attributes='0', event_handler='', check_command='check_nrpe', normal_check_interval='10.000000', retry_check_interval='2.000000', check_timeperiod_object_id='67' ON DUPLICATE KEY UPDATE instance_id='1', service_object_id='969', status_update_time=FROM_UNIXTIME(1328788890), output='NRPE v2\.12', long_output='', perfdata='', current_state='0', has_been_checked='1', should_be_scheduled='1', current_check_attempt='1', max_check_attempts='3', last_check=FROM_UNIXTIME(1328788889), next_check=FROM_UNIXTIME(1328789489), check_type='0', last_state_change=FROM_UNIXTIME(1328722281), last_hard_state_change=FROM_UNIXTIME(1328722281), last_hard_state='0', last_time_ok=FROM_UNIXTIME(1328788889), last_time_warning=FROM_UNIXTIME(0), last_time_unknown=FROM_UNIXTIME(0), last_time_^C
So my question is, is there a magical sql query that can mark all hosts as "un-acknowledged"?

Any help is appreciated,
Steve

Re: How to mass "un-acknowledge"?

Posted: Thu Feb 09, 2012 1:35 pm
by lmiltchev
We don't have this functionality available, yet. I just posted a feature request on our bug tracker. You can view it here:

http://tracker.nagios.com/view.php?id=232

Re: How to mass "un-acknowledge"?

Posted: Mon Feb 13, 2012 12:54 pm
by srosenst
Well I didn't find a true solution to the problem, but I no longer have the issue. Using automator (on a Mac) I was able to record mouse clicks and put it in a loop with a pause (to allow time to process) and ran it for a few hours. Now I don't have all of these acknowledgements, but used a ridiculous method of solving the problem. :P

Re: How to mass "un-acknowledge"?

Posted: Mon Feb 13, 2012 2:14 pm
by lmiltchev
Whatever works! :D Thanks for the feedback!