disable notification automatically after some hours

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
varalakshmi
Posts: 13
Joined: Wed Aug 06, 2014 8:01 am

disable notification automatically after some hours

Post by varalakshmi »

Hi

I would like disable notification automatically if the host or service is down or critical for more than 8 hours
Please some one help me to run the command in cronjob

Thanks
Varalakshmi
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: disable notification automatically after some hours

Post by eloyd »

Rather than complicating things with a cron job, why not just set the total number of notifications to be the number you want by using escalations?

Set the "notification_interval" to zero, which means Nagios will only send out one notification for the service. Then use escalations to only send notifications until 8 hours has passed.

You can find information about escalations at http://nagios.sourceforge.net/docs/3_0/escalations.html.

If you really want to go with the cron job, you need to use the Nagios API, documented here: http://old.nagios.org/developerinfo/ext ... ndlist.php. You are looking for http://old.nagios.org/developerinfo/ext ... mmand_id=6 and http://old.nagios.org/developerinfo/ext ... mmand_id=5 (DIASBLE_SVC_CHECK and ENABLE_SVC_CHECK).
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: disable notification automatically after some hours

Post by tmcdonald »

varalakshmi, did eloyd's post clear things up for you?
Former Nagios employee
Locked