天天看點

釘釘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 &
           

繼續閱讀