Build precise queries to find exactly what you need
Press ESC to close
Your review has been submitted and is pending approval.
This script automatically removes Nagios acknowledgements that have been not fixed since last script execution. It is mainly destined to run on some regular bases in connection to the cron daemon. The script is also capable of sending out the report into external recipients via e-mail.
Current Version
1.0
Last Release Date
2012-02-27
Owner
Tytus Kurek
Website
http://tkurek.blogspot.com/
License
GPL
Compatible With
The script removes the acknowledgements that are older than n minutes / hours / days / weeks based on content of cron daemon. E.g. if you want to remove the acknowledgements that are older than 1 day, then you must run the script via cron daemon on a daily bases:
0 10 * * * /usr/local/bin/nagiosAckRm.pl
If you want to remove the acknowledgements that are older than 1 week, then you must run the script via cron daemon on a weekly bases:
0 10 * * 1 /usr/local/bin/nagiosAckRm.pl
And so on.
The 'Platform specific settings' section needs to be updated depending on the platform being used. It has been successfully tested on the official Nagios XI VM from Nagios.
In order to make the report via e-mail feature working you must:
* uncomment and set the variables in 'Platform specific settings' section * uncomment 'sendReport' subroutine in 'Subroutines execution' section * remove both '=cut' marks inside the script that disable 'sendReport' subroutine definition
This script does work. The tricky part is finding the correct offset to use when parsing the "retention.dat" file, which is the count of the number of lines (exclusive) from the beginning of a host or service definition to the "problem_has_been_acknowledged=" line. (I use "$hostAcknowledgementThreshold = 39" and "$serviceAcknowledgementThreshold = 45"). Also the script does not properly acquire the service name because it is searching for "display_name", but the "retention.dat" file only provides "service_description" (in later versions of Nagios). So the regex in the script source needs to be updated.
Requires an initial ACKs file report to base actions on. Tried touching an empty file couldn't figure out it's requirements so this script doesn't work.
You must be logged in to submit a review.
To:
From: