Question
How to monitor several Plesk servers with Grafana extension?
Answer
I. Installing Grafana
First, deploy a new separate Grafana service where you will add your Plesk instances and monitor them (Grafana installed by Plesk is locked and cannot be edited). Use one of the following ways:
-
Deploy Grafana using a Docker image in Plesk. It is needed to add the following variable to a Docker image:
GF_INSTALL_PLUGINS=grafana-simple-json-datasource
-
Deploy Grafana manually using official Grafana installation guide.
II. Getting URL for the Data Source
URL for the data source has the following format:
https://hostname:8443/modules/monitoring/public/index.php/AUTH_TOKEN
To get AUTH_TOKEN
, follow these steps:
-
Connect to the Plesk server via SSH.
-
Get
AUTH_TOKEN
:# sqlite3 /usr/local/psa/var/modules/monitoring/monitoring.sqlite3 "SELECT value FROM params WHERE name = 'rrd_api_auth_token'"
NyuIz_uQ8oZ6SKw31eSCxNt-KAWDlQ8e6VScvyqt
-
Put
AUTH_TOKEN
into the URL:https://hostname:8443/modules/monitoring/public/index.php/NyuIz_uQ8oZ6SKw31eSCxNt-KAWDlQ8e6VScvyqt
III. Adding Data Source to Grafana
-
In your Grafana installation, go to Configuration > Data Sources and click on Add data source.
-
On the next screen, type to find "SimpleJSON". Click on it.
-
Fill in Name and URL generated on previous step.
Note: If your Plesk UI is not secured with a valid SSL certificate, enable Skip TLS verify.
IV. Adding reports
That's it! Now you can create reports using metrics from Plesk on Grafana Dahsboards. Below is an example of how to create a report to monitor memory usage: