2014-02-05 15:53:22 +01:00
|
|
|
## <a id="event-handlers"></a> Event Handlers
|
2013-10-10 11:22:32 +02:00
|
|
|
|
2013-10-18 20:05:08 +02:00
|
|
|
Event handlers are defined as `EventCommand` objects in Icinga 2.
|
|
|
|
|
2014-04-04 18:57:23 +02:00
|
|
|
Unlike notifications event commands are called on every host/service state change
|
2013-10-18 20:05:08 +02:00
|
|
|
if defined. Therefore the `EventCommand` object should define a command line
|
|
|
|
evaluating the current service state and other service runtime attributes
|
|
|
|
available through runtime macros. Runtime macros such as `$SERVICESTATETYPE$`
|
|
|
|
and `$SERVICESTATE$` will be processed by Icinga 2 helping on fine-granular
|
|
|
|
events being triggered.
|
|
|
|
|
|
|
|
Common use case scenarios are a failing HTTP check requiring an immediate
|
2014-03-09 22:30:56 +01:00
|
|
|
restart via event command, or if an application is locked and requires
|
|
|
|
a restart upon detection.
|