Skip to content

Commit 2358d70

Browse files
author
Michael Friedrich
committed
Documentation: Fix event command execution conditions
fixes #6685
1 parent 7e83247 commit 2358d70

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

doc/3-monitoring-basics.md

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -901,11 +901,17 @@ NotificationCommand object refer to that.
901901

902902
### <a id="event-commands"></a> Event Commands
903903

904-
Unlike notifications event commands are called on every service execution
905-
if defined. Therefore the `EventCommand` object should define a command line
904+
Unlike notifications event commands are called on every host/service execution
905+
if one of these conditions match:
906+
907+
* The host/service is in a [soft state](#hard-soft-states)
908+
* The host/service state changes into a [hard state](#hard-soft-states)
909+
* The host/service state recovers from a [soft or hard state](#hard-soft-states) to [OK](#service-states)/[Up](#host-states)
910+
911+
Therefore the `EventCommand` object should define a command line
906912
evaluating the current service state and other service runtime attributes
907-
available through runtime vars. Runtime macros such as `$SERVICESTATETYPE$`
908-
and `$SERVICESTATE$` will be processed by Icinga 2 helping on fine-granular
913+
available through runtime vars. Runtime macros such as `$service.state_type$`
914+
and `$service.state$` will be processed by Icinga 2 helping on fine-granular
909915
events being triggered.
910916

911917
Common use case scenarios are a failing HTTP check requiring an immediate
@@ -1604,22 +1610,6 @@ Detailed information on the commands and their required parameters can be found
16041610
on the [Icinga 1.x documentation](http://docs.icinga.org/latest/en/extcommands2.html).
16051611

16061612

1607-
## <a id="event-handlers"></a> Event Handlers
1608-
1609-
Event handlers are defined as `EventCommand` objects in Icinga 2.
1610-
1611-
Unlike notifications event commands are called on every host/service execution
1612-
if defined. Therefore the `EventCommand` object should define a command line
1613-
evaluating the current service state and other service runtime attributes
1614-
available through runtime macros. Runtime macros such as `$service.state_type$`
1615-
and `$service.state$` will be processed by Icinga 2 helping on fine-granular
1616-
events being triggered.
1617-
1618-
Common use case scenarios are a failing HTTP check requiring an immediate
1619-
restart via event command, or if an application is locked and requires
1620-
a restart upon detection.
1621-
1622-
16231613
## <a id="logging"></a> Logging
16241614

16251615
Icinga 2 supports three different types of logging:

0 commit comments

Comments
 (0)