全部文章索引:http://www.javashuo.com/article/p-bedpreph-nu.htmlgit
curl 'https://oapi.dingtalk.com/robot/send?access_token=******' -H 'Content-Type: application/json' -d '{"msgtype": "text","text": {"content": "我就是我, 是不同的煙火"}}'
GitHub地址:https://github.com/timonwong/prometheus-webhook-dingtalkgithub
docker pull timonwong/prometheus-webhook-dingtalk:latest docker run -d --restart always -p 8060:8060 timonwong/prometheus-webhook-dingtalk:latest --ding.profile="webhook1=https://oapi.dingtalk.com/robot/send?access_token=******"
[root@localhost alertmanager]# cat alertmanager.yml global: resolve_timeout: 5m smtp_smarthost: 'smtp.163.com:25' smtp_from: '******@163.com' smtp_auth_username: '******@163.com' smtp_auth_password: '******' route: group_by: ['alertname'] group_wait: 10s # 報警觸發等待時間 group_interval: 1m # 報警觸發時間 repeat_interval: 5m # 輪詢報警觸發時間 receiver: jsb # 接收方 routes: - receiver: jsb group_wait: 10s group_interval: 1m repeat_interval: 5m receivers: - name: 'jsb' email_configs: - to: "*****@qq.com, ******@163.com" webhook_configs: # 能夠在另寫一個 receiver_name ,而後進行匹配,爲了同時驗證效果寫在一個 name 下邊,這樣郵件和釘釘能夠同時觸發 - url: http://192.168.202.239:8060/dingtalk/webhook1/send send_resolved: true systemctl restart alertmanager.service