【问题标题】:Alertmanager prometheus, It doesn't sent mail alertAlertmanager prometheus,它不发送邮件警报
【发布时间】:2016-03-15 23:42:01
【问题描述】:

首先,我在服务器上配置 postfix null-client。它可以发送邮件成功 我配置 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

你能帮我解决它吗?

【问题讨论】:

    标签: prometheus


    【解决方案1】:

    您似乎遇到了 X.509 验证问题。

    禁用 TLS 要求,即turned on by default

    # The default SMTP TLS requirement.
    [ smtp_require_tls: <bool> | default = true ]
    

    【讨论】:

      【解决方案2】:

      之后,我配置了 Postfix null-client 并拥有账户 root@abc.com,我使用这个账户发送邮件成功。 当我与alermanager 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
      

      如何解决错误,谢谢!

      【讨论】:

        【解决方案3】:

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

        【讨论】:

        • 我试了,但是显示“starttsl failed: x509”
        猜你喜欢
        • 2022-07-13
        • 2022-01-16
        • 2019-06-21
        • 2019-07-20
        • 1970-01-01
        • 2018-12-31
        • 1970-01-01
        • 2020-04-15
        • 2021-12-11
        相关资源
        最近更新 更多