AlertManager在Openshift中运行时不能发送邮件(错误:getsockopt:连接超时)
问题描述:
我有Alertmanager和Prometheus在Openshift中运行。 Alertmanager接收和显示来自普罗米修斯的警报,但与任何SMTP服务器发送时,它(我使用Gmail现在但我想其他人),我收到以下错误:AlertManager在Openshift中运行时不能发送邮件(错误:getsockopt:连接超时)
time="2017-05-30T08:47:21Z" level=error msg="Notify for 1 alerts failed: dial tcp 74.125.206.109:587: getsockopt: connection timed out" source="dispatch.go:261"
我有一个config.yml
其工作时,我通过alertmanager和prometheus在本地尝试。我收到了电子邮件提醒,所以我不明白为什么它在Openshift中运行时不起作用。我用完了想法。
我的配置文件:
global:
smtp_smarthost: 'smtp.gmail.com:587'
smtp_from: '[email protected]'
smtp_auth_username: '[email protected]'
smtp_auth_password: 'ABCD1234'
templates:
- '/etc/alertmanager/template/*.tmpl'
group_by: ['alertname', 'cluster', 'service']
group_wait: 1m
group_interval: 1m
repeat_interval: 1m
receiver: team-X-mails
routes:
- match:
severity: page
receiver: team-X-mails
receivers:
- name: 'team-X-mails'
email_configs:
- to: '[email protected]'
答
解决。问题在于防火墙配置阻止了传出的请求。