Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Delete Comments more than n days old
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!
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!
Reviews (3)
bylthomas987, June 16, 2015
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.
bysteffan, December 2, 2011
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
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
bydiramos, November 3, 2011
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!
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!