Prometheus 提醒普罗米修斯经理,它不会';t发送邮件警报

Prometheus 提醒普罗米修斯经理,它不会';t发送邮件警报,prometheus,Prometheus,首先,我在服务器上配置postfix空客户机。它可以成功地发送邮件 我配置Alertmanager: notification_config { name: "alert_test" email_config { email: "abc@gmail.com" } } aggregation_rule { repeat_rate_seconds: 3600 notification_config_name: "alert_test" } 并运行命令

首先,我在服务器上配置postfix空客户机。它可以成功地发送邮件 我配置Alertmanager:

notification_config {
    name: "alert_test"
    email_config {
        email: "abc@gmail.com"
    }
}
aggregation_rule {
  repeat_rate_seconds: 3600
  notification_config_name: "alert_test"
}
并运行命令:

./alertmanager -notification.smtp.smarthost :25 -config.file alertmanager.conf
它显示通知:

ERRO[0002] Error sending email notification: starttls failed: tls: either ServerName or InsecureSkipVerify must be specified in the tls.Config  file=notifier.go line=758

您能帮我修复它吗?

尝试将
-notification.smtp.smarthost
标志设置为
localhost:25
。在这种情况下不会推断主机名。

之后,我配置了Postfix空客户机并拥有帐户root@abc.com,我使用此帐户成功发送邮件。 当我与Alermager prometheus一起使用并使用命令时:

./alertmanager -notification.smtp.smarthost 127.0.0.1:25 -config.file alertmanager.conf
我没有收到邮件警报,它已通知:

> ERRO[0001] Error sending email notification: starttls failed: x509:cannot validate certificate for 127.0.0.1 because it doesn't contain any IP SANs file=notifier.go line=761

如何修复错误,谢谢

看起来您遇到了X.509验证问题

禁用TLS要求,即

#默认SMTP TLS要求。
[smtp_require_tls:|默认值=true]
我尝试了,但它显示“starttsl失败:x509”
# The default SMTP TLS requirement.
[ smtp_require_tls: <bool> | default = true ]