Discussion:
[Nagios-users] Q: event handlers and scheduled downtime
Paul Dubuc
2013-09-25 17:14:07 UTC
Permalink
Are event handlers run for a service or host that is in a scheduled downtime?
I can't find any documentation on this. I know notifications are
suppressed, though checks still run. I would like the event handler for one
service not to run during a downtime. Is that possible?

I'm using Nagios 3.5.1.

Thanks,
Anton Löfgren
2013-09-26 08:04:37 UTC
Permalink
Post by Paul Dubuc
Are event handlers run for a service or host that is in a scheduled downtime?
They are, as far as I can tell.
Post by Paul Dubuc
I can't find any documentation on this.
Since downtimes are not explicitly mentioned, I think it's implied in the

"Event handlers [...] are run whenever a host or service state change
occurs."

part of the introduction.

I know notifications are
Post by Paul Dubuc
suppressed, though checks still run. I would like the event handler for one
service not to run during a downtime. Is that possible?
That, I don't know - as I'm sure you already know, the downtime depth
${HOST,SERVICE}DOWNTIME$ is not passed to the event handler, which
otherwise would've been a viable solution to the problem.

It should be possible to do what you want by using, for example, NDO or
livestatus to retrieve more status information about your objects. Or even
parsing status.dat.

This seems like a pretty roundabout way (read: overkill) of accomplishing
what you want, though.
I'm sure someone else will chime in to suggest a better way if one exists.
--
Anton Löfgren ***@op5.com
OP5 AB www.op5.com
Paul Dubuc
2013-09-26 20:52:34 UTC
Permalink
...
�I know notifications are
suppressed, though checks still run. �I would like the event handler for one
service not to run during a downtime. �Is that possible?
That, I don't know - as I'm sure you already know, the downtime depth
${HOST,SERVICE}DOWNTIME$ is not passed to the event handler, which otherwise
would've been a viable solution to the problem.
Hmmm. The event handler is just another plugin with a command definition. I
think I CAN pass $HOSTDOWNTIME$ or $SERVICEDOWNTIME$ to it by putting it as an
arg in the command object. Then code it will do nothing if the host or
service is in downtime. Thanks for the idea! I'll try it.

Paul Dubuc
Anton Löfgren
2013-09-27 07:14:23 UTC
Permalink
Right! state/type/attempt are only the _minimum_ arguments required. Of
coutse you can add the downtime depth yourself.

Good on you for not listening to me ;)
Post by Paul Dubuc
...
ï¿œI know notifications are
suppressed, though checks still run. ï¿œI would like the event handler
for one
service not to run during a downtime. ï¿œIs that possible?
That, I don't know - as I'm sure you already know, the downtime depth
${HOST,SERVICE}DOWNTIME$ is not passed to the event handler, which otherwise
would've been a viable solution to the problem.
Hmmm. The event handler is just another plugin with a command definition.
I think I CAN pass $HOSTDOWNTIME$ or $SERVICEDOWNTIME$ to it by putting it
as an arg in the command object. Then code it will do nothing if the host
or service is in downtime. Thanks for the idea! I'll try it.
Paul Dubuc
--
Anton Löfgren ***@op5.com
OP5 AB www.op5.com
Loading...