SMTP Settings in PMM Appliance

Hi all,

I am using the PMM appliance on AWS and trying to set up SMTP settings but I cannot for the life of me find out where they are stored or can be changed. There are immutable settings in the web interface but these do not appear to be in /etc/grafana/grafana.ini, the settings page says they can be overridden by custom.ini but I can’t find out where that is and I can’t find any environment variables set.

Does anyone have any idea how this is set up in the appliance? It does not appear to be using Docker.

Thanks in advance,

Hi @davidl
Welcome to the Community!
SMTP settings can be found inside the container of pmm-server. Connect to the container as below:

docker ps
CONTAINER ID   IMAGE                  COMMAND                CREATED          STATUS                    PORTS                                           NAMES
acc4046ec4ba   percona/pmm-server:2   "/opt/entrypoint.sh"   36 minutes ago   Up 36 minutes (healthy)   80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp   pmm-server

docker exec -it pmm-server bash

[root@acc4046ec4ba opt] # cd /etc/grafana/
[root@acc4046ec4ba grafana] # ls
grafana.ini  ldap.toml

In grafana.ini, add the smtp config as below for gmail, for other than gmail, please check with your provider:

enabled=true
host=smtp.gmail.com:587
user=<user@email-id>
password=<app-password>
skip_verify=false
from_address=<from-address@mail-id>
from_name=<Name of the alert, could be any>

Once, done, restart the PMM-Server container with:

docker restart pmm-server

Thanks,
Mukesh

100% what @Mukesh_Kumar said but be careful, your grafana.ini could be replaced by an upgrade of PMM (typically when there’s a significant Grafana upgrade in PMM) so it’s very easy to lose these config settings if you’re not careful. I prefer the cleaner method of upgrading by re-running my docker run command each time with the newest version tag available and at the same time I have all the grafana.ini variables passed in at that point.

docker run -d -p 8443:443 -v /srv:/srv --name pmm-server --restart always -e GF_SMTP_ENABLED=true -e GF_SMTP_HOST=smtp.gmail.com:587 -e GF_SMTP_USER=<your email> -e GF_SMTP_PASSWORD=<password> -e GF_SMTP_SKIP_VERIFY=false -e GF_SMTP_FROM_ADDRESS=<your email> -e GF_SMTP_FROM_NAME=PMM Server -e GF_AUTH_LDAP_ENABLED=true -e GF_AUTH_LDAP_CONFIG_FILE=/srv/grafana/ldap.toml percona/pmm-server:2

As you can see I also override the ldap.toml file location since /srv is a volume mount and the files are stateful (and I like simplified sign-on!)

Steve

1 Like

Hello @davidl,
Check out our documentation on setting up SMTP

Yes, that looks as if it has picked up the settings OK by adding in the smtp section. I just need some real SMTP settings from our infrastructure guys…

The AWS appliance doesn’t seem to use docker so I don’t think the above applies.

ahh…well make a copy of your grafana.ini just to be safe!