alertmanager not sending emails

1,347 views
Skip to first unread message

Shandude

unread,
May 30, 2018, 4:24:58 PM5/30/18
to Prometheus Users
Hi Team

i have issues alertmanager sending emails..below is my sample configs that checks status of "cadvisor" container

prometheus.yml

rule_files:
  - "/opt/alertmanager-0.15.0-rc.1.linux-amd64/rules.yml"

/opt/alertmanager-0.15.0-rc.1.linux-amd64/rules.yml:
ALERT cadvisor_check
  IF up{instance="localhost:8080"}==0
  FOR 5s
  LABELS {
    severity="critical"
  }
  ANNOTATIONS {
  SUMMARY= "Instance {{$labels.instance}} down",
  DESCRIPTION= "Instance= {{$labels.instance}}, Service/Job ={{$labels.job}} is down for more than 5 sec."
  }

alertmanager.yml

global:
  smtp_smarthost: 'localhost:25'
  smtp_from: 'promethe...@abc.com'

templates:
- '/etc/alertmanager/template/*.tmpl'

route:
  group_by: ['job', 'alertname', 'cluster', 'service']

  group_wait: 30s

  # When the first notification was sent, wait 'group_interval' to send a batch
  # of new alerts that started firing for that group.
  group_interval: 5m

  # If an alert has successfully been sent, wait 'repeat_interval' to
  # resend them.
  repeat_interval: 3h

  # A default receiver
  receiver: my-email

  # All the above attributes are inherited by all child routes and can
  # overwritten on each.

  # The child route trees.
  routes:
  # This routes performs a regular expression match on alert labels to
  # catch alerts that are related to a list of services.
  - match:
      severity: critical
    receiver: my-email
    


inhibit_rules:
- source_match:
    severity: 'critical'
  target_match:
    severity: 'warning'
  # Apply inhibition if the alertname is the same.
  equal: ['alertname', 'cluster', 'service']


receivers:
- name: 'my-email'
  email_configs:
  - to: 'my-e...@abc.com'
    require_tls: false

====

when container goes down., i see in the alert manager logs that the alert is becoming "active" and when i start the container it going to state "resolved"
but the problem is i am not getting any emails.,when the alert becomes active

anything wrong with the configurations ? ..pls assist

Simon Pasquier

unread,
May 31, 2018, 3:25:03 AM5/31/18
to Shandude, Prometheus Users
I would run AlertManager with --log.level=debug and dig into the logs.
Please check the logs of the mail server too.


--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/5110625c-1622-4e29-9615-d1e704497c45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages