Alertmanager 电子邮件通知不起作用

Alertmanager email notification not working

我有以下 alertmanager.yml 将警报发送到 Mail 和 Slack 频道。在这里,我在松弛时收到警报,但在松弛时我没有同时收到电子邮件警报。我的警报管理器容器日志中没有显示任何错误。

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'

然而,根据此 link Mail notification 单独配置电子邮件是可行的。

如果警报与第一条路线匹配,则不会将其发送到第二条路线。

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

注意:“严重性:严重”行中有错字。