Alertmanager告警路由规则设置

global:
  resolve_timeout: 5m
  smtp_smarthost: 'smtp.163.com:25' # 邮箱smtp服务器代理
  smtp_from: 'xxxxxxx@163.com' # 发送邮箱名称
  smtp_auth_username: 'xxxxxx@163.com' # 邮箱名称
  smtp_auth_password: 'xxxxx' # 邮箱密码或授权码
  smtp_require_tls: false
route:
  group_by: ['alertname']
  group_wait: 10s
  group_interval: 10s
  repeat_interval: 1h
  receiver: 'mail'
receivers:
- name: 'mail'
  email_configs:
  - to: 'xxxxxxxx@qq.com'

route:  #默认路由
  group_by: ['instance','job']  
  group_wait: 30s
  group_interval: 5m
  repeat_interval: 4h  #重复告警间隔
  receiver: 'email'  #默认接受者
  routes:  #子路由,不满足子路由的都走默认路由
  - match:  #普通匹配
      severity: critical 
    receiver: leader
  - match_re:  #正则匹配
      severity: ^(warning|critical)$
    receiver: ops

receivers:  #定义三个接受者,和上面三个路由对应
- name: 'email'
  email_configs:
  - to: '13841276@qq.com'
- name: 'leader'
  email_configs:
  - to: '88888@qq.com'
- name: 'ops'
  email_configs:
  - to: 'ops@qq.com'

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin
avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: