Event on ping failure?

I know from the manual that events are only triggered from services, right?
Is it possible to trigger a custom event when a host goes down?
In the host template there is an option for a event command but it’s not executed.

Is there a way to do it?


I don’t see the Event command in my host templates but the Enable event handler so I guess there is a way to make it work.

Also event handlers are simillar to notifications so may be if you can’t enable it in the director, you can use the config files in /etc/icinga2/zones.d/master/ to define it and use a apply rule to attach it to the host / host check.

I can’t get it to work :frowning:


EventCommand objects are referenced by Host and Service objects with the event_command attribute.

So i guess define a event command and make sure the event handler is enabled.
If it doesn’t work, enable the debug log and trigger a state change of the host check and see, what happens in the log.

Be careful to restart after enabling the debug log and after disabling it and don’t let it running - could fill your disk quite quickly :wink:

Never mind. It was my mistake.
It worked right from the start.
Enabled debug log and saw a problem in my script.
Thank you anyway.

1 Like