Updated on 2024-09-06 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 dimmed and cannot be changed.

    Description

    Description of the template. Enter up to 1024 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.
      Figure 1 Adding an alarm rule for the cloud service
      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 Create Rule dialog box, set a rule name, metric, and alarm condition. For details, see 5.d and 6 in 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.
      Figure 2 Adding an event alarm rule
      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.
      • : critical alarm.
      • : major alarm.
      • : minor alarm.
      • : 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.
      Figure 3 Adding a PromQL alarm rule
      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.
      NOTE:

      Click next to the alarm rule details to lock the content. Then you can perform the following operations:

      • Click next to the alarm rule details to unlock the content.
      • Click next to the alarm rule details to copy the Prometheus statement.

      For details, see Prometheus Statements.

      Alarm Severity

      Severity of a metric alarm.
      • : critical alarm.
      • : major alarm.
      • : minor alarm.
      • : 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. Options: Immediate, 15 seconds, 30 seconds, 1 minute, 2 minutes, 5 minutes, and 10 minutes. For example, if Duration is set to 2 minutes, a metric alarm is triggered when the default rule condition is met for 2 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.
      • XX seconds: Check the query and analysis results every XX seconds.
        NOTE:

        You can set Check Interval to 15 seconds or 30 seconds to implement second-level monitoring. The timeliness of metric alarms depends on the metric reporting period, rule check interval, and notification send time.

        For example, if the metric reporting period is 15 seconds, rule check interval is 15 seconds, and notification send time is 3 seconds, an alarm can be detected and an alarm notification can be sent within 33 seconds.

      Alarm Tag

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

      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.

      NOTE:

      If tag policies related to AOM have already been set, add alarm tags based on these policies. If a tag does not comply with the policies, tag addition may fail. Contact your organization administrator to learn more about tag policies.

      Alarm Annotation

      Click to add an alarm annotation. Alarm non-identification attribute. It is used in alarm notification and message template scenarios. It is in the format of "key:value". 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. (Optional) Manage variables. When adding a PromQL alarm rule to the CCEFromProm service, manage variables and apply them to the alarm template PromQL.

    1. Click Manage Variable.
    2. In the displayed dialog box, set variable names and values. A maximum of 50 variables can be added.
      Figure 4 Managing variables
    3. Click OK.

  9. Click OK to create the alarm template.
  10. (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.

    Figure 5 Binding an alarm template with a Prometheus instance or cluster
    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 and for multi-account aggregation 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.

      NOTE:

      The alarm severity and tag configured in the selected grouping rule must match those configured in the alarm rule. Otherwise, the grouping rule does not take effect.

  11. 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.

    Figure 6 Creating an alarm template

Importing an Alarm Template

You can quickly create an alarm template by importing a template file.

  1. Log in to the AOM 2.0 console.
  2. In the navigation pane, choose Alarm Management > Alarm Templates.
  3. Click Import Alarm Template.
  4. In the displayed dialog box, set parameters. For details, see Table 6. Click OK.

    Figure 7 Importing an alarm template
    Table 6 Parameters for importing an alarm template

    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. Select a value from the drop-down list.

    Template File

    Directly upload or drag a JSON file to the box to upload.

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

More Operations

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

Table 7 Related operations

Operation

Description

Checking an alarm template

In the template list, check the information such as Template Name, Alarm Rules/Conditions, Associated Cluster, and Enterprise Project.

Binding an alarm template with a Prometheus instance or cluster

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

Modifying an alarm template

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

Exporting a custom alarm template

Choose > Export in the Operation column.

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 Checking 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.