天天看点

钉钉APP配置自动告警

钉钉APP群聊可以申请机器人

申请后有webhook

需要在PC客户端申请,APP端暂时还没开权限

申请告警关键字

申请完会有webhook链接

https://oapi.dingtalk.com/robot/send?access_token=值

在云主机上编写shell脚本,以下是测试脚本(脚本中需包含告警关键字

vim test.sh

#!/bin/bash
curl 'https://oapi.dingtalk.com/robot/send?access_token=值' \
 -H 'Content-Type: application/json' \
 -d '{"msgtype": "text","text": {"content":"滴!上班记得打卡!"},"at":{"isAtAll":true}}'
           

加可执行权限

chmod u+x test.sh

可以执行脚本测试一下

./test.sh

00 09 * * 1-6 sh /home/demo/test.sh > /home/demo/test.log 2>&1 &
           

继续阅读