Greetings,
I’m trying to configure a mail alert with grafana, but I’m facing an issue: the SMTP is not being configured (note: in the following sections I have put a dot in each link between square brackets to prevent it being detected as link and then blocked - just ignore those [ ]).
What I tried
- In the file /etc/environment I have set the following variables:
GF_SMTP_HOST=smtp.xxx[.]net
GF_SMTP_USER=xxx@xxx[.]net
GF_SMTP_PASSWORD=xxx
GF_SMTP_FROM_ADDRESS=xxx@xxx[.]net
GF_SMTP_FROM_NAME=Monitor
GF_SMTP_SKIP_VERIFY=true - In the deployment yaml:
env:
- name: GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH
value: /var/lib/grafana/dashboards/network-dashboard.json
- name: GF_INSTALL_PLUGINS
value: https:[//]grafana[.]com/api/plugins/gowee-traceroutemap-panel/versions/0.2.3/download;gowee-traceroutemap-panel
- name: GF_SMTP_ENABLED
value: “true”
- name: GF_SMTP_HOST
value: smtp.xxx[.]net
- name: GF_SMTP_USER
value: xxx@xxx[.]net
- name: GF_SMTP_PASSWORD
value: xxx
- name: GF_SMTP_FROM_ADDRESS
value: xxx@xxx[.]net
- name: GF_SMTP_FROM_NAME
value: Monitor
- name: GF_SMTP_SKIP_VERIFY
value: “true” - When running it on docker (with a make file)
@docker run --network host -v “$(PWD)/docker-compose/grafana:/app” --rm curlimages/curl:7.73.0
-s --location -XPOST ‘http:[//]admin:admin@127.0.0.1:3000/api/datasources’
-e “GF_SMTP_ENABLED=true”
-e “GF_SMTP_HOST=smtp.xxx[.]net”
-e “GF_SMTP_USER=xxx@xxx[.]net”
-e “GF_SMTP_PASSWORD=xxx”
-e “GF_SMTP_FROM_ADDRESS=xxx@xxx[.]net”
-e “GF_SMTP_FROM_NAME=Monitor”
-e “GF_SMTP_SKIP_VERIFY=true”
–header ‘Content-Type: application/json’ -d @/app/datasource.json > /dev/null - In the /etc/grafana/grafana.ini’s smtp section:
[smtp]
enabled = true
host = smtp.xxx[.]net
user = xxx@xxx[.]net
password = xxx
;cert_file =
;key_file =
skip_verify = true
from_address = xxx@xxx.[.]net
from_name = Monitor
;ehlo_identity = dashboard.example[.]com
;startTLS_policy = NoStartTLS
What I expected
- To be able to send a test email in the alert section
- To view my configuration in the grafana’s /admin/settings section
What actually happened
- I get this error while trying to send a test email: “SMTP not configured, check your grafana.ini config file’s [smtp] section”
- The /admin/settings section has the default configuration
Question
Am I missing something? It seems that grafana does not load the configuration, even if I tried several different methods. I even tried a few times to reboot the computer and reset kubernetes.
Thank you for any help or suggestion