Log Service allows you to set one or more alert notification methods.Available notification
methods include emails, DingTalk, DingTalk chatbot webhooks, custom webhooks, and
Alibaba Cloud Message Center. This topic describes how to configure notification methods.
(Recommended) Message Center
If you set the notification method to Notifications, Message Center sends alert notifications
to specified contacts when alerts are triggered in Log Service.
- Specify the contacts to whom you want to send alert notifications in Message Center.
- Log on to the Message Center console.
- Choose . On the page that appears, click Modify next to Log Service Alarm Notification.
- In the Modify Contact dialog box, select the contacts and click Save.
If you need to add a contact, click
+ Add Receiver. Then, specify the email address and position of the contact.
Note
- Alibaba Cloud sends a verification email to the email address.The contact can receive
alert notifications only after the email address is verified.
- You must set at least one contact.
- The default notification method is Email and cannot be changed.
- Configure a notification method in the Log Service console.
- When you configure an alert rule, select Notifications from the Notifications drop-down list and click Add.
- Enter the content of an alert notification.
The content must be 1 to 500 characters in length. You can use system variables in
the content. For more information, see
System variables.
- Click Submit.
In this example, only one notification method is configured. If multiple notification
methods are required, configure the notification methods before you click Submit.
Email
If you set the notification method to Email, Log Service sends emails that contain
alert notifications to specified email addresses.
Note Log Service sends notification emails by using the monitor-sg@monitor.alibabacloud.com email address. You can add this email address to the email whitelist to avoid email
blocking.
- When you configure an alert rule, select Email from the Notifications drop-down list and click Add.
- Set the following parameters.
Parameter |
Description |
Recipients |
The email addresses that receive the alert notification. Separate multiple email addresses
with commas (,).
|
Subject |
The subject of the alert notification email. The subject must be 1 to 100 characters
in length. You can use system variables in the subject. For more information, see
System variables.
|
Content |
The content of the alert notification email. The content must be 1 to 500 characters
in length. You can use system variables in the content. For more information, see
System variables.
|
- Click Submit.
In this example, only one notification method is configured. If multiple notification
methods are required, configure the notification methods before you click Submit.
DingTalk chatbot webhooks
If you set the notification method to Webhook DingTalk Bot, Log Service sends alert
notifications by using a DingTalk chatbot to the DingTalk group to which a specified
webhook URL points. The chatbot can also remind the specified contacts of the alert
notifications.
Note Each DingTalk chatbot can send a maximum of 20 alert notifications every minute.
- Create a DingTalk chatbot.
- Open DingTalk and go to a DingTalk group.
- In the upper-right corner of the chat window, click the Group Settings icon and choose .
- In the ChatBot dialog box, click the + icon in the Add Robot section.
- In the Robot details dialog box, select Custom (Custom message services via Webhook) and click Add.
- In the Add Robot dialog box, enter a chatbot name and select security options based on your business requirements. Then, select I have read and accepted DingTalk Custom Robot Service Terms of Service and click Finished.
Note We recommend that you set the Security Settings parameter to Custom Keywords. You can set a maximum of 10 keywords. Each message must contain at least one keyword.
We recommend that you set a keyword to Alert.
- Click Copy to copy the webhook URL.
- Configure a notification method in the Log Service console.
- When you configure an alert rule, select WebHook-DingTalk Bot from the Notifications drop-down list and click Add.
- Set the following parameters.
Parameter |
Description |
Request URL |
The webhook URL of the DingTalk chatbot. Paste the webhook URL that you copied in
Step 1.
|
Title |
The title of the alert notification. You can use system variables in the title. For
more information, see System variables. The title must be 1 to 100 characters in length.
|
Recipients |
The group members whom you want to remind to read the alert notification. Valid values:
None, All, and Specified Members. If you select Specified Members, enter the mobile phone numbers of the group members in the Tagged List field. Separate multiple mobile phone numbers with commas (,).
|
Content |
The content of the alert notification. You can modify the default content. The content
must be 1 to 500 characters in length. You can use system variables in the content.
For more information, see System variables.
Note If you need to remind a group member to read the alert notification, use the @<Mobile phone number of the group member> syntax in the Content field.
|
- Click Submit.
In this example, only one notification method is configured. If multiple notification
methods are required, configure the notification methods before you click Submit.
Custom webhooks
If you set the notification method to Webhook-Custom, Log Service sends the alert
notification to a specified webhook URL.
Note If Log Service receives no response within 5 seconds after a notification is sent,
the request times out.
- When you configure an alert rule, select WebHook-Custom from the Notifications drop-down list and click Add.
- Set the following parameters.
Parameter |
Description |
Request URL |
The custom webhook URL. |
Request Method |
The method to send the notification. Available request methods include GET, POST,
DELETE, PUT, and OPTIONS. The default request header is Content-Type: application/json;charset=utf-8.
If you need to add request headers, click Add Request Headers.
|
Content |
The content of the alert notification. You can modify the default content. The content
must be 1 to 500 characters in length. You can use system variables in the content.
For more information, see System variables.
|
- Click Submit.
In this example, only one notification method is configured. If multiple notification
methods are required, configure the notification methods before you click Submit.