PMM3.3.1 in Open Virtual Appliance: Failed to send test alert.: SMTP not configured, check your grafana.ini config file's [SMTP] section

Hi,

My colleague installed PPM 3.3.1 on a OVA (Open Virtual Appliance). I have installed PMM 3.3.1 agents to monitor MongoDB Replica Sets.

We want to test the Alerting functionality in PMM.

When sending a Test mail, we get:

When I log in the OVA VM server with PMM installed, I don’t have the /etc/grafana directory.

In the PMM documentation, only the Alerting via a docker PMM is explained.

Thanks in advance.

Geert

Hi @Geert,

The OVA image for PMM uses podman to deploy the PMM Server container. This can be verifed by viewing the pmm-server Systemd service file.

ExecStart=/usr/bin/podman run \
    --volume /home/admin/volume/srv:/srv \
    --volume /home/admin/.ssh/:/home/pmm/.ssh/ \
    --volume /home/admin/.config/systemd/user/:/home/pmm/update/  \
    --rm --replace=true --name %N \
    --env-file=/home/admin/.config/systemd/user/pmm-server.env \
    --net pmm_default \
    --cap-add=net_admin,net_raw \
    --userns=keep-id:uid=1000,gid=1000 \
    -p 443:8443/tcp --ulimit=host ${PMM_IMAGE}

As you can see in the ExecStart command, the env-file for the container is loaded from /home/admin/.config/systemd/user/pmm-server.env, so you can still follow the steps outlined in the documentation: Contact points - Percona Monitoring and Management

Edit for more complete solution:

After editing the env file /home/admin/.config/systemd/user/pmm-server.env, you can restart the pmm-server service using the following command:

sudo systemctl --user -M admin@ restart pmm-server

We can check if the server is accepting configuration from environment variable by going to the PMM’s Web UI to check the Grafana setting: https://<PMM_IP>/graph/admin/settings

image

If the displayed configuration value is different from the env file, can you check the env file /home/admin/.config/systemd/user/pmm-server.env again, ensure that it does not have any extra characters (like whitespace, tab, etc.) at the end of the offending line?

Hi @hieu.nguyen,

Thanks for the feedback.

I have found the file:

image

But I don’t have/find the pmm-server systemd service file:

image

Thanks in advance,

Geert

Hi @Geert ,

There’s a typo in your systemctl command (ppm-server instead of pmm-server)

Yes, indeed, but

image

Hi @Geert ,

Please try this command:

su - admin
systemctl --user status pmm-server

The PMM systemd unit file is created as a user service, so it won’t be visible by running normal systemctl status … command

You can read more about this on the SystemD manpage: user@.service

Hi @hieu.nguyen,

This is the output:

image

Hi @Geert ,

it seems the su command messes with the user-session and context.

Can you try again with this command:

sudo systemctl --user -M admin@ status pmm-server

Hi @hieu.nguyen,

Hi @Geert ,

That’s great!

Can you try to configure connection to SMTP using the steps in our documentation: Contact points - Percona Monitoring and Management

The env-file in this case would be /home/admin/.config/systemd/user/pmm-server.env

And then we can restart pmm-server using the command:

sudo systemctl --user -M admin@ restart pmm-server

image

Hi @hieu.nguyen,

This log file /srv/logs/grafana.log shows the SMTP variables:

Hi @hieu.nguyen,

I have tested the SMTP part without PMM/Grafana and this is working.

Hi @Geert ,

Can you go to the PMM’s Web UI to check the Grafana setting: https://<PMM_IP>/graph/admin/settings

The config for smtp.enabled should be true

If stmp.enabled is false, can you check the env file /home/admin/.config/systemd/user/pmm-server.env again, ensure that it does not have any extra characters (like whitespace, tab, etc.) at the end?

Hello @hieu.nguyen,

You nailed it. There was a whitespace after the “GF_SMTP_ENABLED=true” in the file /home/admin/.config/systemd/user/pmm-server.env

Thank you very much.

Rgds,

Geert