Nagios warning and critical notifications interval

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
cimbi
Posts: 2
Joined: Thu Mar 05, 2015 4:37 am

Nagios warning and critical notifications interval

Post by cimbi »

I'm trying to configure Nagios service notifications this way:

- Send email notification after being for 30 minutes in the warning state
- Send email notification after being for 15 minutes in the critical state

I can't get it working at all. I can' manage the situation when there is a warning for a short time followed by the critical (or vice versa). Nagios seems to combine time spent in these states together, which is not what I want.

Do you have some ideas how to get it working as expected?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios warning and critical notifications interval

Post by Box293 »

I believe escalations are required here.

In a service definition, you define a the first_notification_delay to 0.
You don't define any contacts or contact groups.
This will make it send a notification immediately (but it'll go to no-one).

You then create a service escalation.

Code: Select all

define serviceescalation {
	host_name                     		localhost
	service_description           		Current Load
	first_notification            		1
	last_notification             		2
	notification_interval         		30
	escalation_period             		24x7
	escalation_options            		w,
	}
When the service enters a HARD state, this sets the notification_interval to 30 minutes for a WARNING state. This is for notification #1.
It still doesn't send a notification to anyone because there are no contacts or contactgroups.

Now you create another service escalation.

Code: Select all

define serviceescalation {
	host_name                     		localhost
	service_description           		Current Load
	contacts                      		nagiosadmin
	first_notification            		2
	last_notification             		0
	notification_interval         		30
	escalation_period             		24x7
	escalation_options            		w,
	}


This no defines that notifications #2 - 0 (forever) will be sent to the contact nagiosadmin for WARNINGS, 30 minutes apart.

Repeat for CRITICAL:

Code: Select all

define serviceescalation {
	host_name                     		localhost
	service_description           		Current Load
	first_notification            		1
	last_notification             		2
	notification_interval         		15
	escalation_period             		24x7
	escalation_options            		c,
	}	

define serviceescalation {
	host_name                     		localhost
	service_description           		Current Load
	contacts                      		nagiosadmin
	first_notification            		2
	last_notification             		0
	notification_interval         		15
	escalation_period             		24x7
	escalation_options            		c,
	}


The CRITICALs work the same way, just 15 minutes apart.

I hope this makes sense.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
cimbi
Posts: 2
Joined: Thu Mar 05, 2015 4:37 am

Re: Nagios warning and critical notifications interval

Post by cimbi »

Many thanks for your tip. Unfortunately it still doesn't work as I would like to. When the service is in state "warning" for e. g. one our and then switches to "critical", the notification for "critical" event comes immediately and not after desired 15 minutes :-(. Or am I doing something wrong?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios warning and critical notifications interval

Post by scottwilkerson »

This granularity is not available currently.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Nagios warning and critical notifications interval

Post by Box293 »

Just to expand on what scottwilkerson said.

When Nagios detects a HARD state change from OK to WARNING/CRITICAL/UNKNOWN, this triggers notifications and event handlers. If the service result later changes from WARNING to CRITICAL, Nagios does not detect this as the state is already HARD (non-OK).
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked