check_period, timeperiod exclusions, wrong next check time ?

John Sellens jsellens at syonex.com
Fri Oct 12 19:10:43 CEST 2012


Hi - we've just encountered some unexpected behaviour where the next
check time for a service gets set to 00:00 tomorrow when we enter a
a timeperiod exclusion.  It seems like it might be a bug in check_period
timeperiod handling, but I have no idea where to start looking in the code.

I have a service defined with "check_period not_fridayaft", and the timeperiods
defined like this:

    define timeperiod {
        timeperiod_name not_fridayaft
        alias   not friday aft
        use     24x7
        exclude fridayaft
    }
    define timeperiod {
        timeperiod_name fridayaft
        alias   friday aft
        friday 12:45-12:55
    }

At 12:45 Friday, the service state information page starts showing:

    Next Scheduled Check:   10-13-2012 00:00:00

and the service is not checked until Saturday rolls around.

But, if I redefine the timeperiod to be explicit, and not use exclude, like this:

    define timeperiod {
        timeperiod_name not_fridayaft
        alias   not friday aft
        sunday  00:00-24:00
        monday  00:00-24:00
        tuesday 00:00-24:00
        wednesday       00:00-24:00
        thursday        00:00-24:00
        friday  00:00-12:45,12:55-24:00
        saturday        00:00-24:00
    }

restart Nagios, and the service's next check time shows up correctly:

    Next Scheduled Check:   10-12-2012 12:55:00

This is 3.4.1, which I built based on nagios-3.4.1-2.el6.src.rpm using a
nagios.spec build file with the last modification:
    * Thu Jun 28 2012 Petr Pisar <ppisar at redhat.com> - 3.4.1-2
The nagios.spec adds a few patches, but I don't see anything that makes me
think it would trigger this.

Has anyone else seem anything like this?  I've got a workaround (by avoiding
the exclude), but it makes me wonder if there's a bug in the timeperiod
exclusion handling code.

Thanks - cheers!

John
jsellens at syonex.com


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev




More information about the Developers mailing list