Problem with log rotation

Henry Swanepoel HenryS at discovery.co.za
Mon Mar 24 14:20:05 CET 2003


> I have some problems with the log rotation option of Nagios. At the
moment, I'm
> using weekly log rotation (but the same problem also occured with daily
> rotation). When log rotation takes place two files are created in the
archive
> directory: 

*snip*

> Most events are included in the nagios-03-22-2003-23.log (e.g.
> nagios-03-23-2003-00.log just contains "[1048373973] LOG ROTATION:
WEEKLY").
> The cgi-scripts (like history.cgi) are looking for archived log files
> ending with -00.log, therefore not all messages are displayed in the web
> interface. What has to be done in order to get Nagios to display all
messages
> related to a log period? 

*snip*

I've run into the same problem.  To fix the reporting, I simply renamed the
relevant 'full' log file to end with a -00.log, which fixed the reporting.
As
for the cause, I've come to the conclusion that some kind of race exists
that
causes the file to be rotated a fraction before midnight, hence the -23.log
ending, and again on or after midnight.  It would appear that the first
file's
handle then gets passed back, which explains why it get the data.

Exactly how I've not figured out yet, as I've not had much time to devote to
this, and in the 8 months we've been running Nagios, only 4 files have ended
up this way.  When I get some time, I plan to dig deeper into the mystery
that
is the source. ;)

FWIW  :)

-- 
Live long and Prosper

============================================================================
====
Henry Swanepoel                       | Office: +27 11 529 1057
Internet Infrastructure Administrator | henrys AT discovery DOT co DOT za
Discovery Health (PTY) Ltd.           | 155 West Street, Sandton, 2146
Reg. #: 1997/13480/07                 | http://www.discoveryhealth.co.za/
============================================================================
====

This message and any attachments are confidential and intended solely for
the
addressee.  If you have received this message in error, please notify
Discovery
Holdings Ltd immediately, telephone number +27-11-529 2888.  Any
unauthorised
use, alteration or dissemination is prohibited.  Discovery Holdings Ltd
accepts
no liability whatsoever for any loss, whether it be direct, indirect or
consequential, arising from information made available and actions resulting
therefrom. 


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
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