Updated on 2024-04-15 GMT+08:00

Creating Alarm Rules and Viewing Alarms

You can set threshold conditions for resource metrics by setting alarm rules. When the value of a metric reaches the threshold, an alarm is generated. If no metric data is reported, an insufficient data event is generated so that you can detect and handle exceptions in a timely manner.

There are three modes for creating metric alarm rules: Select by resource type, Select from all metrics, and Run Prometheus command. The following uses Select by resource type as an example to describe how to add an alarm rule and view alarms.

Creating a Metric Alarm Rule

  1. On the menu bar, choose Monitoring Center.
  2. In the navigation pane, choose Alarm Management > Alarm Rules.
  3. On the rule list page, click Create Alarm Rule.
  4. Set basic information about the alarm rule by referring to Table 1.

    Table 1 Basic information

    Parameter

    Description

    Rule Name

    Name of a rule. Enter a maximum of 255 characters. The following special characters are not allowed: "$# %&'+;<=>?\

    Description

    Description of the rule. Enter up to 1000 characters.

  5. Set the detailed information about the alarm rule.

    1. Set Rule Type to Metric alarm rule.
    2. Set Configuration Mode to Select by resource type and specify Resource Type and Monitored Object.
      • Resource Type: Select a desired resource type from the drop-down list.
      • Monitored Object: Click Select Monitored Object to select a desired monitored object.

        If you enable Apply to All when selecting monitored objects, an alarm rule will be created for all metrics of the type you select under an application or service.

    3. Set an alarm condition. Customize alarm conditions or create them by importing a template. The following describes how to customize an alarm condition.
      • Custom

        Click Custom and set the statistical period, consecutive periods, and alarm condition. Table 2 describes the parameters.

        Table 2 Parameters for setting an alarm condition

        Category

        Parameter

        Description

        Alarm Condition

        Metric

        Metric to be monitored.

        Consecutive Periods

        When the metric value meets the alarm condition for a specified number of consecutive periods, a metric alarm will be generated.

        Statistical Period

        Metric data is aggregated based on the configured statistical period, which can be 1 minute, 5 minutes, 15 minutes, or 1 hour.

        Statistic

        Method used to measure metrics. Options: Avg, Min, Max, Sum, and Samples.

        Alarm Condition

        Trigger condition of a metric alarm. An alarm condition consists of two parts: operators (≥, ≤, >, and <) and threshold value. For example, if the trigger condition is set to > 85 and an actual metric value exceeds 85, a metric alarm will be generated.

        Alarm Severity

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

        -

        Check Interval

        Interval at which metric query and analysis results are checked.

        • Hourly: Query and analysis results are checked every hour.
        • Daily: Query and analysis results are checked at a fixed time every day.
        • Weekly: Query and analysis results are checked at a fixed time point on a specified day of a week.
        • Custom interval: The query and analysis results are checked at a fixed interval.
        • Cron: A cron expression is used to specify a time interval. Query and analysis results are checked at the specified interval.

          The time specified in the cron expression can be accurate to the minute and must be in the 24-hour notation. Example: 0/5 * * * *, which indicates that the check starts from 0th minute and is performed every 5 minutes.

        Advanced Settings

        Alarm Clearance

        An alarm will be cleared if the monitored object does not meet the trigger condition within the monitoring period. By default, metrics in only one period are monitored. You can set up to five monitoring periods.

        Action Taken for Insufficient Data

        Action to be taken when no metric data is generated or metric data is insufficient within the monitoring period. You can set this option based on your requirements.

        By default, metrics in only one period are monitored. You can set up to five monitoring periods.

        The system supports the following actions: changing the status to exceeded and sending an alarm, changing the status to insufficient data and sending an event, maintaining the previous status, and changing the status to normal and sending an alarm clearance notification.

  6. Set an alarm notification policy. Direct alarm reporting: An alarm is directly sent when the alarm condition is met.

    1. Specify whether to enable an alarm action rule. 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 to create one. For details, see Creating an Alarm Action Rule.
    2. After an alarm action rule is selected, specify whether to enable alarm clearance notification. After alarm clearance notification is enabled, if the alarm clearance condition set in Advanced Settings > Alarm Clearance is met, alarm clearance notifications are sent based on the selected action rule.

  7. Click Create Now. Then, click Back to Alarm Rule List to view the created alarm rule.

    In the expanded list, if a metric value meets the configured alarm condition, a metric alarm is generated on the alarm page. To view it, choose Alarm Management > Alarm List in the navigation pane.

Viewing Alarms

  1. In the navigation pane, choose Alarm Management > Alarm List.
  2. Click the Alarms tab to view the alarm information.

    1. Set a time range to view alarms. There are two methods to set a time range:

      Method 1: Use a predefined time label, such as Last hour or Last 6 hours. You can select a time range as required.

      Method 2: Specify the start time and end time (max. 31 days).

    2. Set the interval for refreshing alarms. Click and select a value from the drop-down list, such as Refresh manually or 1 minute auto refresh.
    3. Set filter criteria and click to view the alarms generated in the period.

  3. Perform the operations listed in Table 3 as required.

    Table 3 Operations

    Operation

    Description

    Viewing alarm statistics

    Click , and view alarm statistics that meet filter criteria within a specific time range on a bar graph.

    Clearing alarms

    • To clear an alarm, click in the Operation column of the target alarm.
    • To clear one or more alarms, select them and click Clear in the displayed dialog box.
      NOTE:

      You can clear an alarm after the corresponding problem is resolved.

    Viewing alarm details

    Click an alarm name to view the alarm details and handling suggestions.

    Viewing cleared alarms

    Click Active Alarms in the upper right corner and select Historical Alarms from the drop-down list to view alarms that have been cleared.