对于通知,我在 Grafana 中添加了通知 channel ,类型为电子邮件,然后单击“发送测试”按钮,但它给出了 -
SMTP not configured, check your grafana.ini config file's [smtp] section
我已经将 Grafana 安装为 docker 容器,因此我进入容器并使用 SMTP 详细信息更新 grafana.ini
文件并反射(reflect)更改,重新启动 Grafana -
docker restart grafana
现在转到通知 channel 并单击“发送测试”,但仍然看到相同的错误。
请帮助理解这里可能出了什么问题,以及哪个日志文件(带有位置)来检查这里究竟出了什么问题。
最佳答案
All options in the configuration file can be overridden using environment variables using the syntax:
GF_<SectionName>_<KeyName>
Where the section name is the text within the brackets. Everything should be uppercase, . and - should be replaced by _. For example, if you have these configuration settings:
# default section
instance_name = ${HOSTNAME}
[security]
admin_user = admin
[auth.google]
client_secret = 0ldS3cretKey
[plugin.grafana-image-renderer]
rendering_ignore_https_errors = true
You can override them on Linux machines with:
export GF_DEFAULT_INSTANCE_NAME=my-instance
export GF_SECURITY_ADMIN_USER=owner
export GF_AUTH_GOOGLE_CLIENT_SECRET=newS3cretKey
export GF_PLUGIN_GRAFANA_IMAGE_RENDERER_RENDERING_IGNORE_HTTPS_ERRORS=true
引用:https://grafana.com/docs/grafana/latest/administration/configuration/#configure-with-environment-variables
关于docker - SMTP 未配置,请检查您的 grafana.ini 配置文件的 [smtp] 部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63276937/