Telegraf inputs.disk recognizing /dev/sda1 , but not sending data to influxdb

Just getting a bit annoyed:
I would like to see the host metrics for disks in influxdb. Telegraf is transferring /root and /boot nicely, but no transfer from /dev/sda1 or /dev/sda2.
Testing telegraf recognized disks they appear:

pi@kignasrpi:~ $ telegraf --input-filter=disk --test
2023-11-28T12:52:31Z I! Using config file: /etc/telegraf/telegraf.conf
2023-11-28T12:52:31Z I! Starting Telegraf 1.25.0
2023-11-28T12:52:31Z I! Available plugins: 227 inputs, 9 aggregators, 26 processors, 21 parsers, 57 outputs, 2 secret-stores
2023-11-28T12:52:31Z I! Loaded inputs: disk
2023-11-28T12:52:31Z I! Loaded aggregators: 
2023-11-28T12:52:31Z I! Loaded processors: 
2023-11-28T12:52:31Z I! Loaded secretstores: 
2023-11-28T12:52:31Z W! Outputs are not used in testing mode!
2023-11-28T12:52:31Z I! Tags enabled: host=kignasrpi
> disk,device=mmcblk0p2,fstype=ext4,host=kignasrpi,mode=rw,path=/ free=15644372992i,inodes_free=1792119i,inodes_total=1918208i,inodes_used=126089i,total=31071481856i,used=14106079232i,used_percent=47.41467163521124 1701175952000000000
> disk,device=mmcblk0p1,fstype=vfat,host=kignasrpi,mode=rw,path=/boot free=235241472i,inodes_free=0i,inodes_total=0i,inodes_used=0i,total=267374592i,used=32133120i,used_percent=12.018015533802105 1701175952000000000
> disk,device=sda1,fstype=ext4,host=kignasrpi,mode=rw,path=/media/pi/influx free=257543610368i,inodes_free=19834701i,inodes_total=19841024i,inodes_used=6323i,total=318822141952i,used=45008302080i,used_percent=14.87622461739872 1701175952000000000
> disk,device=sda2,fstype=ext4,host=kignasrpi,mode=rw,path=/media/pi/KIG_NAS free=162383564800i,inodes_free=10690545i,inodes_total=10690560i,inodes_used=15i,total=171152261120i,used=32768i,used_percent=0.000020179378022634352 1701175952000000000

Inputs.disk config is default:

  ## By default stats will be gathered for all mount points.
  ## Set mount_points will restrict the stats to only the specified mount points.
  # mount_points = ["/"]
  ## Ignore mount points by filesystem type.
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]

In InfluxDB only mmcblk0p2 & mmcblk0p1 are outputted.


Telegraf version is:
Telegraf 1.25.0 (git: HEAD@4d17ec79)

Thanks in advance for your help!

By default stats will be gathered for all mount points.

Disk only monitors by mountpoint, not a device. If /dev/sda1 and /dev/sda2 are not mounted anywhere, then it does not have anything to look at.

I’m not an expert, but I think it’s mounted. Also it’s there with proc/mounts where inputs.disk reads…
Also it’s recognized by the test.

pi@kignasrpi:~ $ df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/root       30343244 13834956  15218220  48% /
devtmpfs         1678472        0   1678472   0% /dev
tmpfs            1942696        0   1942696   0% /dev/shm
tmpfs             777080     3000    774080   1% /run
tmpfs               5120        4      5116   1% /run/lock
/dev/mmcblk0p1    261108    31380    229728  13% /boot
/dev/sda1      311349748 44001520 251459332  15% /media/pi/influx
tmpfs             388536       24    388512   1% /run/user/1000
/dev/sda2      167140880       32 158577700   1% /media/pi/KIG_NAS

Ok so you are looking for:

  • /media/pi/influx
  • /media/pi/KIG_NAS

Are these listed in /proc/self/mounts where you are running telegraf?

Also are you running telegraf in a container? Are you running it as a service?

Yes, I’m looking for them.
It’s not running in a container, but as a service. And yes, they are listed with proc/self/mounted - that’s why I think we can see with the <telegraf --input-filter=disk --test> output. Also this makes me confused why they are not included with the others.
Also I was giving access for group “influx” (influxdb, telegraf), still no luck.

Meanwhile issue identified, “no permission”, but couldn’t solve.

Please take a look at the troubleshooting section of the disk plugin readme, which talks about permissions.

Thanks jpowers, I’ve already done that yesterday, but it turned out it was a deeper issue combined with mounting anomalies and ACL setup.
Problem is solved, the thing was that most of the troubleshooting steps provided expected feedback of a working system.

1 Like