Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[VIDEO GUIDE] Using Telegraf to Monitor Unraid

Featured Replies

All the guides I've come by were outdated, this took a bit to figure out, but I got everything mostly working. I'd love any suggestions to improve this setup if y'all have any.

 

Assumptions

This assumes you already have Grafana and InfluxDB 2 setup. These are super simple to setup just by searching the applications in the Unraid UI. Generally, these don't require any special configurations or changes.

 

Add your configuration

Before we add our Telegraf container we need to add our configuration. In this example we are placing it the default directory for Docker configurations on Unraid. Change anything here to better fit your setup. When working with my appdata directory in Unraid I generally use the Dynamix File Manager it's an awesome tool that makes navigating shares in the Unraid UI easy.

 

First download the telegraf.conf file located in my repository and make any changes you'd like. Most everything the configuration should work as-is* Unraid, but you will need to edit the outputs plugin information to properly send data to your InfluxDB 2 bucket. Note: Use a new bucket specifically for this Unraid instance.

*I'm still trying to figure out how to get smart monitoring to work.

 

[[outputs.influxdb_v2]]
  urls = ["http://ip:8086"]
  token = "yourtoken"
  organization = "yourorg"
  bucket = "unraidbucket"

 

In your appdata directory on Unraid make a new folder called telegraf. Within your telegraf folder upload the edited telegraf.conf file. The file path will look like this if you're following the default Unraid setup. 

 

/mnt/user/appdata/telegraf/telegraf.conf

 

Setting up the container

Use the official Telegraf container from the Applications page. We will be using the golift/telegraf in replacment of the office image as it includes some packages needed for full monitoring of the hardware.

 

Change the following

Repository: golift/telegraf

Registry URL: https://hub.docker.com/golift/telegraf

 

This container provides a telegraf docker image with added tools for monitoring disks, sensors, and IPMI. This exists because the base telegraf Docker image makes it very difficult to monitor some system metrics. Applications added: smartctl (smartmontools), ipmitool, nvme-cli, sensors (lm-sensors), mtr (mtr-tiny), sudo. Sudoers entries are added for smartctl, ipmitool and nvme.

 

Add the following

Extra Parameters: /bin/bash -c "/entrypoint.sh telegraf"

Extra Argument: --user telegraf:$(stat -c '%g' /var/run/docker.sock)

 

Start and verify

Other than these adjustments everything should be able to be left as is included in the template. Check over everything and click on apply. Go to your Docker page in Unraid and check to see if the container is running. Check the log files to ensure there are no issues and that all the plugins are properly active.

 

If there are no issues, we check to see if the data is being properly exported to InfluxDB 2. Head over to your dashboard and open the bucket you created for Unraid. It should look like the picture below. Go through the data make sure nothing is missing. In my installation I have 7 tags for Docker data under the _messurements ID and another tag for every plugin I have enabled.

 

unraid-data-preview.png?raw=true

 

Grafana Dashboard

This guide is part of a larger video where I highlight the entire setup the embedded video starts at 26:52, when I add the data source in Grafana and use an awesome dashboard to monitor Unraid.

 

Unraid System Dashboard V2 (InfluxQL) - 7233

 

 

Edited by TechHut

  • TechHut changed the title to [VIDEO GUIDE] Using Telegraf to Monitor Unraid

Thanks for sharing.

 

Seems the Docker UI isn't running the correct docker run comman:

Command execution

docker run
  -d
  --name='telegraf'
  --net='host'
  -e TZ="America/Los_Angeles"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="[REDACTED]"
  -e HOST_CONTAINERNAME="telegraf"
  -e 'HOST_PROC'='/rootfs/proc'
  -e 'HOST_SYS'='/rootfs/sys'
  -e 'HOST_ETC'='/rootfs/etc'
  -e 'HOST_MOUNT_PREFIX'='/rootfs'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://github.com/atribe/unRAID-docker/raw/master/icons/telegraf.png'
  -v '/var/run/utmp':'/var/run/utmp':'ro'
  -v '/var/run/docker.sock':'/var/run/docker.sock':'ro'
  -v '/':'/rootfs':'ro'
  -v '/sys':'/rootfs/sys':'ro'
  -v '/etc':'/rootfs/etc':'ro'
  -v '/proc':'/rootfs/proc':'ro'
  -v '/mnt/user/appdata/telegraf/telegraf.conf':'/etc/telegraf/telegraf.conf':'rw'
  -v '/run/udev':'/run/udev':'ro' /bin/bash
  -c "/entrypoint.sh telegraf" 'golift/telegraf'
  --user telegraf:$(stat
  -c '%g' /var/run/docker.sock)

docker: invalid reference format.
See 'docker run --help'.

The command failed.

 

Edited by StylishQuoter

