Wrong date for downtime?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
rdedon
Posts: 578
Joined: Sat Nov 20, 2010 4:51 pm

Re: Wrong date for downtime?

Post by rdedon »

Just an update that we are still looking this over to figure out the cause.
Rene deDon
Technical Team
___
Nagios Enterprises, LLC
Web: http://www.nagios.com
alexlacraru
Posts: 13
Joined: Wed Mar 30, 2011 8:12 am

Re: Wrong date for downtime?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Wrong date for downtime?

Post 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?
alexlacraru
Posts: 13
Joined: Wed Mar 30, 2011 8:12 am

Re: Wrong date for downtime?

Post 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
alexlacraru
Posts: 13
Joined: Wed Mar 30, 2011 8:12 am

Re: Wrong date for downtime?

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Wrong date for downtime?

Post 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
alexlacraru
Posts: 13
Joined: Wed Mar 30, 2011 8:12 am

Re: Wrong date for downtime?

Post 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.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Wrong date for downtime?

Post 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!
alexlacraru
Posts: 13
Joined: Wed Mar 30, 2011 8:12 am

Re: Wrong date for downtime?

Post 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
You do not have the required permissions to view the files attached to this post.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Wrong date for downtime?

Post 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!
Locked