Comments and Acknowledgements

Remove acknowledgements older than n hours / days / weeks and send a report

Description:

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

Compatible With

  • Nagios 3.x
  • Nagios XI

Owner

License

GPL


Project Files
Project Notes
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
Reviews (2) Add a Review
Script works but requires adjustments
by mvanle, January 31, 2016

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.



No such file or directory
by bensode, February 28, 2015

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.



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
1.5 (2)
Favorites
1
Views
49,646