I'm running a very similar setup to yours, but the main thing I'm still missing is monitoring how much each container reads/write onto the filesystem. Did you figure out how to get that?

  • 2 weeks later...

Thanks for the guide! Like others most of what's available out there at this moment is out of date, including the all-in-one container (GUS) which no longer works.

 

I did resolve a few speed-bumps in the instructions; including how to resolve the invalid reference format error as mentioned above, along with getting SMART monitoring working.

 

So for this one (which I ran into as well):

 

docker: invalid reference format.
See 'docker run --help'.

The command failed.

 

I watched TechHut's video alongside the instructions, the video had it correct but the instructions just have them flipped.

 

Original instructions were:

Add the following
Extra Parameters: /bin/bash -c "/entrypoint.sh telegraf"
Extra Argument: --user telegraf:$(stat -c '%g' /var/run/docker.sock)

 

It should be (or at least worked for me):

Add the following
Extra Parameters: --user telegraf:$(stat -c '%g' /var/run/docker.sock)
Post Argument: /bin/bash -c "/entrypoint.sh telegraf"

 

And for SMART queries and telemetry to work, I looked up some documentation and within the 'telegraph.conf' file, I had to add "use_sudo = true" which I discovered from a Reddit post.  Though I now get HDD disk temps and SMART information, the historical view for temperature over 6 hours isn't working for me ("Drive SMART Temps - Last 6 hours", still trying to figure that out.

[[inputs.smart]]
  attributes = true
  use_sudo = true

 

Edited by Photek

  • 3 weeks later...

I'm having two issues getting Telegraf to run:

 

I'm getting the following error when starting the container:
"2024-08-06T16:15:59Z E! [telegraf] Error running agent: could not initialize input inputs.smart: smartctl not found: verify that smartctl is installed and it is in your PATH (or specified in config): provided path does not exist: []"

 

