【问题标题】:SMTP not configured, check your grafana.ini config file's [smtp] section未配置 SMTP,请检查您的 grafana.ini 配置文件的 [smtp] 部分
【发布时间】:2020-11-26 07:46:27
【问题描述】:

对于通知,我在 Grafana 中添加了通知通道,类型为电子邮件,然后单击“发送测试”按钮,但它给出了 -

SMTP not configured, check your grafana.ini config file's [smtp] section

我已将 Grafana 安装为 docker 容器,因此我进入容器并使用 SMTP 详细信息更新了 grafana.ini 文件并反映更改,使用 -

重新启动 Grafana
docker restart grafana

现在转到通知通道并单击“发送测试”,但仍然看到相同的错误。

请帮助了解这里可能出了什么问题,以及哪个日志文件(带有位置)来检查这里到底出了什么问题。

【问题讨论】:

标签: docker grafana grafana-alerts


【解决方案1】:

我进入容器并使用 SMTP 详细信息更新了 grafana.ini 文件并反映更改

这不是容器的正确配置。使用环境变量。

【讨论】:

【解决方案2】:
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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-04-01
    • 2012-12-24
    • 1970-01-01
    • 2017-10-03
    • 1970-01-01
    • 2019-12-09
    • 2021-07-07
    • 1970-01-01
    相关资源
    最近更新 更多