Notification escalations
Re: Notification escalations
Can you verify the version of Core you are using?
Former Nagios employee
-
- Posts: 77
- Joined: Fri Jul 22, 2016 4:39 am
Re: Notification escalations
I am using version 3.5.1.
Re: Notification escalations
Out of curiosity, if you reverse the order of the definitions, does the behavior change?
Former Nagios employee
-
- Posts: 77
- Joined: Fri Jul 22, 2016 4:39 am
Re: Notification escalations
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.
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.
Re: Notification escalations
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.
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.
Former Nagios employee
Re: Notification escalations
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.
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 77
- Joined: Fri Jul 22, 2016 4:39 am
Re: Notification escalations
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.
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.
Re: Notification escalations
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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 77
- Joined: Fri Jul 22, 2016 4:39 am
Re: Notification escalations
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$
}
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$
}
Re: Notification escalations
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.
event_handler would be used in the service definition instead of command_name and command_line.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.