Page 2 of 3

Re: Wrong date for downtime?

Posted: Tue Apr 05, 2011 11:18 am
by rdedon
Just an update that we are still looking this over to figure out the cause.

Re: Wrong date for downtime?

Posted: Tue May 31, 2011 8:00 am
by alexlacraru
hi there, I just installed 1.3 on Friday, but this is still an issue. I have recurring downtime scheduled for TUE-WED-THU but everything was double scheduled WED-THU-FRI this week...
I'll delete all the recurring downtimes and recreate them, anything else I can try?
thanks!
Alex

Re: Wrong date for downtime?

Posted: Tue May 31, 2011 1:50 pm
by mguthrie
So can I have you clarify the issue you're facing to make sure I understand it correctly.

When you schedule the downtime, it schedules it for the correct time, but then it schedules an additional downtime that appears to be a day later?

Re: Wrong date for downtime?

Posted: Wed Jun 01, 2011 1:37 pm
by alexlacraru
not necessarily, it seemed to have created 2 downtimes a week, the time is right but day is wrong. this week however ws the first time it created wed-thu for the events scheduled on tue, usually it was creating tue-wed.
I've deleted all the scheduled downtimes and I'll be waiting for Friday (when the last ones are scheduled) before re-creating them.
these scheduled downtimes were created long before we had the license in and we were running 2009R1.4, in the mean time I upgraded to 2011r1, r1.1, r1.3 but never re-created the schedules.
alex

Re: Wrong date for downtime?

Posted: Fri Jun 03, 2011 1:43 pm
by alexlacraru
ok, I've deleted all the recurring downtimes, waited for all of them to pass so all the hosts had nothing scheduled.
I've created 5 scheduled downtimes for 5 hostgroups, all of them on Tuesday morning, 6-8am.
here's what I have in the host after this was applied:

By (Nagios Process) at 2011-06-03 00:01:01
This host has been scheduled for fixed downtime from 06-07-2011 06:00:00 to 06-07-2011 08:00:00. Notifications for the host will not be sent out during that time period.
By (Nagios Process) at 2011-06-02 15:01:01
This host has been scheduled for fixed downtime from 06-08-2011 06:00:00 to 06-08-2011 08:00:00. Notifications for the host will not be sent out during that time period.

Is this stored anywhere in the db? I only found a table with the 5 recurring downtimes I've created.
is it possible that the scheduled job that creates them doesn't update the table properly and it runs again? strange though the first run creates the downtime for Wednesday, the second one creates the right one.
alex

Re: Wrong date for downtime?

Posted: Fri Jun 03, 2011 2:25 pm
by mguthrie
That is strange, and it does appear to be a bug somewhere, but I'm wondering if it's in Nagios Core, which might be a little harder to find. I checked our tracker and this issue has already been reported, so we'll see if we can bump it up on our priority list.
http://tracker.nagios.com/view.php?id=136

Re: Wrong date for downtime?

Posted: Tue Sep 20, 2011 9:37 am
by alexlacraru
hi there, the issue is with the logic in recurringdowntime.pl, I fixed it in my install and it's been running fine for 3 weeks now.
there were 2 issues:
- on some dates it would skip the next week, creating a schedule some time far in the future; one of the conditions has an 'and' and for some reason that would not be processed all the time (?!), so I replaced that with a second if;
- the second issue was creating a 2 consecutive schedules for each occurrence; I added a secondary condition as the loop was increasing the date but it was still comparing the original date thru the if's.
I can upload the updated recurringdowntime.pl if needed, I think a second pair of eyes should read it :) and maybe it can get included in the next release.
as I said, this has been working fine for me for 3 weeks.

Re: Wrong date for downtime?

Posted: Tue Sep 20, 2011 10:03 am
by mguthrie
That would be awesome if you could post that to us! :D We currently don't have an in-house perl expert, so that bug has been evading us for a while. We'll run a few other tests on it and I'll run a diff on it to take a look at the code, but even a pointer as to where the issue was would be a huge help!

Re: Wrong date for downtime?

Posted: Tue Sep 20, 2011 10:13 am
by alexlacraru
hi there, pls see the attached file; if you do a search for 'alex' you'll find the sections I've modified :)
alex

Re: Wrong date for downtime?

Posted: Tue Sep 20, 2011 10:34 am
by mguthrie
Awesome, we'll get it tested and if it looks good we'll get it posted for the next release. Look for your name in the CHANGELOG ; ) Thanks again!