Log rotation with Logrotate

Andreas Ericsson ae at op5.se
Wed Oct 31 15:10:36 CET 2007


Marc Haber wrote:
> Hi,
> 
> Packaging Nagios for Debian means doing things in a way that users
> might expect them to be done to avoid confusion.

Nagios users' confusion, or Debian users' confusion? The Nagios users
will ofcourse expect Nagios to rotate its own logs, while Debian folks
with no clue of Nagios will (most likely) expect logrotate to do it
for them.

Nagios is a state machine. It reacts on state switches. It can load
state from files, but doing so is obviously less optimal than just
keeping them in memory. For large to huge networks, loading them
from file may not be an option.

Apart from that, you'll have to make sure that the nagios.cfg file
is kept in sync with the logrotate config somehow, since the cgi's
do some clever things that requires them to know when the logs are
rotated. AFAIK, logrotate can't make logfiles with the names expected
by the CGI's, so unless you have another gui to use with Nagios, I'd
really recommend you either patch the cgi's (extensively) or don't
fiddle with it.

> One of these expected
> things is that logs are rotated using logrotate, which allows people
> to specify, for example, how many log generations are to be held.
> 

Historical monitoring data can be of great value and should, basically,
never be rotated out.


> Unfortunately, to do so, we need to disable nagios' built-in log
> rotation or we get double rotated logs.
> 
> Is it possible to tell nagios not to rotate the logs?


Not that I know of, no.


> How will nagios
> react when logrotate moves the log file away?
> 

Try and find out?

All in all, it's probably not worth bothering with, as you'll break
more things than you'll fix.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list