Hybrid Cloud Monitoring allows you to use custom expressions to perform calculations on multiple NAS monitoring metrics and trigger alerts based on the results. For example, you can create a rule that sends a notification when the data volume of Infrequent Access media exceeds a specified percentage of the data volume of a General-purpose NAS.
Prerequisites
Before you begin, make sure you have completed the following tasks:
You have created a NAS file system. For more information, see Create a file system.
You have created an alert contact group. For more information, see Create an alert contact or an alert contact group.
You have activated Hybrid Cloud Monitoring. For more information, see Activate Hybrid Cloud Monitoring.
You have created a namespace. For more information, see Create a namespace.
Procedure
Import Alibaba Cloud service metrics.
Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
On the Namespace page, find the target namespace. In the Metric Data column, click the number of accounts, cloud services, metrics, or tasks.
On the Alibaba Cloud Service Metrics tab of the Metric management panel, add monitoring metrics for NAS.
Add File Storage NAS.
Click the
icon next to Current Account.In the Add Product dialog box, select File Storage NAS and click OK.
Add monitoring metrics for File Storage NAS.
Click File Storage NAS, and then click Add Metric.
In the Add Metric dialog box, select the target monitoring metrics and click OK.
NoteFile Storage NAS and Cloud Parallel File Storage (CPFS) share the same interface in the CloudMonitor console. The Add metric dialog box lists monitoring metrics for both products. Select only the metrics where the Metric Category column is File Storage NAS. For a complete list of NAS monitoring metrics, see Monitoring items.
Create an alert rule.
On the Namespace page, click Create Alert Rule.
In the Create Alert Rule panel, set the following parameters.
Parameter
Description
Rule Name
The name of the alert rule.
Namespace
Select the namespace to which you imported the NAS metrics in Step 1.
Alert Expression
The trigger condition for the alert rule, written in a PromQL-style expression. You can perform arithmetic operations on multiple monitoring metrics and compare the result with a threshold. An alert is triggered when the condition is met.
Tags
Key-value pairs to tag the alert rule.
Annotations
Key-value annotations for the alert rule.
Mute Period
The period to wait before resending a notification for an unresolved alert. Valid values: 5 minutes, 15 minutes, 30 minutes, 60 minutes, 3 hours, 6 hours, 12 hours, and 24 hours.
When a monitoring metric meets the alert threshold, a notification is sent.
If the monitoring metric continues to exceed the threshold within the mute period, no new notifications are sent.
If the monitoring metric has not returned to normal after the mute period ends, CloudMonitor sends another notification.
For example, if you set the Mute Period to 12 hours, CloudMonitor resends a notification after 12 hours if the alert is still active.
Effective Period
The time period during which the alert rule is active.
Alert Contact Group
The group of contacts who receive alert notifications.
For more information about how to create an alert contact and an alert contact group, see Create an alert contact or an alert contact group.
Alert Level
The alert level and its corresponding notification methods. Valid values:
Info (Email + webhook)
Alert Callback
A publicly accessible webhook URL. CloudMonitor sends alert information to this URL via HTTP POST requests. Only the HTTP protocol is supported.
To test connectivity to your alert callback URL, do the following.
Click Test, located directly to the right of the callback URL.
In the WebHook Test panel, use the HTTP status code and test result details to verify and troubleshoot connectivity to your alert callback URL.
NoteYou can also set the Test Template Type: and Language:. Then click Test again to view updated test results.
Click Close.
Auto Scaling
If you enable Auto Scaling, the specified scaling rule is automatically triggered when an alert occurs. You must specify the region, ESS Group, and ESS Rule.
For more information about how to create a scaling group, see Configure a scaling group.
For more information about how to create a scaling rule, see Configure a scaling rule.
Log Service
If you enable Log Service, alert information is written to Log Service when an alert is triggered. You must specify the region, ProjectName, and Logstore.
For more information about how to create a Project and Logstore, see Collect and analyze ECS text logs by using LoongCollector.
Message Service (MNS) - Topic
If you enable Simple Message Queue (formerly MNS) - Topic, CloudMonitor sends alert information to the specified MNS topic when an alert is triggered. You must specify the region and topic.
For more information about how to create a topic, see Create a topic.
Function Compute
If you enable Function Compute, CloudMonitor invokes a function in Function Compute with the alert information, allowing for custom processing. You must specify the region, service, and function.
For more information about how to create a service and a function, see Quickly create a function.
No data handling method
Specifies how to handle cases where no monitoring data is reported. Valid values:
Do not do anything (Default): No alert notification is sent. This is suitable for scenarios where missing data is expected.
Send alert notifications: An alert is triggered when data reporting is interrupted. This is suitable for scenarios where missing data may indicate a problem, such as a monitoring agent going offline.
Treated as normal: Missing data is considered a normal state, and any active alerts are resolved. Do not select this option if missing data could indicate a failure.
Click OK.
Optional: View the alert rule.
In the left-side navigation pane, choose .
On the Alert Rules page, find the rule that you created. The Product Name for this rule is Prometheus.
References
To modify an alert rule, see Manage alert rules.
To manage a namespace, see Manage namespaces.