Question
How to monitor several Plesk Servers with Grafana extension?
Answer
Installing Grafana
First it is needed to deploy new separate Grafana service where you will add and monitor all your Plesk instances, because Grafana installed by Plesk locked and cannot be edited:
- It can be deployed using Docker image in Plesk. It is needed to add the below variable to Docker image:
GF_INSTALL_PLUGINS=grafana-simple-json-datasource
- Or deploy manually using official installation guide.
Getting URL for the Data Source
- URL for the data source has the below format:
https://hostname:8443/modules/monitoring/public/index.php/AUTH_TOKEN
- To get AUTH_TOKEN execute the below command in SSH:
# plesk db “Select value from ModuleSettings Where name = ‘rrd_api_auth_token'”
+——————————————+
| value                  |
+——————————————+
| kw7HoLcSGZ5O4KdRURm8lcC_hYmYA5IipvCRBbCs |
+——————————————+
- As a result the URL for the data source will looks like this:
https://hostname:8443/modules/monitoring/public/index.php/kw7HoLcSGZ5O4KdRURm8lcC_hYmYA5IipvCRBbCs
Adding Data Source to Grafana
1. On your Grafana installation got to Configuration > Data Sources and click on Add data source.
-
On the next screen type to find “SimpleJSON”. Click on it.
-
Fill “Name”, and then “URL” we generated on previous step.
Note: If your Plesk UI is not secured with valid certificate please enable “Skip TLS verify”
Adding reports
That’s it! Now you can create reports using metrics from Plesk on Grafana Dahsboards. Below is an example how to create report to monitor memory usage: