stop Event Handler during Scheduled Downtime

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

stop Event Handler during Scheduled Downtime

Post by caterpillartce »

Hello,

I used macro $HOSTDOWNTIME$ and the script for event handler will simply exit if $HOSTDOWNTIME$ is not zero. But it did not seem to have worked. Is it not the right macro to use?

Thanks!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: stop Event Handler during Scheduled Downtime

Post by tmcdonald »

It might be easier if you posted your script so we can take a look at it.
Former Nagios employee
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: stop Event Handler during Scheduled Downtime

Post by caterpillartce »

Thanks for the reply! It is a rather complicated script to send alerts as tickets to BMC Remedy that I got from the BMC support team in our company, and I am not sure if I am allowed to post the script here . But I used the same logic to add another macro so that this event handler script ignores SOFT state changes, and that works fine; so I am wondering this time I may not be using the correct macro?

Now thinking about it, I probably should have used $SERVICEDOWNTIME$? The event handler is set in a service template that has been applied to the monitoring services.

We schedule downtime for all hosts in a certain host group, not down to individual services. But when a host is in "scheduled downtime", are all its monitoring services in "scheduled downtime" too? If so, $SERVICEDOWNTIME$ should work...

Thanks!
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: stop Event Handler during Scheduled Downtime

Post by tmcdonald »

How are you scheduling the downtime? Certain methods will affect the services and leave the hosts alone, or vice-versa.
Former Nagios employee
caterpillartce
Posts: 117
Joined: Mon Jul 11, 2016 11:22 am

Re: stop Event Handler during Scheduled Downtime

Post by caterpillartce »

I surveyed people who normally do this, and looks like there are two ways they schedule downtime in Nagios:

1. HostGroup Summary, View Hostgroup Commands, Schedule downtime for all SERVICES in this group, in the next screen, select "Schedule Downtime for hosts too"
2. HostGroup Summary, View Hostgroup Commands, Schedule downtime for all HOSTS in this group

So, I am thinking, in the script, if I check both $SERVICEDOWNTIME$ and $HOSTDOWNTIME$ and if either one is non-zero, the script simply exits, and this should cover both scenarios when service or host is in downtime.

Your thoughts?

Thanks
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: stop Event Handler during Scheduled Downtime

Post by tgriep »

Yes, checking both of those macros would catch all of the combinations for hosts and services being down so testing them both would be a good idea.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked