Page 1 of 1
Notify when service has been down for a specific period
Posted: Wed Aug 30, 2017 6:12 am
by neworderfac33
Good afternoon,
I have the following service definition that checks to see if the IIS service is up or down.
Code: Select all
define service{
use generic-service
hostgroup_name my_hostgroups
service_description Service - W3SVC/IIS
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}
However, we often resync servers, meaning that IIS is down and is SUPPOSED to be down, until the sync is complete.
Is there any way in which I can only generate an alert status if the service has been down for a specified period, say 30 minutes?
Thanks in advance
Pete
Re: Notify when service has been down for a specific period
Posted: Wed Aug 30, 2017 9:26 am
by scottwilkerson
peterooney wrote:Good afternoon,
I have the following service definition that checks to see if the IIS service is up or down.
Code: Select all
define service{
use generic-service
hostgroup_name my_hostgroups
service_description Service - W3SVC/IIS
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}
However, we often resync servers, meaning that IIS is down and is SUPPOSED to be down, until the sync is complete.
Is there any way in which I can only generate an alert status if the service has been down for a specified period, say 30 minutes?
Thanks in advance
Pete
Yes. You will want to add the
first_notification_delay directive
https://assets.nagios.com/downloads/nag ... ml#service
Re: Notify when service has been down for a specific period
Posted: Wed Aug 30, 2017 10:27 am
by neworderfac33
Thanks a lot for responding - can I add this directive to the service definition itself?
And if I add it into a template, are there any other values that I need to change there to make it work properly?
Pete
Re: Notify when service has been down for a specific period
Posted: Wed Aug 30, 2017 10:30 am
by scottwilkerson
peterooney wrote:Thanks a lot for responding - can I add this directive to the service definition itself?
Pete
Yes, it would look something like this:
Code: Select all
define service{
use generic-service
hostgroup_name my_hostgroups
service_description Service - W3SVC/IIS
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
first_notification_delay 30
}
Re: Notify when service has been down for a specific period
Posted: Thu Aug 31, 2017 3:25 am
by neworderfac33
That's brilliant - thank you!
Please can you close the thread?
Pete
Re: Notify when service has been down for a specific period
Posted: Thu Aug 31, 2017 8:49 am
by scottwilkerson
peterooney wrote:That's brilliant - thank you!
Please can you close the thread?
Pete
Glad we were able to assist! Closed.