Page 1 of 1

Time periods not working as intended

Posted: Thu Dec 04, 2014 11:43 am
by brianp89
I set the time period for a check to be Thursday 11:35-11:45:

Code: Select all

define timeperiod {
        timeperiod_name                         zzTest
        alias                                   TestTime
        thursday                                11:35-11:45
        }

Code: Select all

define service {
        host_name                       server1
        service_description             Test file checker
        use                             generic-service
        check_command                   share-file-check!$USER3$!$USER4$!D$!downloads/test1/testfile-*!1440!0!!
        max_check_attempts              1
        check_interval                  10
        retry_interval                  2
        check_period                    zzTest
        notification_options            w,c,r,
        contacts                        user1
        register                        1
        }
When I refresh the service, the first check it shows will be @ 11:38. Why doesn't it know to start at 11:35?

Also, after it runs the check @ 11:38 it sets the next check for 11:48, which is outside the scope of the timeperiod. When it gets to 11:48, it doesn't run the check but sets the next check to be next Thursday @ 11:58 (again, outside the time period). This causes the check not to run correctly the next Thursday. Am I doing something wrong? I've got Nagios XI 2012R1.6.

Thanks

Re: Time periods not working as intended

Posted: Thu Dec 04, 2014 4:13 pm
by sreinhardt
The time period definition never was intended to say that something would start at a definite time. This is because we can rarely if ever assure where nagios will be in scheduling things. However, I would have expected a check scheduled within the timeperiod to run properly, as the time period does dictate that if something is scheduled within the accepted period, it should be run. I'd like you to set the timeperiod window to at least 20 minutes. This will cause at least the first check(possibly not running) to get through its run, and a second that should be scheduled within the window run within to be set as well.

Re: Time periods not working as intended

Posted: Fri Dec 05, 2014 9:47 am
by brianp89
Looks like you're right about the time window - as soon as I increased it to 25 minutes it started working as intended. I guess I'll just have to live with a bit of a longer check timeframe, not too big of a deal :)

Thank you

Re: Time periods not working as intended

Posted: Fri Dec 05, 2014 10:39 am
by cmerchant
Hope that works for you. We'll close this thread. Thanks.