External alerts are alerts that are generated by external systems. CloudMonitor can receive external alerts and send alert notifications to alert contact groups that you configure. CloudMonitor provides a URL that you can use to call the alert service to report external alerts.
Prerequisites
An alert contact group is created. For more information, see Create an alert contact or alert contact group.
Procedure
- Log on to the CloudMonitor console.
In the left-side navigation pane, choose .
Click the Alert Contact Group tab.
Find the alert contact group that you want to use and click Access External Alert.
In the Alert Service Guide panel, set the parameters.
Parameter
Description
Security Setting
The method that is used to authenticate the content of alert notifications or the logon information of the external system. Valid values:
Security Keywords: CloudMonitor checks whether the content of alert notifications contains the specified keywords. CloudMonitor sends alert notifications to alert contacts in the alert contact group only if the content of the alert notifications contains the specified keywords.
Basic Auth: CloudMonitor authenticates the logon information of the external system. If the external system passes the authentication, CloudMonitor sends alert notifications to alert contacts in the alert contact group.
Add Security Keyword
The security keywords that you add to authenticate the content of alert notifications.
If you add security keywords, CloudMonitor checks whether the content of alert notifications contains the specified keywords. If the content of the alert notifications contains the specified security keywords, CloudMonitor sends the alert notifications to alert contacts in the alert contact group.
If you do not add security keywords, CloudMonitor sends alert notifications without authenticating the content.
If you set the Security Setting parameter to Security Keywords, you must add at least one security keyword. To add security keywords, perform the following steps:
Click Add Security Keyword.
Click the icon.
Enter a security keyword.
Click Save Security Keywords.
Notification Methods
The methods that are used to send alert notifications. Valid values:
Email + Webhook
Alert Service URL
The URL that is used to call the alert service in CloudMonitor.
If you want to change the token of the URL, click Update Token.
Alert Content
The content of alert notifications. To test whether the alert is valid, click Test Command to view the alert content and test command.
The alert content is in JSON format and must contain the ruleName, title, and message fields. Example:
{"ruleName":"Alert rule name","title":"Alert message title","message":"Alert message content"}
.The test command consists of the alert content and alert service URL. Example:
curl -u "<accessKey>:<accessSecret>" -H "Content-Type: application/json" -d '{"ruleName":"Alert rule name","title":"Alert message title","message":"Alert message content"}' "https://metrichub-cms-cn-hangzhou.aliyuncs.com/event/notify?token=eyJhbGlVaWQiOiIxMjA4ODYzMTc4NjEyOTUzIiwibmFtZSI6IuS6kei0puWPt-aKpeitpuiBlOezu-S6uiIsInRva2VuVHlwZSI6ImNvbnRhY3RHcm91cCJ9.HZtXuDWVaP68Bi-0a7****&level=CRITICAL"
.You can click the icon at the end of the command, replace the
<accessKey>:<accessSecret>
with the AccessKey ID and AccessKey secret of your Alibaba Cloud account, and then paste the command to a command prompt window to test the command. If the following result is returned, the test is successful:{"requestId":"de912e9f-622d-4691-b19c-fbb763f746da","code":"200","msg":null,"data":{"requestId":"de912e9f-622d-4691-b19c-fbb763f746da"}}
Click Close.