Nagios Log Archive Maintenance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
toodaly
Posts: 63
Joined: Wed Jun 19, 2013 3:39 pm

Nagios Log Archive Maintenance

Post by toodaly »

I currently use the nagios.cfg defaults:
log_rotation_method=d
log_archive_path=/usr/local/nagios/var/archives/
I get nagios-<MM>-<DD>-<YYYY>-00.log as expected once per day. Is there a setting to say only archive the last 30 or 60 days (i.e. 30 day rotating archive)? My other option would be to set up a cron job to remove any Nagios archive file older than 30 or 60 days. Is the log archive designed to keep going until there is no room left on the partition?

Thanks.
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Nagios Log Archive Maintenance

Post by jdalrymple »

No nagios options.

Code: Select all

find /usr/local/nagios/var/archives -mtime +365  -exec rm {} \;
in cron should do fine for you. Adjust 365 as you see fit.
Locked