> For the complete documentation index, see [llms.txt](https://docs.cubu.com/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cubu.com/guides/admin-tools/service-and-process-configuration/managing-alert-rules.md).

# Managing Alert Rules

{% hint style="info" %}
Admin Tools -> Service -> Organization -> **Alert rules**

Using this tool requires the **Service Admin** role.
{% endhint %}

Alert Rules specify which service level metrics to monitor, the thresholds for triggering alerts, and the users who should receive notifications.

## Viewing Alert Rules

To view alert rules, go to Admin Tools -> Service -> Organization -> **Alert rules**

<figure><img src="https://2572483209-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8vfRpZGqpk7N0egaXMQ8%2Fuploads%2FKtktcaNyNLV4ohnAtT3W%2Fimage.png?alt=media&amp;token=92314a7c-de87-41f7-b664-c37c7f1481d1" alt=""><figcaption><p>Alert Rules page</p></figcaption></figure>

## Creating a New Alert Rule

To create a new rule, click "New alert rule" to open the New Alert Rule dialog.

* Enter a unique, descriptive name for the rule.
* Choose the **metric to monitor** from the dropdown list.
* Enter a message Subject and Body to notify recipients when the alert turns on.\
  Note that a default subject and body are created when you choose the metric.

### Supported Metrics

Alerts can monitor the following metrics. Note that some metrics refer to a single unit, and others refer to the aggregation of the unit and its child units (subtree).

<table><thead><tr><th width="306">Metric</th><th>Description</th></tr></thead><tbody><tr><td>Waiting time in unit</td><td>The current longest wait time in the unit</td></tr><tr><td>Waiting time in subtree</td><td>The current longest wait time in the subtree</td></tr><tr><td>Waiting cases in unit</td><td>The total number of cases currently waiting in queue in the unit</td></tr><tr><td>Waiting cases in subtree</td><td>The total number of cases currently waiting in queue in the subtree</td></tr><tr><td>Cases in warning WT range in unit</td><td>The number of cases with waiting times currently in the warning range (in the unit)</td></tr><tr><td>Cases in warning WT range in subtree</td><td>The number of cases with waiting times currently in the warning range (in the subtree)</td></tr><tr><td>Cases in critical WT range in unit</td><td>The number of cases with waiting times currently in the critical range (in the unit)</td></tr><tr><td>Cases in critical WT range in subtree</td><td>The number of cases with waiting times currently in the critical range (in the subtree)</td></tr><tr><td>Service time in unit</td><td>The current longest service time in the unit</td></tr><tr><td>Service time in subtree</td><td>The current longest service time in the subtree</td></tr></tbody></table>

## Configuring Alert Rules

Configure back-office tasks using the **Alert Rule Details** page:

### Alert Rule Details

* **Rule Name**: A unique identifier for the alert rule.
* **Metric to Monitor**: This rule will track the specific service level metric.
* **Threshold**: The predefined value that will trigger an alert when crossed by the metric.
* **Severity**: Choose the alert severity level (low, medium, or high)
* **Active**: Uncheck this box to stop checking the rule.

### Notification Recipients

In this section, you define who will be notified when the alert is turned on or off.

* **Notify Source Unit Contacts**: If checked, notifications will be sent to users designated as Unit Contacts for the unit where the alert is generated. You can assign Unit Contacts through the Unit Details page (see [Managing the Organization Tree](/guides/admin-tools/organization-tree/managing-the-organization-tree.md#defining-unit-contacts)).
* **Notify Source Unit Users**: If checked, notifications will be sent to users currently in the unit where the alert is generated.
* **Sending Notifications:** By default, notifications are sent only when the user is online (clocked in). To ensure notifications are sent when users are offline (clocked out), select the “Send notifications when away” option. If attendance tracking is disabled, notifications will always be sent regardless of the user’s status.
* **Filtering Recipients by Groups**: You can refine the list of notification recipients by specifying groups. Only members of these specified groups will receive the alert notifications.

### Notification Message

* **When the alert turns ON**: The subject and body of the message to be sent when the alert is activated.
* **When the alert turns OFF**: The subject and body of the message to be sent when the alert is deactivated. Sending OFF messages is optional.

#### Including Variables in Notifications

The notification's subject and body may include variables to be replaced with actual values when the notification is created,

Supported variables are:

<table><thead><tr><th width="204">Name</th><th width="267">Place Holder</th><th>Description</th></tr></thead><tbody><tr><td>Metric name</td><td><code>{{rule.metric.name}}</code></td><td>The name of the metric being monitored</td></tr><tr><td>Metric unit</td><td><code>{{rule.metric.units}}</code></td><td>The metrics units e.g. "Min."</td></tr><tr><td>Metric value</td><td><code>{{alert.metric.value}}</code></td><td>The metric value at the time were the notification was created </td></tr><tr><td>Rule condition name</td><td><code>{{rule.condition.name}}</code></td><td>The condition name ("GE" for greater than)</td></tr><tr><td>Rule condition symbol</td><td><code>{{rule.condition.symbolme}}</code></td><td>The condition symbol (">" for greater than)</td></tr><tr><td>Rule name</td><td><code>{{rule.name}}</code></td><td>The alert rule name</td></tr><tr><td>Rule threshold</td><td><code>{{rule.threshold}}</code></td><td>The rule's threshold value</td></tr><tr><td>Unit name</td><td><code>{{alert.unit.name}}</code></td><td>The name of the unit where the alert was triggerred.</td></tr></tbody></table>

## See Also

{% content-ref url="/spaces/8vfRpZGqpk7N0egaXMQ8/pages/F3h6z2MmHC7kluYnm82L" %}
[Service Level Alerts](/guides/understanding-the-basics/service-level-alerts.md)
{% endcontent-ref %}
