Route alerts from external systems through Cloud Monitor notification channels by using an alert service URL.
Prerequisites
An alert contact group is created. For more information, see Create an alert contact group.Procedure
-
Log on to the Cloud Monitor console.
- In the left-side navigation pane, choose .
- Click the Alert Contact Group tab.
- For the target alert contact group, click Access External alert.
- In the Alert Service Guide panel, configure the parameters for integrating external alerts.
Parameter Description Security Setting The authentication method for validating alerts from an external system. Cloud Monitor checks the alert content or login credentials before notifying the contacts in the group. Valid values:- Security Keywords: Cloud Monitor validates that the alert content contains a predefined security keyword. Notifications are sent only if the content includes this keyword.
- Basic Auth: Cloud Monitor authenticates the external system's login credentials. Notifications are sent upon successful authentication.
Add Security Keyword A security keyword for content validation. - Cloud Monitor sends notifications only if the alert content contains the security keyword.
- If no security keyword is configured, Cloud Monitor skips validation and sends alert notifications to all contacts in the alert contact group.
This setting is required when Security Setting is set to Security Keywords. To add a security keyword, perform the following steps:- Click Add Security Keyword.
- Click the
icon. - Enter a security keyword.
- Click Save Security Keywords.
Alert Level The alert level and associated notification methods. Valid values: - phone call + SMS + email + webhook
- SMS + email + webhook
- email + webhook
Alert Service URL The URL generated by Cloud Monitor for the external system to send alerts. To change the token in the Alert Service URL, click Update Token.
Alert Content The alert notification content. To verify that alerting is configured correctly, click Test Command to view the alert content and test command. - The alert content must be in JSON format and include the ruleName, title, and message fields. Example:
{"ruleName":"alert rule name","title":"alert title","message":"alert message"}. - The test command combines the Alert Content and the Alert service URL. Example:
curl -u "<accessKey>:<accessSecret>" -H "Content-Type: application/json" -d '{"ruleName":"alert rule name","title":"alert title","message":"alert message"}' "https://metrichub-cms-cn-hangzhou.aliyuncs.com/event/notify?token=eyJhbGlVaWQiOiIxMjA4ODYzMTc4NjEyOTUzIiwibmFtZSI6IuS6kei0puWPt-aKpeitpuiBlOezu-S6uiIsInRva2VuVHlwZSI6ImNvbnRhY3RHcm91cCJ9.HZtXuDWVaP68Bi-0a7****&level=CRITICAL".Click the
icon next to the test command to copy it. Replace <accessKey>:<accessSecret>with your AccessKey ID and AccessKey Secret, paste the command into a command prompt, and run it. A successful test returns a response similar to the following:{"requestId":"de912e9f-622d-4691-b19c-fbb763f746da","code":"200","msg":null,"data":{"requestId":"de912e9f-622d-4691-b19c-fbb763f746da"}}
- Click Close.
该文章对您有帮助吗?