问题描述
我有以下 alertmanager.yml
可以将警报发送到 Mail 和 Slack 频道。在这里,我收到了有关 slack 的警报,但是我没有在进入 slack 的同时收到电子邮件警报。我的警报管理器容器日志中没有显示错误。
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 单独配置电子邮件是有效的。