Creating Alert Rules


You can define alert rules to trigger an alert when certain conditions are met. For example, for wind turbines, you can define a triggering rule to trigger an alert when the wind speed exceeds 30m/s, and the alert severity and alert content will be reported when the alert occurs.


There are two ways you can create alert rules: by using either the old version or the new version. The new version is an enhancement of the old version that gives you more options for comparisons when configuring the condition for the triggering the alert. See the table below for more details.


Old Version New Version
Does not have the option to give a rule name nor rule description for the rule. Can enter a rule name and description.
Can select only one measurement point as trigger condition. Can select multiple measurement points as triggers for comparison.
Events cannot be selected as triggers. Events can be selected as triggers.
Custom alert sources cannot be selected as triggers. Custom alert sources can be selected as triggers.
Can select the device status for all devices under the specified model as trigger condition. Can select the device status for all devices as the trigger for the trigger condition.
Can select only measurement point from one device as trigger condition. Can select measurement points from different devices as triggers for comparison.
Condition does not support factors. Condition supports factors (using expressions).
Can only use the measurement point threshold as alert trigger conditions. Added timing conditions based on tumbling or sliding windows as alert trigger conditions.
Need to create an alert content before creating an alert rule. Alert content and alert rule are merged: alert content can be directly entered when creating an alert rule.
Does not support discrete alerts. Supports discrete alerts.
Saves an alert as a historical record by default. Supports the option to not save the alert as a historical record after the alert is cleared.
Unable to tag alerts. Can tag alerts through alert rule configuration.
Changes to the alert rule requires 5 minutes to take effect after saving. Changes take effect immediately.


The alert rules are for the specified model, and can be applied to the following scope depending on the settings:

  • All the assets instantiated based on the model.
  • The assets in the specified asset tree which are instantiated based on the model.


This section shows how to create the triggering rules of an alert for the new version. For how to create an alert rule using the old version, see Creating Alert Rules (Old Version).

Before You Start

Procedure

  1. Click Alert Service > Alert Rules on the EnOS Management Console navigation menu.
  2. Click the New Rule button to define a new alert triggering rule.

Basic Information

Fill in the basic information for the alert rule such as its ID, description, etc., in the Basic Information section.


../_images/alert_rule_basic_section.png


  • Rule Name

    The rule name. Maximum length is 64 characters and supports internationalization.

  • Rule ID

    The user-defined ID for the rule. Supports letters, numbers, period (.), underscore (_), and dash (-), with a maximum length of 64 characters.

  • Description

    The rule description. Maximum length is 100 characters and supports internationalization.

  • Enable Alert Rule

    Select whether to enable this alert rule.

  • Tag

    You can attach custom tags to the rule for easy management. The maximum number of tags you can add is 100.

Trigger

The Trigger section enables you to select the triggers and the scope of the alert required for the trigger condition. You can select different metrics from the same or different sources. The maximum number of triggers for each rule with Device Status as trigger is 1, otherwise it is 3.


../_images/alert_rule_trigger_section.png


  • Trigger Source

    There are two types of trigger sources available: IoT Hub and Others. Data from IoT Hub includes IoT Hub model metrics such as measurement points, events, and device status, while data from Others will encompass those outside of IoT Hub.

    • IoT Hub

      Select Measurement Point, Event, or Device Status as the trigger to trigger the rule.

      • Measurement Point

        Select the model and its corresponding measurement point. Click Add Metric to add another measurement point if required. For more information about models, see Device Modeling.

      • Event

        Select the model and its corresponding event to compare the threshold value of the event’s parameters as the condition. If the condition is not met, the alert will be cleared. Click Add Metric to add another event if required.

      • Device Status

        Select All or Model for a particular model to trigger the alert when the status of the devices under it change to offline. Note that only device assets have device status. This option is only available for the first trigger.

    • Others

      Select an alert source, enter a metric, and select its data type. For more information, see Alert Source. Click Add Metric to add another metric if required.


  • Scope (for IoT Hub trigger source)

    Select the scope to which the alert applies to according to the selected model above.

    • All Devices: The rule applies to all device instances based on the selected model.

    • Asset Tree: Select an asset tree to apply the rule to all asset instances based on the selected model in this asset tree. You can also click Select Asset to select one or more nodes in the asset tree to apply the rule to. Newly added child asset nodes will automatically inherit the rule defined on their parent nodes.


      The maximum number of nodes that can be selected is 1,000. Note that if you select a parent node that has more than 1,000 child nodes, it counts as 1, but if you do not select the parent node, but instead select 2,000 of its child nodes, the total nodes would count as 2,000 and would exceed the maximum limit allowed.


    • Specific Assets: Click Select Asset to choose an asset under the selected model. In the subsequent pop-up window, you can search for assets based on the asset type (device/logical), product, device key, asset ID, and device name. Select the assets you wish to apply the alert rule to from the search results below and click OK.


      The maximum number of assets that can be selected is 100.


  • Scope (for Others trigger source)

    Select the scope to which the alert applies to according to the selected alert source above. You can select All Devices, or enter one or more asset IDs separated by commas.


Note

Only the Scope of the first trigger supports All Devices, Asset Tree, and Specific Assets. For subsequent triggers, you can only enter an asset ID.

