配置alertmanager的时候,都是根据网上的教程来配置的。服务器
由于我是用QQ邮箱来发送告警的,因此alertmanager.yml的邮箱配置以下:ui
global:
resolve_timeout: 5m
smtp_smarthost: 'smtp.qq.com:465'
smtp_from: 'xxxxxx@qq.com'
smtp_auth_username: 'xxxxxx@qq.com'
smtp_auth_password: 'xxxxxxxxxx'
smtp_require_tls: falsespa
注意事项:教程
1.须要先登陆QQ邮箱,开通smtp功能,并获取受权码。smtp_auth_password填写的信息,就是受权码,而非QQ邮箱的登陆密码!ip
2.smtp.qq.com:465 ,端口使用465。其余资料说用587端口也能够。(若是是云服务器,25端口一般是被服务商封闭的,全部也不能使用25端口)get
报错信息:it
msg="Notify for alerts failed" num_alerts=1 err="*notify.loginAuth failed: 530 Must issue a STARTTLS command first."登录
3.smtp_require_tls: false 必须加上,由于smtp_require_tls默认为true。require
alertmanager主要处理流程(引用:https://www.kancloud.cn/huyipow/prometheus/527563,对alertmanager作了很全面到位的解释)tls