docker钉钉告警

0.相关包下载

https://github.com/timonwong/prometheus-webhook-dingtalk
https://hub.docker.com/r/timonwong/prometheus-webhook-dingtalk

1.拉取地址

docker pull timonwong/prometheus-webhook-dingtalk:latest
docker pull prom/alertmanager:latest

2.webhook部署

docker run -d -p 18060:8060 --name webhook timonwong/prometheus-webhook-dingtalk:latest \
--ding.profile="webhook1=https://oapi.dingtalk.com/robot/send?access_token=9e695a464b80833859b02de165a52b107108eef4d0601ce4c94faa29b429118e"
--ding.profile="webhook1=https://oapi.dingtalk.com/robot/send?access_token={替换成自己的dingding token}

3.alertmanager部署

docker run -d --name alertmanager -p 9093:9093 -v  /etc/localtime:/etc/localtime:ro -v /monit/alertmanager.yml:/etc/alertmanager/alertmanager.yml prom/alertmanager:latest

4.alertmanager配置文件
alertmanager.yml

global:
  resolve_timeout: 2m
route:
  receiver: webhook
  group_wait: 30s
  group_interval: 2m
  repeat_interval: 2m
  group_by: [alertname]
  routes:
  - receiver: webhook
    group_wait: 10s
receivers:
- name: webhook
  webhook_configs:
  - url: http://10.98.2.200:18060/dingtalk/webhook1/send  
    send_resolved: true

5.登录钉钉配置必须要写上这些东西,因为是别的钉钉模板
docker钉钉告警_第1张图片
添加了如下关键字:alert、promethues、alertmanager、webhook

你可能感兴趣的:(Prometheus)