【发布时间】:2021-01-11 11:52:35
【问题描述】:
我有以下 alertmanager.yml 将警报发送到 Mail 和 Slack 频道。在这里,我收到了关于 slack 的警报,但是我没有在 slack 中同时收到电子邮件警报。我的 alert-manager 容器日志中没有显示错误。
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'
但是,根据此链接 Mail notification 的电子邮件单独配置有效。
【问题讨论】:
标签: prometheus slack email-notifications prometheus-alertmanager