Updated on 2024-08-05 GMT+08:00

Alarm Templates

An alarm template is a combination of alarm rules based on cloud services. You can use an alarm template to create threshold alarm rules, event alarm rules, or PromQL alarm rules for multiple metrics of one cloud service in batches.

Precautions

You can create up to 150 alarm templates. If the number of alarm templates reaches 150, delete unnecessary templates and create new ones.

Background

AOM presets default alarm templates for key metrics (including CPU usage, physical memory usage, host status, and service status) of all hosts and services. They are displayed on the Alarm Templates > Default page. You can locate the desired default alarm template and click in the Operation column to quickly customize your own alarm template.

Creating an Alarm Template

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Alarm Management > Alarm Templates.
  3. Click Create Alarm Template.
  4. Set the basic information about an alarm template. Table 1 describes the parameters.

    Table 1 Basic information

    Parameter

    Description

    Template Name

    Name of an alarm template. Enter a maximum of 100 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed.

    Enterprise Project

    Enterprise project.

    • If you have selected All for Enterprise Project on the global settings page, select one from the drop-down list here.
    • If you have already selected an enterprise project on the global settings page, this option will be grayed and cannot be changed.
      NOTE:

      To use the enterprise project function, contact engineers.

    Description

    Description of the template. Enter up to 1,024 characters.

  5. Add a cloud service to be monitored and an alarm rule to the template.

    1. Select a desired cloud service from the drop-down list.
    2. Switch to your desired cloud service tab. Then add an alarm rule for the cloud service. For details, see Table 2.
      Table 2 Parameters for adding an alarm rule for the cloud service

      Cloud Service

      Alarm Rule Type

      Method

      FunctionGraph, DRS, RDS, NAT, VPC, DCS, CSS, DC, CBR, DMS, ELB, EVS, OBS, DDS, and WAF

      Metric alarm rule

      1. Click Add Threshold Alarm Rule.
      2. In the displayed dialog box, set the rule name, metric data, and alarm condition. For details, see Creating Metric Alarm Rules by Selecting Metrics from All Metrics.
      3. Click OK.

      CCEFromProm

      Event alarm rule

      See 6.

      PromQL alarm rule

      See 7.

  6. (Optional) Add an event alarm rule for the CCEFromProm service.

    1. Choose Add Alarm Rule > Add Event Alarm Rule.
    2. In the displayed dialog box, set the rule name and event rule details. For details, see Table 3.
      • You can click Add Event to add more events and set information such as the trigger mode and alarm severity for the events.
      • In case of multiple events, click Batch Set to set alarm conditions for these events in batches.
      • Click next to the event details to copy them and then modify them as required.
      Table 3 Event rule parameters

      Parameter

      Description

      Rule Name

      Enter a maximum of 256 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed.

      Event Name

      Select a value from the drop-down list. By default, all events are selected.

      Trigger Mode

      Trigger mode of an event alarm.

      • Accumulated Trigger: When the trigger condition is met for a specified number of times in a monitoring period, alarm notifications are sent based on the preset interval.

        Assume that you set Event Name to VolumeResizeFailed, Monitoring Period to 20 minutes, Cumulative Times to 3, and Alarm Frequency to Every 5 minutes. If data volume scale-out fails three times within 20 minutes, an alarm notification will be sent every five minutes unless the alarm is cleared.

      • Immediate Trigger: An alarm is immediately generated when the trigger condition is met.

      Alarm Severity

      Severity of an event alarm. Options: Critical, Major, Minor, and Warning.

    3. Click OK.

  7. (Optional) Add a PromQL alarm rule for the CCEFromProm service.

    1. Choose Add Alarm Rule > Add PromQL Alarm Rule.
    2. In the displayed dialog box, set the rule name, default rule, and alarm severity. For details, see Table 4.
      Table 4 PromQL alarm rule parameters

      Parameter

      Description

      Rule Name

      Enter a maximum of 256 characters and do not start or end with an underscore (_) or hyphen (-). Only letters, digits, underscores, and hyphens are allowed.

      Default Rule

      Detection rule generated based on Prometheus statements. The system provides two input modes: Custom and CCEFromProm.

      • Custom: If you have known the metric name and IP address and are familiar with the Prometheus statement format, select Custom from the drop-down list and manually enter a Prometheus command.
      • CCEFromProm: used when you do not know the metric information or are unfamiliar with the Prometheus format. Select CCEFromProm from the drop-down list and then select a desired template from the CCE templates. The system then automatically fills in the Prometheus command based on the selected template.

      For details, see Prometheus Statements.

      Alarm Severity

      Severity of a metric alarm. Options: Critical, Major, Minor, and Warning.

      Dimensions

      Metric monitoring dimension, which is automatically generated based on the Prometheus statement you set.

      Duration

      A metric alarm will be triggered when the alarm condition is met for the specified duration. For example, if Duration is set to 2 minutes, a metric alarm will be triggered when the alarm condition is met for two minutes.

      Advanced Settings

      Check Interval

      Interval at which metric query and analysis results are checked.

      • XX hours: Check the query and analysis results every XX hours.
      • XX minutes: Check the query and analysis results every XX minutes.

      Alarm Tag

      Alarm identification attribute in the format of "key:value". It is used in alarm noise reduction scenarios.

      It is automatically generated based on the Prometheus statement you set. You can modify it as required. To add more alarm tags, click . For details, see Alarm Tags and Annotations.

      Alarm Annotation

      Click to add an alarm annotation. Alarm non-identification attribute in the format of "key:value". It is used in alarm notification and message template scenarios. For details, see Alarm Tags and Annotations.

      Notification Content

      Alarm notification content. It is automatically generated based on the Prometheus statement you set.

    3. Click OK.

  8. Click OK to create the alarm template.
  9. (Optional) In the displayed Bind Alarm Template with Prometheus Instance/Cluster dialog box, set the cluster or Prometheus instance to be bound with the alarm template. For details about the parameters, see Table 5. After the setting is complete, click OK.

    Table 5 Parameters for binding an alarm template

    Parameter

    Description

    Instance

    This parameter is optional. If the cloud services selected in 5.a contain services other than CCEFromProm, this parameter will be displayed.

    The drop-down list displays all Prometheus instances for cloud services under your account. Select your desired instance.

    Cluster

    This parameter is optional. If the cloud services selected in 5.a contain CCEFromProm, this parameter will be displayed.

    The drop-down list displays all CCE clusters of your account. Select your desired cluster.

    Notify When

    Set the scenario for sending alarm notifications.

    • Alarm triggered: If the alarm trigger condition is met, the system sends an alarm notification to the specified personnel by email or SMS.
    • Alarm cleared: If the alarm clearance condition is met, the system sends an alarm notification to the specified personnel by email or SMS.

    Alarm Mode

    • Direct alarm reporting: An alarm is directly sent when the alarm condition is met. If you select this mode, set an interval for notification and specify whether to enable an action rule.

      Frequency: interval for sending alarm notifications. Select a desired value from the drop-down list.

      After an alarm action rule is enabled, the system sends notifications based on the associated SMN topic and message template. If the existing alarm action rules cannot meet your requirements, click Create Rule in the drop-down list to create one. For details, see Creating an Alarm Action Rule.

    • Alarm noise reduction: Alarms are sent only after being processed based on noise reduction rules, preventing alarm storms.

      If you select this mode, the silence rule is enabled by default. You can determine whether to enable Grouping Rule as required. After this function is enabled, select a grouping rule from the drop-down list. If existing grouping rules cannot meet your requirements, click Create Rule in the drop-down list to create one. For details, see Creating a Grouping Rule.

  10. View the created alarm template on the Custom tab page.

    If a resource or metric meets the alarm condition set in the alarm template, an alarm will be triggered. In the navigation pane, choose Alarm Management > Alarm List to view the alarm. The system also sends alarm notifications to specified personnel by email or SMS.

