alertmanager.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. global:
  2. # 在没有报警的情况下声明为已解决的时间
  3. resolve_timeout: 5m
  4. # 配置邮件发送信息
  5. smtp_smarthost: 'smtp.163.com:25'
  6. # 邮箱地址
  7. smtp_from: 'bladejava@163.com'
  8. # 邮箱地址
  9. smtp_auth_username: 'bladejava@163.com'
  10. # 邮箱授权码,需要自行开启设置,非邮箱密码
  11. smtp_auth_password: 'xxxxxxxx'
  12. # 邮箱地址
  13. smtp_hello: 'bladejava@163.com'
  14. smtp_require_tls: false
  15. templates:
  16. # 告警模板文件
  17. - "/etc/alertmanager/templates/wechat.tmpl"
  18. route:
  19. # 接收到告警后到自定义分组
  20. group_by: [ "alertname" ]
  21. # 分组创建后初始化等待时长
  22. group_wait: 10s
  23. # 告警信息发送之前的等待时长
  24. group_interval: 30s
  25. # 重复报警的间隔时长
  26. repeat_interval: 5m
  27. # 默认消息接收
  28. receiver: "wechat"
  29. receivers:
  30. # 微信
  31. - name: "wechat"
  32. wechat_configs:
  33. # 是否发送恢复信息
  34. - send_resolved: true
  35. # 填写应用 AgentId
  36. agent_id: "1000002"
  37. # 填写应用 Secret
  38. api_secret: "jxxxxxxxxxxxxxxxxxxxc"
  39. # 填写企业 ID
  40. corp_id: "wwxxxxxxxxxxx01d"
  41. # 填写接收消息的群体
  42. to_user: "@all"
  43. # 钉钉
  44. - name: 'dingtalk'
  45. webhook_configs:
  46. # prometheus-webhook-dingtalk服务的地址
  47. - url: http://172.30.0.96:8060/dingtalk/webhook_robot/send
  48. send_resolved: true
  49. # 邮件
  50. - name: 'email'
  51. email_configs:
  52. - to: 'your email'
  53. send_resolved: true