背景
目前除开使用公司邮箱,不需要使用授权码登录外,像什么QQ邮箱,163邮箱,Sina邮箱等等都需要。几年之前还不用授权码的,可能是他们的安全的重视程度过高了。这篇文章来讲解如何通过qq号实现邮箱告警。
解决
首先把QQ邮箱的SMTP打开。如下图所示:
然后点击 生成授权码:
然后我们来改 alertmanager 的配置
global:
resolve_timeout: 5m
smtp_from: [email protected]
smtp_auth_username: [email protected]
smtp_auth_password: xxxx # 写刚才的授权码
smtp_require_tls: false
smtp_smarthost: 'smtp.qq.com:465'
route:
group_by: ['alertname']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
receiver: 'omsdev.mail'
receivers:
- name: 'omsdev.mail'
email_configs:
- to: [email protected]
send_resolved: true
# 以下其他配置省略
最好看看能不能收到:
OK,能正常收到了。
注意: smtp_auth_password 要写授权码
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END