Trigger Validity

If there is more than one metric in the Trigger section, you need to indicate a validity period where the it will be used for the alert. You can either select a validity period (between 60 seconds and 24 hours) or use the default Always Effective. If the period is exceeded, the condition will fail, and the alert will not trigger.


../_images/alert_rule_trigger_validity_section.png

Condition

The Condition section enables you to configure the alert conditions based on the trigger(s) selected.


../_images/alert_rule_condition_section.png


  • Alert Condition (for Measurement Point, Event and Others triggers)

    • Select and configure conditions to trigger the alert.

      • Threshold: Select this to set a threshold comparison for the trigger selected above.

        • Click Add Condition Group.

        • Select And or Or.

          • And: Trigger alert only if all the conditions are met.
          • Or: Trigger alert as long as one of the conditions are met.
        • Next, click Add Condition and select the trigger, parameter (only applicable to events), operator, and type for the comparison. The options for types are as per the below.

          • Value: Enter a threshold for the condition.
          • Attributes: The attributes in the model selected above that have the same data type as the selected measurement point will be listed in the corresponding drop-down. Select the one you require for the triggering condition. This is only available for IoT Hub triggers.
          • Trigger: Only if two or more metrics or triggers are selected in the Trigger section will this be available. If the two triggers have the same data type, the trigger not selected for the alert condition will be listed in the corresponding drop-down. For example, if two triggers A and B of data type int are selected in Trigger Settings, and trigger A is the alert condition, then trigger B will be shown in the drop-down.


          You can add more conditions or condition groups as per required.

          Note

          There are limitations to the max number of conditions/condition groups that you can add. For more information, see Alert Limitations.

          The multi-measurement point alarm creation is temporarily unavailable to avoid data backlog caused by too many triggered multi-measurement point alarms if 2.3 Cumulative Update 5 has been applied to your environment.


      • No update of data: Select this to trigger an alert when the data reported by the device remains the same with its value unchanged in the set duration. Only available if a single metric is the trigger.


      • Use expression: Construct an expression as the alert condition using a combination of triggers, functions, and operators. For more information on the functions, see Time Window Functions.


        ../_images/use_expression.gif


        Note

        Only 1 measurement point can be used in expressions if the expression includes time window functions.


  • Alert Condition (for Device Status trigger)

    The status of the device to trigger the alert. Currently only supports Offline.


  • Timing

    Enable this if you wish to trigger alerts according to certain timings. Currently the time windows supported are Tumbling Window (default) and Sliding Window. Select a duration for each window. If Threshold is selected for Condition, select a time window function, operator, and enter a value. For more information, see Timed Alerts.

    Note

    This is not applicable for Device Status triggers and is only available for a single metric trigger. If more than one metric is selected as Trigger, this function will be disabled.

    The timing alarm creation is temporarily unavailable to avoid data backlog caused by too many triggered timing alarms if 2.3 Cumulative Update 5 has been applied to your environment.

Alert Details

The Alert Details section is where you set more information, such as the alert content, severity, type, etc.


../_images/alert_rule_details_section.png


  • Alert Content

    The content of the alert, which may include the possible causes and solutions for the alert. Maximum length is 500 characters. The input supports internationalization, and can be text or a metric variable, using its identifier via the use of expressions, to return its value. See below for some expression example formats.

    • ${pointId} for int, string, float, etc. data types.

    • If there are multiple triggers, use trigger{n}i to specify which trigger the metric belongs to, for example, ${trigger2:pointId} to specify the metric in trigger 2.

    • ${pointId/parameterId} for struct data types with parameters.

  • Alert Severity

    Select an alert severity from the list of defined alert severities according to your business needs.

  • Alert Type

    Select an alert type/subtype from the list of alert types.

  • Alert Triggering Delay

    You can set a time in seconds to delay triggering the alert rule. A “0” value will trigger the alert rule immediately when the condition is met.

  • Alert Masking

    Only available when the Scope is an asset tree, or if Timing is not enabled. When Alert Masking is enabled, all the alerts associated with the child nodes of the selected asset node will be blocked. It helps to reduce irrelevant alerts. See Masking Alert.

  • Enable Discrete Alert

    When enabled, the alert will be triggered and cleared the moment the alert condition is met and the alert end time will be the alert trigger time. As the alert is triggered immediately when the alert condition is met, Alert Triggering Delay and Alert Masking will not be applicable if discrete alert is enabled.

  • Save Alert Record

    The option to save an alert as a historical record after it is cleared is enabled by default. Historical records can be searched for and viewed at Alert Service > Alert Records if required. Toggle the switch off if you do not wish to save a historical record of the alert. If not saved, you will not be able to find any record of the triggered alert once it is cleared.

Additional Information

The Additional Information section enables you to create key-value tags based on the attribute values of the model selected in the Trigger Settings section. Create a tag by entering its Key and choosing an attribute from the drop-down, where the Value of the tag will be the attribute’s current value.


../_images/alert_rule_additional_info_section.png


Click Confirm to create the alert rule.

Results

After creating or editing an alert rule, the rule will take about 5 mins to take effect. You can view the alert records (if any) at Alert Service > Alert Records.