Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
A simple perl script to delete host and service comments older than a given number of days.
Current Version
none
Last Release Date
2011-08-19
Owner
Jim Avery
License
GPL
Compatible With
Perl Script del_comments
This script works by parsing the status.dat file then submitting commands via the command interface. Read the script contents to see how it should be run and to see what it does. If you want to delete all comments, simply specify -d 0. I'm not a programmer by trade so please forgive me if this isn't the best perl you have seen! Note the script must be run by a user that has write access to the command pipe (typically that will be user 'nagios'). I strongly recommend you test this yourself by specifying a junk output file (for example /var/tmp/mytestfile.junk) before letting it write commands to your production system command file!
This did exactly what it said it would. No logging, not much error checking but fast and efficient and cleared all the old stuff out as expected.
Not working for me, downloadet the script chmod +x delete_old_comments.pl sudo ./delete_old_comments.pl -d 10 -s /usr/local/nagios/var/status.dat -c /usr/local/nagios/rw/nagios.cmd and nothing happens, the script runs, but no errors, no output, and no comments deleted (even tho there are a lot comments over 10 days old.) so doesn't work, sadly. i use Nagios Core Version 3.2.3
Great sript! Very useful for me. In my company we use Nagios totally based on host and services comments. So, over time, thousands of comments accumulate, causing slowdowns in Nagios and greatly increasing the check latency. The script completely corrected this problem. Congratulations and thank you very much!
You must be logged in to submit a review.
To:
From: