Unwanted notifications after nagios restart

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
akluss
Posts: 1
Joined: Fri May 20, 2016 1:11 pm

Unwanted notifications after nagios restart

Post by akluss »

The problem is solved, but it taked me almost two weeks to solve it and probably there is a bug in Nagios documentation and may be in Nagios implementation, too. I work on Nagios Core 4.0.8, daemon mode on CentOS 7. I tried 4.1.1 on CentOS 7 and 3.5.1 on CentOS 6, too - results are the same.

Nagios documentation says: "escalation_period: This directive is used to specify the short name of the time period during which this escalation is valid. If this directive is not specified, the escalation is considered to be valid during all times. "

No! Not all times. If I do not set escalation_period, in objects.cache file where my configuration is expanded by nagios, escalation_period value is not set to 24x7, but to the timeperiod of appropriate service or host. It may looks like the same. But it isn't. At least for my configuration in current Nagios implementation.

My hosts and services are configured to send first 2 notifications to one set of contacts and 3rd notification to another set. Part of them are checked 24x7 with notification period only in work time:

define service{
check_period 24x7
notification_interval 10
notification_period workhours
notification_options w,c,r
retain_status_information 1
service_description <service_name>
contact_groups sms1sms2
...
}
define serviceescalation{
host_name <host_name>
service_description *
contact_groups sms3
first_notification 3
last_notification 0
notification_interval 0
}

nagios.cfg:
use_regexp_matching=0
retain_state_information=1
use_retained_program_state=1

Configuration and problem for hosts is similar.

If I restart my nagios in non-worktime, in moment of restart in status.dat value of "no_more_notifications" for broken hosts and services which
should be notified only in worktime, switches from "1" to "0". In start of worktime members of contact_group "sms3" receives unwanted (4th or 5th or...) notification about known problem and value switches back to "1" until next restart in non-worktime.
If I understand properly meaning of "current_notification_number" in retention.dat, it should not exceed "3" on my configuration. But it increases every morning when unwanted messages are sent.

Writing of "escalation_period 24x7" for all my host and service escalations seems to solve this problem - no_more_notifications do not switches to "1" with no logical reason, current_notification_number do not exceed "3" and unwanted messages are not sent.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Unwanted notifications after nagios restart

Post by ssax »

The documentation may need to be reworded, this is normal though, it is standard implied-inheritance, please read here:

https://assets.nagios.com/downloads/nag ... nheritance

Let me know if you have any questions.

Thank you
Locked