【问题标题】:Grafana alerts test notification sent but no email has been receivedGrafana 警报测试通知已发送,但未收到电子邮件
【发布时间】:2018-12-14 23:55:00
【问题描述】:

我想测试 Grafana 警报。我想在有警报时收到电子邮件。所以首先我在 grafana.ini 文件中设置了 SMTP:

#################################### SMTP / Emailing##########################
[smtp]
enabled = true
host = localhost:25 
user = 
# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
password = 
;cert_file =
;key_file =
skip_verify = true
from_address = admin@grafana.localhost
from_name = Grafana

[emails]
;welcome_email_on_sign_up = false

在 Grafana 中的测试中,我设置了名称,类型:电子邮件,发送所有警报,包括图像。 我的电子邮件在 hotmail 上。

当我按下发送测试时,我收到发送的测试通知,但没有收到电子邮件...

这是日志:

t=2018-07-06T11:09:54+0000 lvl=eror msg="can't read datasource provisioning files from directory" logger=provisioning.datasources path=/etc/grafana/provisioning/datasources
t=2018-07-06T11:09:54+0000 lvl=info msg="Initializing RenderingService" logger=server
t=2018-07-06T11:09:54+0000 lvl=info msg="Initializing TracingService" logger=server
t=2018-07-06T11:09:54+0000 lvl=info msg="Initializing Stream Manager"
t=2018-07-06T11:09:54+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=
t=2018-07-06T11:09:54+0000 lvl=eror msg="can't read dashboard provisioning files from directory" logger=provisioning.dashboard path=/etc/grafana/provisioning/dashboards
t=2018-07-06T11:09:57+0000 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[myEmail@gmail.com]
t=2018-07-06T11:09:57+0000 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[myEmail@gmail.com]
t=2018-07-06T11:10:26+0000 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[myEmail@hotmail.com]
t=2018-07-06T11:10:27+0000 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[myEmail@hotmail.com]
t=2018-07-06T11:12:31+0000 lvl=info msg="Sending alert notification to" logger=alerting.notifier.email addresses=[myEmail@hotmail.com]

我也用gmail测试过,也是一样。

【问题讨论】:

    标签: smtp grafana


    【解决方案1】:

    您是否有 SMTP 服务器在 localhost 端口 25 上进行侦听?如果没有,您需要运行一个或为 Grafana 使用有效的 SMTP 配置。如果是,则需要检查邮件服务器日志以了解它对电子邮件的处理方式。

    【讨论】:

    • 您的意思是:还是为 Grafana 使用有效的 SMTP 配置?关于日志,我已经贴出来了。
    • Grafana 不是邮件服务器,它需要能够通过 SMTP 向邮件服务器发送电子邮件。您的 Grafana 配置在 [smtp] 部分中有 host = localhost:25,这意味着 Grafana 将尝试向在本地计算机上侦听端口 25 的邮件服务器发送电子邮件。
    • 启用 Grafana 发送电子邮件的最简单方法是将其配置为使用外部 SMTP 服务器,对于每月少于 10000 封电子邮件,您可以免费使用mailgun.com
    • 感谢 cmets! Mailgun 是免费的,但仅向未授权的电子邮件发送电子邮件。如果电子邮件被授权,我需要升级我的帐户......你知道任何其他解决方案吗?听说过Postfix,好用吗?
    • @xmlParser 后缀是一种流行的邮件服务器,但运行邮件服务器是一项不平凡的练习,绝对超出了您的问题范围。我不知道 mailgun 有任何限制将免费帐户限制为授权收件人。 documentation.mailgun.com/en/latest/…
    猜你喜欢
    • 2014-07-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-21
    • 2012-02-28
    • 2019-07-16
    • 2018-11-27
    相关资源
    最近更新 更多