I have for some time shared my Unraid System dashboard over at Grafana.com but never really had the time to make a quick write up on how to set it all up. So this will try to do just that. This guide will make it so you will be able to monitor cpu usage, cpu temps, network stats, ram usage and much more by simply importing a dashboard.
How it works
In getting all this setup, there are 3 main moving parts. Telegraf, InfluxDB and Grafana.
Telegraf is what collects all the different system metrics and outputs it to an InfluxDB database that Grafana uses to visualize everything with pretty graphs and bars.
This is a pretty simplified explanation and you can read more here: Telegraf, InfluxDB, Grafana
influxdb in Community Apps and install it using the default template. Select your appdata path and host ports if the default ones are taken.
There is no other setup than just installing the container.
Do the same here, just search for the container in Community Apps and use the default template settings. Set the appdata location to where you want it, but don’t click install just yet!
- Download the file and place it in the location you want the telegraf appdata to be.
The default config file can be downloaded here: https://raw.githubusercontent.com/influxdata/telegraf/master/etc/telegraf.conf
- Next you need to edit the
telegraf.conffile. Go to the location you saved the file and scroll down to
OUTPUT PLUGINSwhich should be around line 90-120.Uncomment (Remove #) the http url line for InfluxDB and the “database” line, like so:
# urls = ["unix:///var/run/influxdb.sock"] # urls = ["udp://127.0.0.1:8089"] urls = ["http://192.168.1.34:8086"]
database = "telegraf" # required
192.168.1.34 is the IP address to my Unraid server and 8086 is the default InfluxDB port that runs the InfluxDB HTTP service.
- Next we need to setup the input plugins. A lot of these are already enabled but we need to add a couple so that all the panels on the Grafana dashboard will work.
- Uncomment the following plugins and lines:
- HDD temps/stats:
- CPU temps:
attributes = true(This is default set to false)
interfaces = ["eth0"]ect
endpoint = "unix:///var/run/docker.sock"
- HDD temps/stats:
- Now go back to the install page of telegraf and add the following into the
Post Argumentsinput field:
/bin/sh -c 'apt update && apt install -y smartmontools && apt install -y lm-sensors && telegraf'
To be able to see this field we need to click on the
This will install
smartmontoolsand without it you won’t be able to get the S.M.A.R.T statistics.
Note: If you also want to add IPMI and nvme stats you can add the following:
/bin/sh -c 'apt update && apt install -y smartmontools && apt install -y lm-sensors && apt install -y nvme-cli && apt install -y ipmitool && telegraf'
/bin/sh -c 'apk update && apk add smartmontools && apk add lm-sensors lm-sensors-detect perl && telegraf'
With IPMI and nvme:
/bin/sh -c 'apk update && apk add smartmontools && apk add lm-sensors lm-sensors-detect perl && apk add nvme-cli && apk add ipmitool && telegraf'
After editing the telegraf.conf and adding the post arguments you can start the Telegraf container. Telegraf will automatically create a database called
telegraf when started for the first time with the influxdb plugin activated.
Installing Grafana is also quite simple. Chose your host port for the webUI and add your unraid URL and admin password to the container settings.
After the installation is finished go to the WebUI. (http://unraidIP:3000) and log in with username
admin and the password you chose. You should then see this on you screen:
Add data source and select InfluxDB.
Next give the data source a name(I named it Telegraf), add the URL to InfluxDB, enter the database to use (telegraf) and set the HTTP Method to POST. This is helpful on some of the more heavy queries.
Grafana will use the default username and password for Influxdb (root root), if you have added a user you will need to add that too.
Next click Save & Test
If all your settings are correct you should see this message.
Next import the dashboard by hovering over the + icon and selecting Import
Paste the dashboard ID 7233 and click Load
Give it a name and UID, select the database in the drop down and click Import.
Next, select the correct values on the menu at the top.
Some assembly needed
You should now already see most of the panels working and displaying stats. But there will be some panels where you need to select some values in the dropdowns at the top. Like Cache Devices.
On the Cache Devices (diskio) dropdown you can select multiple devices, and it will add them to the Cache Read/Write panel.
The Interval text box is the interval that is set in
The default value is 10 seconds, but if you changed this you can update it here.
To update the drive names on the Storage Consumption panel, edit the panel and go to the Field menu. There you will can add the different Value Mappings for the different drive paths. See the video below.
And that’s about it! This should get you going on adding or creating awesome dashboards for you Unraid system. There are tons of different dashboards on grafana.com to get inspiration from. My dashboard is far from the best one out there, so please share your awesome dashboards in the comment section or on Discord!
And if you’re wondering why my Grafana page looks different from the stock theme you can take a look here: https://github.com/gilbN/theme.park
Optional: Adding UPS stats
On the top of my dashboard I have UPS stats, now if you don’t have a UPS (You should by the way) you can just delete those panel. But if you have a UPS that’s compatible with Unraid you can check out this awesome guide: