Skip to main content
Version: FCP 25.11

Alert Bot Configuration

Configure a Feishu Alert Bot

Add a Feishu bot

Follow the document below to add a bot to the Feishu group that will receive alert notifications:

Add a Feishu Bot

Configure the message template

Follow the document below to configure the message template:

Configure the Message Template

  1. Select webhook. See the appendix below for the sample JSON payload.

img.png

Parameters:

{
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"strategyName": "111111"
},
"annotations": {
"level": "Notification",
"resourceType": "FILE_SYSTEM",
"monitorMetricStr": "Service component equals abnormal",
"resourceName": "filesystem-1",
"resourceNode": "head-1",
"mgmtNode": null,
"monitorType": "SERVICE",
"curValue": "0.000",
"svcName": "slurmdbd"
}
}
]
}
  1. Customize the bot message.

img_1.png

Set the alert-level color in the notification content.

img_3.png

img_2.png

  1. View the test message.

img_2.png

img_4.png

Appendix

The JSON content used in the message is explained below.

  • Alert JSON
{
"status": "firing",
"alerts": [
{
"status": "firing",
"labels": {
"strategyName": "111111"
},
"annotations": {
"level": "Notification",
"resourceType": "FILE_SYSTEM",
"monitorMetricStr": "Service component equals abnormal",
"resourceName": "filesystem-1",
"resourceNode": "head-1",
"mgmtNode": null,
"monitorType": "SERVICE",
"curValue": "0.000",
"svcName": "slurmdbd"
}
}
]
}
  • Recovery JSON
{
"status": "resolved",
"alerts": [
{
"status": "resolved",
"labels": {
"strategyName": "111111"
},
"annotations": {
"level": "Critical",
"resourceType": "CLUSTER",
"monitorMetricStr": "CPU usage greater than 100%",
"resourceName": "clusterAAA",
"resourceNode": "head-1",
"mgmtNode": "Fastone-Core",
"monitorType": "HOST",
"curValue": "1.0",
"svcName": null
}
}
]
}

Format notes: the array represents the alert metrics. If any item in the array has status firing, the top-level status is also firing.

Field descriptions:

  • status: resolved or firing, corresponding to recovery and alert
  • level: the alert level shown on the platform page, such as Notification or Critical
  • resourceType: monitored resource type, such as CLUSTER or FILE_SYSTEM
  • monitorMetricStr: monitored metric
  • resourceName: monitored resource name, such as cluster name or file system name
  • resourceNode: node that triggered the alert, usually a node in a cluster
  • mgmtNode: platform node, such as Fastone-Core, Fastone-Common, or Fastone-Monitor
  • monitorType: monitoring category, either HOST or SERVICE
  • curValue: current value of the monitored metric
  • svcName: when monitorType is SERVICE, the service name that triggered the alert, such as slurmdbd or node-exporter
  • strategyName: strategy name; refer to the alert records page on the platform

Example

The following example shows how to add alert notifications to a Feishu group in Feishu version 6.11.16. If other versions differ, refer to the official documentation.

  • Find Feishu Automation in Feishu.

img_3.png

  • Create a new bot application.

img_4.png

img_5.png

  • Create a workflow.

img_6.png

  • Create a trigger.

img_7.png

  • Select a webhook trigger.

img_8.png

  • Enter parameters (see the sample above).

img_9.png

  • Select an action.

img_10.png

  • Set the message content.

img_11.png

The message content can be adjusted based on the alert policy type.

img_12.png

  • Enable the workflow.

img_13.png

  • Publish it.

img_14.png

DingTalk Bot Configuration

1. Add a bot in the group chat

  • Add a bot in the group chat. img_2.png

  • Select custom service integration via webhook. img_3.png

2. Configure the bot

  • Customize the name.
  • Enable message push.
  • Under Security Settings, choose Custom Keyword. Enter the keyword: Alert Information img_1.png

4. After you click Finish, obtain the webhook URL and configure it as a notification method in the alert policy