Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
883 views
in Technique[技术] by (71.8m points)

prometheus - Alertmanager email notification not working

I have the below alertmanager.yml to send the alerts to Mail and Slack channel. Here i am getting alerts on slack, But i am not getting email alerts same time while getting in slack. There is no error shown in my alert-manager container log.

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 }}
{{ .Annotations.description }}
{{ 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'

However email alone configuration as per this link Mail notification works.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

If an alert matches the first route it won't be sent to the second route.

Use the Routing tree editor to visualize the routing tree.

Note: there's a typo in the "severity: critial" line.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...