July 09, 2021 Guides, Best of the Forum

Unraid Data Monitoring with Prometheus and Grafana

Prometheus

In this installment of the "Best of the Forum" series, let's take a look at how to set up Prometheus and Grafana on your Unraid server for feature-rich metrics dashboards and data visualizations.

This guide will get you set up with the base Prometheus Node Exporter which will further allow users to create custom Dashboards and the monitoring of custom setups such as the Nvidia Driver plugin, Pihole, and local PC and VM monitoring, all self-hosted on Unraid!

A big thanks goes to ich777 for writing up these guides and for helping other users get these going!

Guide

1. Go to Community Apps (CA) and download the Grafana Docker container. Be sure to input your server's IP or hostname in the Key1 section when first setting up the container:

1 png d735eded5d0151c1b73cd2be90c1a3f7

2. Download the Prometheus Docker container from CA. Note: The docker will be stopped after the installation and will be fixed in the next steps:

2 png 946cb68e998fa387165974e6909fda24

3. Download and install the Prometheus Node Exporter plugin from CA:

3 png 69039980217d7c38ba68037b059f04be

4. Download the 'prometheus.yml' and place it in your '.../appdata/prometheus/etc' directory on your Unraid server:

prometheus.yml

4 png 96cc50fa9c18f39aa67e9d2a66f00bc9

5. Open the prometheus.yml and edit the 'YOURUNRAIDSERVERIP' part so that it matches your server's IP and save and close the file:

Grafik png ee3b0e0cdd69c0a7ef1721c2371cada3

6. Go to your Docker page and start the Prometheus Docker container.

7. After it is started, click the Prometheus container again and select WebUI:

7 png 96d2375e264b0313b8c1f410eb29b73a

8. On the top click on "Status -> Targets":

8 png 53aaa38b26d15f1a8735b001352c5402

9. You should see now a list with two entries, the entry "YOURSERVERIP:9100" should display "UP" like in the following screenshot:

9 png 6cb1c5ad75be767ef685b93643650703

10. Go to the Docker page, start the Grafana WebUI and log in with your Username and Password (default: admin | admin):

11 png 1923b8680f4a963a9803bea601b30b22

11. If you left it at default you should change the password in the next screen to something secure:

Screen Shot 2021 07 09 at 2 43 51 PM

12. Next we are going to configure the Prometheus data source in Grafana by clicking on the "Gear Icon -> Data sources":

13 png faa6e420d69e14ce1a8d3948196cbb7e

13. Click on "Add data source" and at Prometheus click on "Select":

15 png 6ac103a0ad48ff850563cb05c24db04c

14. In the next screen enter the IP and Port from your Prometheus container like this:

17 png 947086221b2746ede69849179817b8d8

15. At the bottom click on "Save & Test" and you should see this message:

19 png 09cbf0e153c2d60239fac03e81d16b16

16. In Grafana click on "+ -> Import":

20 png c0d39ddfa4a702aeb79d1e655626e47e

17. Now we are going to import a pre-configured Dashboard for the Node Exporter from Grafana.com (Source). To do this, simply enter the ID from the Dashboard and click "Load":

21 png 772dec12d4c9af8e71e9ccf81aa0702e

If you find these guides useful...

please consider donating to ich777 for this and all of his other hard work!

18. In the next screen be sure to select "Prometheus" as the data source and rename the Dashboard to your liking and click Import.

22 png 7ad439aa8b1279aed32eb2cc42890d08

Now, you should be greeted with something like this:

24 thumb png 5ab37e17649af4054d3c766fd0793c15

Keep in mind that the Dashboard can display N/A values since there is not enough data available. Wait a few minutes and you will see that the values begin to fill in. Also, please also keep in mind that some values will not be filled at all because by default Unraid doesn't have a SWAP, for example.

Would you like to set up Custom Dashboards?

See here for setting up customizable ones from templates!

Prometheus nvidia-smi Exporter

If you would like a dashboard to pair with the Nvidia-driver plugin to track your GPU, encoding, and more, please see here for a setup guide.

48 png af6648f851b2b9e78bd402bfd6e66ff4

If you find these guides useful...

please consider donating to ich777 for this and all of his other hard work!

Prometheus PiHole Exporter

If you use Pihole, set up a dashboard to track those blocked ads here!

42 png 2f1917b196ff4f0fe7b1d5ac527be21a

Do you have a cool dashboard to share?

Need help? Head to the Unraid forums ->