Nagios log rotation query

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
rituraj966323
Posts: 24
Joined: Tue Jul 17, 2018 9:40 am

Nagios log rotation query

Post by rituraj966323 »

Hi Team,

I would like to know about the nagios.log. I have noticed that every hour logs are rotated and moved the directory archives. This logs are rotated every hour as it is configured as "log_rotation_method=h".

-rw-r--r-- 1 nagios nagios 219K Dec 15 10:59 nagios-12-15-2018-11.log
-rw-r--r-- 1 nagios nagios 249K Dec 15 11:59 nagios-12-15-2018-12.log
[root@prod-nagios archives]#


Now my queries is:
2. I want to roatate logs for ever 15 minutes and keep retention for 30 days.

Regards,
Rituraj
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios log rotation query

Post by scottwilkerson »

Log Rotation Method can only be set to one of the following
Format: log_rotation_method=<n/h/d/w/m>
Example: log_rotation_method=d

This is the rotation method that you would like Nagios to use for your log file. Values are as follows:

n = None (don't rotate the log - this is the default)
h = Hourly (rotate the log at the top of each hour)
d = Daily (rotate the log at midnight each day)
w = Weekly (rotate the log at midnight on Saturday)
m = Monthly (rotate the log at midnight on the last day of the month)
https://assets.nagios.com/downloads/nag ... ion_method

And nagios doesn't have any mechanism to remove logs as they are required to calculate availability data, if you want to remove old logs, you would need to write a a script and setup a cron to perform this action.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked