--------------Boundary-00=_U96IFUMNTX69FIJ7LW6O
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 8bit
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
--------------Boundary-00=_U96IFUMNTX69FIJ7LW6O
Content-Type: text/x-diff;
charset="us-ascii";
name="nagios.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="nagios.diff"
diff -r -u3 nagios-1-x-cvs/base/nagios.c nagios-1-x-patch/base/nagios.c
--- nagios-1-x-cvs/base/nagios.c Mon Nov 25 04:59:26 2002
+++ nagios-1-x-patch/base/nagios.c Tue May 6 17:20:44 2003
@@ -1821,6 +1821,10 @@
/* adjust the next run time for all high priority timed events */
for(temp_event=event_list_high;temp_event!=NULL;temp_event=temp_event->next){
+ /* DON'T adjust log rotation events, it causes chaos! */
+ if (temp_event->event_type == EVENT_LOG_ROTATION)
+ continue;
+
/* we moved back in time... */
if(last_time>current_time){
Only in nagios-1-x-patch/: subst
--------------Boundary-00=_U96IFUMNTX69FIJ7LW6O--
This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]