Page 1 of 1
Notification/Escalation Help
Posted: Thu Sep 26, 2013 11:39 am
by virtualn00b
Hello All,
I'm trying to figure out a new host/service notification config. Basically what I'm trying to do is notify a contact 5 minutes after a host or service hits a state (w,u,c, etc as defined in my host template) THEN notify another contact after 30 minutes THEN notify another contact after 60 minutes. I know the default interval_length is set to 60 seconds. I'm still new to nagios and have been reading the documentation but here is what I have so far, not sure if I'm going in the right direction.
define serviceescalation{
host_name server1
service_description HTTP
first_notification 5
last_notification 5
notification_interval 0
contacts contact1
}
define serviceescalation{
host_name server1
service_description HTTP
first_notification 6
last_notification 6
notification_interval 30
contacts contact2
}
define serviceescalation{
host_name server1
service_description HTTP
first_notification 7
last_notification 0
notification_interval 60
contacts contact3
Re: Notification/Escalation Help
Posted: Thu Sep 26, 2013 12:26 pm
by slansing
The notification escalations are triggered when that notification number is reached. So as you have it defined, when the service reaches it's 5th notification it will send out a notification and immediately move to your 2nd level escalation which sends out the 6th notification after 30 minutes, then your 7th notification will be sent out after 60 minutes. Does your service definition allow for 7 notifications after the state has changed to warning / critical? It would probably help if you linked that as well.
Re: Notification/Escalation Help
Posted: Thu Sep 26, 2013 1:23 pm
by virtualn00b
slansing wrote:The notification escalations are triggered when that notification number is reached. So as you have it defined, when the service reaches it's 5th notification it will send out a notification and immediately move to your 2nd level escalation which sends out the 6th notification after 30 minutes, then your 7th notification will be sent out after 60 minutes. Does your service definition allow for 7 notifications after the state has changed to warning / critical? It would probably help if you linked that as well.
Thank you for your reply. I understand that it will take 5 notifications to be reached before sending an alert. I was under the assumption that the check_interval was 60 seconds. So if a host changes state after 5 checks (5minutes) to notify the first contact. I did some more searching and have revised my config. As you mentioned, my host & service definition don't even allow more than 5 notifications so here is a revised config: To my understanding the following config will do as follows. After service reaches 1 notification it will send out a notification after 5 minutes then move to the 2nd level escalation which sends out the 2nd notification after 30 minutes then moves to my 3rd level which sends out a notification after 60 minutes. So only 3 notifications will be sent out in total. Correct? Also I plan on adding this cfg for my host and service definiton.
define serviceescalation{
host_name server1
service_description HTTP
first_notification 1
last_notification 1
notification_interval 5
contact contact1
}
define serviceescalation{
host_name server1
service_description HTTP
first_notification 2
last_notification 2
notification_interval 30
contact contact2
}
define serviceescalation{
host_name server1
service_description HTTP
first_notification 3
last_notification 3
notification_interval 60
contact contact3
Re: Notification/Escalation Help
Posted: Thu Sep 26, 2013 3:58 pm
by slansing
Correct, as long as a notification is triggered on the service it will move to your escalations in the order and time frames you specified. The definitions do look like they follow your logic, have you tested this yet? Maybe with a simple ping check or a service you can freely take down on one of your hosts?
Re: Notification/Escalation Help
Posted: Thu Sep 26, 2013 4:22 pm
by virtualn00b
slansing wrote:Correct, as long as a notification is triggered on the service it will move to your escalations in the order and time frames you specified. The definitions do look like they follow your logic, have you tested this yet? Maybe with a simple ping check or a service you can freely take down on one of your hosts?
Yeah I might be able to set that up. I seem to be diving more deep into nagios on the daily so I may just incorporate this into a host template for these specific host becuase its about 30 hosts that need this exact escalation config and it would be better then editing each individual host configuration file. If I test tomorrow ill post back. Thank you for your help!
Re: Notification/Escalation Help
Posted: Thu Sep 26, 2013 5:14 pm
by slansing
Yeah no problem! Let us know how this works out.