#!/bin/bash
content=$1
content=${content//\ /}
content=${content//\"/}
time3=$(date "+%H:%M:%S")
content="$time3,$content"
echo "warn content is : $content"
#飞书机器人webhook 地址
api=https://open.feishu.cn/open-apis/bot/v2/hook/58298exxxxxxxxxxxxxxxxxxxxxx
curl -X POST \
$api \
-H 'Content-Type: application/json' \
-d '{
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "WGCLOUD告警",
"content": [
[
{
"tag": "text",
"text": "'$content'"
}
],
[
]
]
}
}
}
}'
保存后加权限 chmod +x
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容