Notification escalations

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

Re: Notification escalations

Postby tmcdonald » Wed Mar 15, 2017 1:43 pm

Can you verify the version of Core you are using?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Manager
 
Posts: 8180
Joined: Mon Sep 23, 2013 8:40 am

Re: Notification escalations

Postby Nagios_Admin_M » Wed Mar 15, 2017 1:56 pm

I am using version 3.5.1.
Nagios_Admin_M
 
Posts: 46
Joined: Fri Jul 22, 2016 4:39 am

Re: Notification escalations

Postby tmcdonald » Thu Mar 16, 2017 12:39 pm

Out of curiosity, if you reverse the order of the definitions, does the behavior change?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Manager
 
Posts: 8180
Joined: Mon Sep 23, 2013 8:40 am

Re: Notification escalations

Postby Nagios_Admin_M » Thu Mar 16, 2017 1:28 pm

No, it doesn't. The notifications are sen't to both of the address'es e-mails although the interval is used from one of them.
Example: Notifications are sent to both of the e-mails with 20 minutes delay or 1152( I used 5 minutes period this time ).
It behaves like it override the interval period into one of the escalations.
Nagios_Admin_M
 
Posts: 46
Joined: Fri Jul 22, 2016 4:39 am

Re: Notification escalations

Postby tmcdonald » Thu Mar 16, 2017 1:36 pm

Ohhhh, that's different. I thought you were saying that only the first definition was taking place at all.

I'll ask the developer what the intended behavior is, but I could see the argument either way for using the lower interval vs the last one defined.

Will update when I hear back.
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tmcdonald
Support Manager
 
Posts: 8180
Joined: Mon Sep 23, 2013 8:40 am

Re: Notification escalations

Postby cdienger » Thu Mar 16, 2017 4:35 pm

The behavior you are seeing is as designed. See https://assets.nagios.com/downloads/nag ... tions.html for more information. Specifically:

In any case where there are multiple valid escalation definitions for a particular notification, Nagios will choose the smallest notification interval. Take the following example:

define serviceescalation {
host_name webserver
service_description HTTP
first_notification 3
last_notification 5
notification_interval 45
contact_groups nt-admins,managers
}

define serviceescalation {
host_name webserver
service_description HTTP
first_notification 4
last_notification 0
notification_interval 60
contact_groups nt-admins,managers,everyone
}

We see that the two escalation definitions overlap on the 4th and 5th notifications. For these notifications, Nagios will use a notification interval of 45 minutes, since it is the smallest interval present in any valid escalation definitions for those notifications.
User avatar
cdienger
 
Posts: 122
Joined: Tue Feb 07, 2017 11:26 am

Re: Notification escalations

Postby Nagios_Admin_M » Fri Mar 17, 2017 3:55 am

I understand, now.

Is there a way to get send out two notification escalations for one service/host notification at different time intervals? Both of them needs to be send starting from first notification till forever.

Thank you.
Nagios_Admin_M
 
Posts: 46
Joined: Fri Jul 22, 2016 4:39 am

Re: Notification escalations

Postby cdienger » Fri Mar 17, 2017 2:19 pm

You may want to investigate setting up event handlers to trigger a custom script you create to do what you need. https://assets.nagios.com/downloads/nag ... dlers.html has some details regarding event handlers and an example script to get you started.
User avatar
cdienger
 
Posts: 122
Joined: Tue Feb 07, 2017 11:26 am

Re: Notification escalations

Postby Nagios_Admin_M » Wed Mar 22, 2017 10:39 am

Yes, I view the manual. Although as my knowledge is leading me to it is not possible to use send-notification-host/serviece-by-email twice for the same alert. Or is it leading me wrong.

define service{
command_name email
command_line /usr/bin/myscript
}


###myscript
# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n $NOTIFICATIONCOMMENT$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Nagios_Admin_M
 
Posts: 46
Joined: Fri Jul 22, 2016 4:39 am

Re: Notification escalations

Postby cdienger » Wed Mar 22, 2017 1:13 pm

The event handler would be called once after the service is in a HARD state, therefore you would need to create a script to periodically check services and email at the desired frequency and terminate the script once the problem was resolved.

event_handler would be used in the service definition instead of command_name and command_line.
User avatar
cdienger
 
Posts: 122
Joined: Tue Feb 07, 2017 11:26 am

Previous

Return to Nagios Core

Who is online

Users browsing this forum: ccordero103175, Yahoo [Bot] and 10 guests