More Operations

After the alarm template is created, you can also perform the operations listed in Table 6.

Table 6 Related operations

Operation

Description

Viewing an alarm template

In the template list, you can view the rule set name, number of rules, bound cluster, and enterprise project.

Binding an alarm template with a Prometheus instance or cluster

Click in the Operation column. For details, see 9.

Modifying an alarm template

Choose > Edit in the Operation column. For details, see Creating an Alarm Template.

Copying an alarm template

Click in the Operation column.

Deleting an alarm template

  • To delete an alarm template, choose > Delete in the Operation column.
  • To delete one or more alarm templates, select them and click Delete in the displayed dialog box.

Searching for an alarm template

Enter a template name in the search box in the upper right corner and click .

Viewing alarm rules created using a template

In the navigation pane on the left, choose Alarm Management > Alarm Rules. Enter a template name keyword in the search box above the alarm rule list and click . If an alarm template has been bound with a Prometheus instance or cluster, you can also search for the alarm rule by the bound Prometheus instance or cluster name.

Viewing alarms

When the metric value of a resource meets an alarm condition, an alarm will be generated.

In the navigation pane, choose Alarm Management > Alarm List. On the Alarms tab page, view alarms. For details, see Viewing Alarms.

Viewing events

When no metric data is reported during the configured consecutive periods, the system reports an insufficient data event.

In the navigation pane, choose Alarm Management > Alarm List. On the Events tab page, view events. For details, see Viewing Events.