Bug in "compensate_for_system_time_change"

Rob Pitman rob at pitman.co.za
Wed May 7 08:05:54 CEST 2003


Hi,

I believe there is a bug in "compensate_for_system_time_change" in the file 
nagios.c; it should not adjust the run_time for log rotation events. This 
bug is present in nagios-1.0 and in nagios-1-x-cvs.

My Linux PC running Nagios is synchronized to an NTP server, and because my 
PC's clock is not very accurate, the following message is frequently 
logged:

Warning: A system time change of 1 seconds (backwards in time) has been 
detected.  Compensating...

The problem is that the function "compensate_for_system_time_change" adjusts 
the run-time of the log rotation event (along with all other timed events) 
so that it runs a second BEFORE midnight (I am using daily log rotation). 
Since the log rotation event is a recurring event, another log rotation is 
immediately scheduled for one second later. The second log file is empty. 
As a result, the "trends", "history" and "notifications" CGIs do not 
display any data for any of the archived logfiles.

My suggested patch for the problem is attached.

Thanks,
Rob Pitman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios.diff
Type: text/x-diff
Size: 592 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20030507/4c030b68/attachment.diff>


More information about the Developers mailing list