[Nagios-devel] get_next_valid_time() fails to consider exclusions?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] get_next_valid_time() fails to consider exclusions?

Post by Guest »

It looks like get_next_valid_time() fails to consider time period
exclusions. This can cause it to calculate the next time incorrectly
in some cases.

For instance, suppose I define timeperiod1 as:
define timeperiod {
timeperiod_name timeperiod1
alias Time Period 1
sunday 00:00-07:00,22:00-24:00
monday 00:00-07:00,22:00-24:00
tuesday 00:00-07:00,22:00-24:00
wednesday 00:00-07:00,22:00-24:00
thursday 00:00-07:00,22:00-24:00
friday 00:00-07:00,22:00-24:00
saturday 00:00-07:00,22:00-24:00
}

and timeperiod2 as:
define timeperiod {
timeperiod_name timeperiod2
alias Time Period 2
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-24:00
saturday 00:00-24:00
exclude timeperiod1
}

If I set a service to use timeperiod2 for notifications, and the
service develops a problem during the excluded times, Nagios won't
send a notification even after the excluded time is over.

Here's an example:
--The service develops a problem at 06:30 on Monday.
--Nagios recognizes the problem but decides not to send a
notification because the time is still during the exclusion period.
--Nagios sets the service's next notification time to 00:00 on
Tuesday, instead of to 07:00 on Monday.
--Nagios rechecks the service after 07:00 on Monday, but it doesn't
send a notification because "We haven't waited long enough to
re-notify contacts about this service.", because it thinks the next
notification time is 00:00 on Tuesday (i.e. still in the future).

Thanks,
Luke







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]
Locked