---
title: "Actions and Active Times"
description: "Actions trigger user scripts based on rules, while active times control data item activity. Configurations affect when actions execute, including queueing behavior and rule or sampler active states."
url: "https://docs.itrsgroup.com/docs/faq/geneos/115004030149-geneos-actions-and-active-times/index.html"
---
[Actions](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/#actions-1) are additional triggers that inform users of a certain event. They execute user scripts that sends emails or sends messages and data to various applications, such as Slack and ServiceNow. Actions are triggered only by Rules.

[Active Times](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/#active-times-1), 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.

The following setups show combinations of actions and active times:

## Setup 1 - The active time is configured on the action itself

### Default behavior

Here is the configuration:

![Geneos default behavior configuration](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-default-behavior.png)

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'
```

When the active time sets the action to an active state, the action is still not executed. The action will only be executed if the rule condition that has the action becomes true again.

### Queue Until Active behavior

This default behavior can be modified by enabling and ticking the [queueUntilActive](https://docs.itrsgroup.com/docs/geneos/current/processing/monitoring-and-alerts/geneos_rulesactionsalerts_tr/#active-times-1) setting. If this is ticked and enabled, the action is executed when it becomes active:

![Geneos queue until active behavior configuration](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-queue-until-active-time-behavior.png)

Below are the Gateway log entries when the action is inactive and becomes active:

Inactive

```
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'
```

Active

```
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:

1. @2:30pm

- Rule is active
- Rule condition that has the action is true
- Action is executed

2. @2:35pm

- Rule is inactive
- Rule condition that has the action is true
- Action is removed

3. @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:

![Geneos configuration of active time on sampler](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-active-time-configuration.png)

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:

![Geneos inactive sampler and empty dataview](https://docscdn.itrsgroup.com/faq/images/geneos/geneos-blank-data-items.png)


