Quick scheduling question

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Quick scheduling question

Post by BanditBBS »

Ok, so I have a service that was scheduled to check every 30 minutes, retry 1 and max attempts 2. The check period was 24x7 and everything was working great.

They decided they want this check(and 10 identical ones) run just once/per week at 5am Monday. I created a new time period with monday 05:00-05:05(to give it a little room to schedule). I then added this to one of the checks to test. I also changed max attempts to 1 so it doesn't schedule a retry. I forced an immediate check, it ran and then scheduled the next check for 9/8/2014 5:10am. I then ran it again and next check was changed to 9/8/2014 05:08:29am.

Why is it scheduling it outside the timeperiod(even though only a few minutes) and when that time comes around and it is outside the time period will the check actually run?
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Quick scheduling question

Post by abrist »

BanditBBS wrote:Why is it scheduling it outside the timeperiod(even though only a few minutes)
There is a good chance that the scheduler and time period checker happen at different places in the checking process.
BanditBBS wrote:and when that time comes around and it is outside the time period will the check actually run?
This is an unknown for me, I guess it needs to be tested.

I would suggest setting your check interval to once a day, or making your time period window as big as the service check interval.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Quick scheduling question

Post by BanditBBS »

So, I attempted to test this and added tuesday 14:55-15:00 to the timeperiod and also changed the check interval to 1440. Applied changes and then forced a check:

Code: Select all

Service State:	Ok
Duration:	1d 12h 18m 23s
Service Stability:	Unchanging (stable)
Last Check:	2014-09-02 14:54:27
Next Check:	2014-09-08 20:46:21
Look how messed up the next check time is now?!?!?!

Just to show you:

Code: Select all

define timeperiod {
        timeperiod_name                         monday-5am
        alias                                   Monday 5am
        monday                                  05:00-05:05
        tuesday                                 14:55-15:00
        }
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Quick scheduling question

Post by BanditBBS »

Looks like I figured it out. It has to be the new scheduling math that was screwing it up. I set the time period to tuesday 15:25-15:25 and set the check interval to 1 minute. No matter how often I scheduled an immediate check the next scheduled check was 15:25:??, so good to me. I then waited for it to run and the next check was then scheduled for next week at the proper time.

This can be closed, but wow it needs to be more intuitive :)
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Locked