【问题标题】:Alertmanager email notification not workingAlertmanager 电子邮件通知不起作用
【发布时间】:2021-01-11 11:52:35
【问题描述】:

我有以下 alertmanager.yml 将警报发送到 Mail 和 Slack 频道。在这里,我收到了关于 slack 的警报,但是我没有在 slack 中同时收到电子邮件警报。我的 alert-manager 容器日志中没有显示错误。

global:
  resolve_timeout: 5m
  smtp_smarthost: 'smtp.server.com:25'
  smtp_from: 'user@company.com'
  http_config:
    tls_config:
      insecure_skip_verify: true
      
route:
  group_wait: 10s
  group_interval: 30s
  repeat_interval: 30m

  # A default receiver
  receiver: "email"

  # All the above attributes are inherited by all child routes and can
  # overwritten on each.
  routes:
    - receiver: "slack"
      group_wait: 10s
      match_re:
        severity: critical|warning
      continue: true

    - receiver: "email"
      group_wait: 10s
      match_re:
        severity: critial
      continue: true

receivers:
  - name: "slack"
    slack_configs:
      - api_url: 'https://hooks.slack.com/services/XXXXXXXXX/XXXXXXXXX/xxxxxxxxxxxxxxxxxxxxxxxxxxx'
        send_resolved: true
        channel: '#monitoring'
        text: "{{ range .Alerts }}<!channel> {{ .Annotations.summary }}\n{{ .Annotations.description }}\n{{ end }}"

  - name: "email"
    email_configs:
      - to: 'reciever@company.com'
        send_resolved: true
        auth_username: 'user@company.com'
        auth_identity: 'user@company.com'
        auth_password: 'password'

但是,根据此链接 Mail notification 的电子邮件单独配置有效。

【问题讨论】:

    标签: prometheus slack email-notifications prometheus-alertmanager


    【解决方案1】:

    如果警报与第一个路由匹配,则不会发送到第二个路由。

    使用Routing tree editor 可视化路由树。

    注意:“严重性:关键”行中有一个错字。

    【讨论】:

    • 感谢 Marcelo.i 在https://blog.ruanbekker.com/blog/2019/05/17/install-alertmanager-to-alert-based-on-metrics-from-prometheus/的帮助下修复了
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-22
    • 2023-03-27
    • 2023-01-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多