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'
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:
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