Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
876 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: '[email protected]'
  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: '[email protected]'
        send_resolved: true
        auth_username: '[email protected]'
        auth_identity: '[email protected]'
        auth_password: 'password'

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


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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...