Seems like the golift/telegraf container no longer exists.  I get a 404 when trying to visit the Docker Hub page (https://hub.docker.com/golift/telegraf)

1 hour ago, drsparks68 said:

I'm having two issues getting Telegraf to run:

 

I'm getting the following error when starting the container:
"2024-08-06T16:15:59Z E! [telegraf] Error running agent: could not initialize input inputs.smart: smartctl not found: verify that smartctl is installed and it is in your PATH (or specified in config): provided path does not exist: []"

 

Seems like the golift/telegraf container no longer exists.  I get a 404 when trying to visit the Docker Hub page (https://hub.docker.com/golift/telegraf)

Seems like the docker hub URL for the telegraf container changed: https://hub.docker.com/r/golift/telegraf

  • 3 weeks later...

Thanks for including these corrections and the sudo=true. Everything got up and running for me smoothly.

 

 

On 7/22/2024 at 8:40 AM, Photek said:

Thanks for the guide! Like others most of what's available out there at this moment is out of date, including the all-in-one container (GUS) which no longer works.

 

I did resolve a few speed-bumps in the instructions; including how to resolve the invalid reference format error as mentioned above, along with getting SMART monitoring working.

 

So for this one (which I ran into as well):

 

docker: invalid reference format.
See 'docker run --help'.

The command failed.

 

I watched TechHut's video alongside the instructions, the video had it correct but the instructions just have them flipped.

 

Original instructions were:

Add the following
Extra Parameters: /bin/bash -c "/entrypoint.sh telegraf"
Extra Argument: --user telegraf:$(stat -c '%g' /var/run/docker.sock)

 

It should be (or at least worked for me):

Add the following
Extra Parameters: --user telegraf:$(stat -c '%g' /var/run/docker.sock)
Post Argument: /bin/bash -c "/entrypoint.sh telegraf"

 

And for SMART queries and telemetry to work, I looked up some documentation and within the 'telegraph.conf' file, I had to add "use_sudo = true" which I discovered from a Reddit post.  Though I now get HDD disk temps and SMART information, the historical view for temperature over 6 hours isn't working for me ("Drive SMART Temps - Last 6 hours", still trying to figure that out.

[[inputs.smart]]
  attributes = true
  use_sudo = true

 

 

  • 3 months later...

Had to add a path for the telegrah.conf file.

 

Got most of the way there, but something isn't working right. 

 

2024-11-23T20:55:40Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:55:40Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:55:50Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:55:50Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:56:00Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:56:00Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:56:10Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:56:10Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
2024-11-23T20:56:20Z E! [inputs.docker] Error in plugin: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

Some tips for anyone doing this:
 

  1. Make sure you add a volume mapping for the telegraf.conf
    You can add this under `Add another Path, Port, Variable, Label or Device` and filling out the host/container paths
  2. Add this to the extra parameter: `--privileged -v /:/hostfs:ro -v /run/udev:/run/udev:ro -e HOST_PROC=/hostfs/proc`
    This is in addition to `--user telegraf:$(stat -c '%g' /var/run/docker.sock)` mentioned in the guide
    This will help if you're seeing errors about gathering disk tags or disk names. I found it suggested on the telegraf github page
  3. Add this to the extra parameter also: `-v /var/run/docker.sock:/var/run/docker.sock`
    This will help if you're seeing error messages about not being able to connect to the docker daemon. Again, I found it on the telegraf github page

And all this to say that this still isn't working for me lol

For some reason InfluxDB isn't getting any data, but at least there aren't any errors in the telegraf logs. I'll update this comment when I figure out why InfluxDB isn't getting any stats
 

  • 3 weeks later...
On 11/26/2024 at 12:02 AM, Sam_McC said:

Some tips for anyone doing this:
 

  1. Make sure you add a volume mapping for the telegraf.conf
    You can add this under `Add another Path, Port, Variable, Label or Device` and filling out the host/container paths
  2. Add this to the extra parameter: `--privileged -v /:/hostfs:ro -v /run/udev:/run/udev:ro -e HOST_PROC=/hostfs/proc`
    This is in addition to `--user telegraf:$(stat -c '%g' /var/run/docker.sock)` mentioned in the guide
    This will help if you're seeing errors about gathering disk tags or disk names. I found it suggested on the telegraf github page
  3. Add this to the extra parameter also: `-v /var/run/docker.sock:/var/run/docker.sock`
    This will help if you're seeing error messages about not being able to connect to the docker daemon. Again, I found it on the telegraf github page

And all this to say that this still isn't working for me lol

For some reason InfluxDB isn't getting any data, but at least there aren't any errors in the telegraf logs. I'll update this comment when I figure out why InfluxDB isn't getting any stats
 

Did you ever get it working? Same goes for me, no errors, but no data too.

  • 1 month later...

I have everything working except inputs.diskio. any ideas on this? i recently switched to golift container.

 

2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdf1": error reading /dev/sdf1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdf1": error reading /dev/sdf1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdg1": error reading /dev/sdg1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdg1": error reading /dev/sdg1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdh1": error reading /dev/sdh1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdh1": error reading /dev/sdh1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdb1": error reading /dev/sdb1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdb1": error reading /dev/sdb1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdc1": error reading /dev/sdc1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdc1": error reading /dev/sdc1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdd1": error reading /dev/sdd1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdd1": error reading /dev/sdd1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sde1": error reading /dev/sde1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sde1": error reading /dev/sde1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdi1": error reading /dev/sdi1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdi1": error reading /dev/sdi1: no such file or directory

 

On 12/11/2024 at 6:44 AM, Jooooost said:

Did you ever get it working? Same goes for me, no errors, but no data too.

I'm still pretty new to all this so I'm not sure if this will help, but I just noticed in my .conf file there was an extra / before the :8086. Not sure how that got there, but I deleted the / and the data is coming through to influx now. 

I have the same thing with "Unable to gather disk name..." in the logs too. Influx sees all my drives now though, with lots of info. 

  • 3 months later...
On 1/21/2025 at 9:17 PM, spyd4r said:

I have everything working except inputs.diskio. any ideas on this? i recently switched to golift container.

 

2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdf1": error reading /dev/sdf1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdf1": error reading /dev/sdf1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdg1": error reading /dev/sdg1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdg1": error reading /dev/sdg1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdh1": error reading /dev/sdh1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdh1": error reading /dev/sdh1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdb1": error reading /dev/sdb1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdb1": error reading /dev/sdb1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdc1": error reading /dev/sdc1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdc1": error reading /dev/sdc1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdd1": error reading /dev/sdd1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdd1": error reading /dev/sdd1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sde1": error reading /dev/sde1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sde1": error reading /dev/sde1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk name for "sdi1": error reading /dev/sdi1: no such file or directory
2025-01-21T21:13:20Z W! [inputs.diskio] Unable to gather disk tags for "sdi1": error reading /dev/sdi1: no such file or directory

 

For anyone stumbling on this thread and getting this issue. You need to list your drives properly in the telegraf.conf file.

e.g.

[[inputs.diskio]]
  devices = ["sda", "sdb", "sdc", "sdd", "sde", "sdf", "sdg", "sdh", "nvme0n1"]
  device_tags = ["ID_SERIAL", "ID_FS_TYPE", "ID_FS_USAGE"]
  skip_serial_number = true


You can find what those are using the command "lsblk -dno NAME" in your terminal (unless you specifically need to, ignore things like loop0 or md1p1 etc.)

Edited by Jazmac

  • 1 month later...

If you want to enable NVIDIA devices, make sure to add the environment variable: "NVIDIA_VISIBLE_DEVICES" and set it to "all" along with adding "--runtime=nvidia" as an Extra Parameter

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.