标签:mamicode ati host yml 展示 ofo alt 在服务器 rtm
Alertmanager 同时触发邮件报警和钉钉报警所有文章索引:https://blog.51cto.com/liujingyu/2541908
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-dingtalk
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
(五)Prometheus监控思科交换机 ---Alertmanager 钉钉报警展示
标签:mamicode ati host yml 展示 ofo alt 在服务器 rtm
原文地址:https://blog.51cto.com/liujingyu/2542209