Closed realzyy closed 12 months ago
As the receiver is configured with alarm rules, messages that do not conform to the rules cannot be sent to the receiver. Therefore, it is recommended to send test messages to webhook, slack or email channels to test whether these channels are working. For example,
kbcli alert list-receivers
NAME WEBHOOK EMAIL SLACK CLUSTER SEVERITY
default-receiver
receiver-vrr26 channel=#demo,username=kubeblocks-alert-bot
receiver-4b9dv url=https://open.feishu.cn/open-apis/bot/v2/hook/1061a04f-c8dd-4748-9e54-c48example
# test message to slack
kbcli alert send-test-message --slack='channel=#demo,username=kubeblocks-alert-bot'
# test message to feishu bot
kbcli alert send-test-message --webhook='url=https://open.feishu.cn/open-apis/bot/v2/hook/1061a04f-c8dd-4748-9e54-c48example'
After users add new alert receivers to KubeBlocks, they want to test if the setting works appropriately. Without knowing the default alert events, they can test like this: $ kbcli alert list-receivers NAME WEBHOOK EMAIL SLACK CLUSTER SEVERITY
default-receiver
receiver-plhg9 channel=#kubeblocks-testing,username=KubeBlocksBot
$ kbcli alert test-receiver receiver-plhg9
If anything goes wrong, the users will not receive any messages from robots or webhooks.