Actions and Active Times
Actions are additional triggers that inform users of a certain event. They execute user scripts that sends emails or sends messages/data to various applications (e.g. Slack, ServiceNow, etc). Actions are triggered only by Rules.
Active Times, on the other hand, control whether a data item is active or inactive. The data item can be a rule, a sampler, or an action.
Combining both
What happens when both are combined? For example, will an action fire if a rule is inactive?
Setup 1 - The active time is configured on the action itself
Default behaviour
Here is the configuration:
By default, when the active time sets the action to an inactive state, the rule runs but the action is not executed. The following log entry can be seen in the Gateway log file:
2022-09-21 13:38:12.572+0800 INFO: ActionManager Action DataItem 'Send Alert' generated (variable=/geneos/gateway[(@name="MNL_MAYA_GATEWAY_9370")]/directory/probe[(@name="LASSIE_6370")]/managedEntity[(@name="LASSIE")]/sampler[(@name="Toolkit Shell")][(@type="")]/dataview[(@name="Toolkit Shell")]/rows/row[(@name="agila")]/cell[(@column="status")])
2022-09-21 13:38:12.572+0800 INFO: ActionManager Action 'Send Alert' would have fired, but is outside ActiveTime 'Test'
Queue Until Active behaviour
2022-09-21 13:34:11.478+0800 INFO: ActionManager Action DataItem 'Send Alert' generated (variable=/geneos/gateway[(@name="MNL_MAYA_GATEWAY_9370")]/directory/probe[(@name="LASSIE_6370")]/managedEntity[(@name="LASSIE")]/sampler[(@name="Toolkit Shell")][(@type="")]/dataview[(@name="Toolkit Shell")]/rows/row[(@name="agila")]/cell[(@column="status")])
2022-09-21 13:34:11.479+0800 INFO: ActionManager Action 'Send Alert' is queued to fire on entering ActiveTime 'Test'
2022-09-21 13:35:00.051+0800 INFO: ActionManager Firing action 'Send Alert'
2022-09-21 13:35:01.115+0800 INFO: ActionManager Finished executing '/home/MNL/rgonzales/scripts/scripts/print_to_file.bash' with arguments ''.
2022-09-21 13:35:01.115+0800 INFO: ActionManager Completed action 'Send Alert', Exit code: 0
Setup 2 - The active time is configured on the rule
Scenario 1
When the rule condition that has the action becomes true and the rule is inactive, the action is not executed.
Scenario 2
Using the following sequence:
- @2:30pm
- Rule is active
- Rule condition that has the action is true
- Action is executed
- @2:35pm
- Rule is inactive
- Rule condition that has the action is true
- Action is removed
- @2:40pm
- Rule is active
- Rule condition that has the action is true
- Action is executed again
Here are the log entries of the said sequence:
Rule is active
2022-09-21 03:02:37.553+0800 INFO: ActionManager Action DataItem 'Send Alert' generated (variable=/geneos/gateway[(@name="MNL_MAYA_GATEWAY_9370")]/directory/probe[(@name="LASSIE_6370")]/managedEntity[(@name="LASSIE")]/sampler[(@name="Toolkit Shell")][(@type="")]/dataview[(@name="Toolkit Shell")]/rows/row[(@name="agila")]/cell[(@column="status")])
2022-09-21 03:02:37.554+0800 INFO: ActionManager Firing action 'Send Alert'
2022-09-21 03:02:38.004+0800 INFO: ActionManager Finished executing '/home/MNL/rgonzales/scripts/scripts/print_to_file.bash' with arguments ''.
2022-09-21 03:02:38.004+0800 INFO: ActionManager Completed action 'Send Alert', Exit code: 0
Rule is inactive
2022-09-21 03:03:00.254+0800 INFO: ActionManager Action DataItem 'Send Alert' removed (variable=/geneos/gateway[(@name="MNL_MAYA_GATEWAY_9370")]/directory/probe[(@name="LASSIE_6370")]/managedEntity[(@name="LASSIE")]/sampler[(@name="Toolkit Shell")][(@type="")]/dataview[(@name="Toolkit Shell")]/rows/row[(@name="agila")]/cell[(@column="status")])
Rule is active
2022-09-21 03:07:00.350+0800 INFO: ActionManager Action DataItem 'Send Alert' generated (variable=/geneos/gateway[(@name="MNL_MAYA_GATEWAY_9370")]/directory/probe[(@name="LASSIE_6370")]/managedEntity[(@name="LASSIE")]/sampler[(@name="Toolkit Shell")][(@type="")]/dataview[(@name="Toolkit Shell")]/rows/row[(@name="agila")]/cell[(@column="status")])
2022-09-21 03:07:00.350+0800 INFO: ActionManager Firing action 'Send Alert'
2022-09-21 03:07:01.016+0800 INFO: ActionManager Finished executing '/home/MNL/rgonzales/scripts/scripts/print_to_file.bash' with arguments ''.
2022-09-21 03:07:01.016+0800 INFO: ActionManager Completed action 'Send Alert', Exit code: 0
Setup 3 - The active time is configured on the sampler
If the sampler becomes inactive and its dataview still has data, then the action is executed. This is because the rule is also active and can match a data item on the said sampler:
However, if the sampler becomes inactive and its dataview has no data, then the action is not executed. This is because the rule cannot find a matching data item on the said sampler:
Comments
0 comments
Please sign in to leave a comment.