参考:https://github.com/prometheus/alertmanager/issues/384
参考: https://github.com/easzlab/kubeasz/issues/448
使用QQ邮箱来发送,端口要使用587,465不行的
alertmanager配置:
/alertmanager $ cat /etc/alertmanager/alertmanager.yml
global:
resolve_timeout: 5m
smtp_smarthost: 'smtp.qq.com:587'
smtp_from: '5*******@qq.com'
smtp_auth_username: '5*******@qq.com'
smtp_auth_password: 'erievfvxwbvkiqio'
route:
group_by: ['alertname']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
receiver: 'wang'
receivers:
- name: 'wang'
email_configs:
- to: wanghaha@tech.io
send_resolved: true
require_tls: true
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname', 'dev', 'instance']
邮件截图