Alert Rule Conditions and Actions

Contents

Overview

Overview

An alert rule contains the following user-defined conditions:

Enabled

A Boolean value that sets whether or not the alert will fire. The default value is TRUE. You can manually disable alerts; under some circumstances (such as when the alert creates a risk to your system), LiveView server may automatically disable alerts. Alerts that are disabled by LiveView server persist as disabled until they are manually re-enabled.

Name

The alert rule name is stored as a string. When you create an alert rule, a unique ID for the alert rule, independent of the name, is created on the server. This means that you can create any number of alert rules with the same name and not overwrite any existing alert rules.

Table

The name the table against which the alert conditions are checked.

Condition or Trigger

Query: a LiveQL query predicate specifying data conditions in the selected LiveView Table. When the predicate evaluation changes from FALSE to TRUE, the alert fires.

Cron: a cron expression that triggers at the configured time.

Severity

Severity values are stored as integers. The values provided are 1 (Low), 3 (Medium), and 5 (High). The default value is 3 (Medium). You can use any integer value for alert rule severity.

Message

A string that sets the default notification message for the alert.

An alert rule also contains actions. When you configure an alert, you can set the following fields to control alert actions:

AlertKey

A string identifier for an alert rule, generated by the server at the time that the alert actions are executed. You can create a custom string or use the server-generated default.

Recipient

The username of an intended recipient of the alert. The default is "*" to indicate "anyone". This field can be configured by publish alert actions.

In addition, every alert has several server-generated fields. Some of the fields you may find useful are:

AlertRuleGUID

This field replaced the AlertRuleID in the primary key of the table. As of LiveView 10.3.0, any project that used a custom LVAlerts table must be manually updated to add this new required column.

Created

The time an alert rule was created.

LastModified

The last time an alert rule was modified.

Status

This field is empty unless the alert rule has been disabled by LiveView server. If the alert rule was disabled, the reason is contained in this field.

The alert actions are the actions that LiveView server performs when an insert or update to the Table satisfies the Condition predicate, or the cron time has occurred. The available actions are:

  • Publish the alert tuple as a row in the LVAlerts table.

  • Publish a tuple to any table in any LiveView server.

  • Delete rows from a LiveView table.

  • Send an email message to specified username (or usernames).

  • Send the alert-generated tuple to another application.

  • Execute Java code (disabled by default).

  • Execute an operating system command on the system (disabled by default).

  • Execute a REST Invocation