Hi Team,
I would like to know about the nagios.log. I have noticed that every day logs are rotated at 23:59 and moved the directory archives. This logs are rotated every day as it is configured as "log_rotation_method=d".
Now my queries are:
1. How nagios does this process and where it is configured to do so.
2. I want to keep only 30 days files in archives and how can i achieve this.
Nagios Log Rotation
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Log Rotation
This is managed withing the nagios processmg00513682 wrote:1. How nagios does this process and where it is configured to do so.
Before I show you how to do it, I want to state that the archives are required for the availability as well as other reports to work.mg00513682 wrote:2. I want to keep only 30 days files in archives and how can i achieve this.
That said, if you want to remove files older that 30 days you should be able to run the following on a cron
Code: Select all
find /usr/local/nagios/var/archives/nagios-*.log -mtime +30 -exec rm {} \;