ActionTrail sends alert notifications to the users or user groups that you specify as alert contacts based on the content defined in alert templates. This topic describes how to create, modify, and delete an alert template.

Create an alert template

By default, ActionTrail uses the SLS actiontrail builtin content template to send alert notifications to the specified alert contacts. You can also create custom alert templates based on your business requirements.

  1. Log on to the ActionTrail console.
  2. In the left-side navigation pane, click Event Alerting.
  3. On the Event Alerting page, select Alert Template from the Alert Management drop-down list.
  4. In the Alert Template section, click Create.
  5. In the Add Content Template dialog box, set the ID and Name parameters.
  6. Configure each alert notification method.
    Notification method Parameter
    SMS The following parameters are available:
    • Language: the language of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Voice The following parameters are available:
    • Language: the language of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Email The following parameters are available:
    • Language: the language of the alert notification.
    • Subject: the title of the alert notification. You can use template variables to define the title of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    DingTalk The following parameters are available:
    • Title: the title of the alert notification. You can use template variables to define the title of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Webhook-Custom The following parameters are available:
    • Sending Mode: the mode in which alert notifications are sent. Valid values: Single and Batch.
      • If you select Batch and set the Maximum number of items sent in a group parameter to N, an alert notification contains the information about the first N alerts in a merge set.
      • If you select Batch and the content you configured can be parsed into JSON data, the alert notification is sent in the JSON format. Otherwise, string arrays are sent.
      For example, if you customize the content as {"project": "${project}", "alert_name": "${alert_name}"}, the following notifications are sent for two alerts:
      • Single: sends two alert notifications. Content: {"project": "project-1", "alert_name": "alert-1"} and {"project": "project-2", "alert_name": "alert-2"}.
      • Batch: sends one alert notification. Content: [{"project": "project-1", "alert_name": "alert-1"}, { "project": "project-2", "alert_name": "alert-2"}].
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Note The default request header is Content-Type: application/json;charset=utf-8 when ActionTrail sends alert notifications. If a webhook receiver requires request headers in other formats, you can customize the request headers when you configure notification methods. For more information, see the "Webhook" section in the Notification methods topic.
    Notifications The following parameters are available:
    • Language: the language of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Enterprise WeChat The following parameters are available:
    • Title: the title of the alert notification. You can use template variables to define the title of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Lark The following parameters are available:
    • Title: the title of the alert notification. You can use template variables to define the title of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
    Slack The following parameters are available:
    • Title: the title of the alert notification. You can use template variables to define the title of the alert notification.
    • Content: the content of the alert notification. You can use template variables to define the content of the alert notification. For more information, see Template variables.
  7. Click OK.

Modify an alert template

  1. Find the alert template that you want to modify and click Edit in the Actions column.
  2. In the Edit Alert Template dialog box, change the name of the alert template or modify the information specified for the alert notification methods. For example, you can modify the content of the alert notification specified for an alert notification method.
  3. Click OK.

Delete an alert template

Before you delete an alert template, make sure that the alert template is not referenced by the action policies of alert rules. If you delete the alert template referenced by the action policy of an alert rule, ActionTrail uses the SLS actiontrail builtin content template to send alert notifications.

Note To prevent alert notification exceptions, do not delete the SLS actiontrail builtin content template.
  1. Find the alert template that you want to delete and click Delete in the Actions column.
  2. Click OK.