我想测试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测试过了,
答案 0 :(得分:1)
您是否有SMTP服务器在本地主机端口25上侦听?如果没有,您将需要运行一个或为Grafana使用有效的SMTP配置。如果是这样,则需要检查邮件服务器日志以查看其对电子邮件的作用。