Telegraf disk usage metric different from df -h

Dears,

I have a Linux server with telegraf-1.13.4-1.x86_64 installed, the problem is that I have influxdb and grafana for visual dashboards, I noticed that the DISK is reporting different values that what I have in the Linux OS.

Here is what I have on Linux:
df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/rhel-root 263G 141G 122G 54% /

what telegraf is reporting:
telegraf --input-filter disk --test | grep dm-0
2020-02-28T13:18:08Z I! Starting Telegraf 1.13.4
2020-02-28T13:18:08Z I! Using config file: /etc/telegraf/telegraf.conf

disk,device=dm-0,fstype=xfs,host=PINK,mode=rw,path=/ free=130825838592i,inodes_free=136895517i,inodes_total=137615360i,inodes_used=719843i,total=281810042880i,used=150984204288i,used_percent=53.576587528604115 1582895889000000000

notice for example: total disk size for / is: total=281810042880i which is 281.8 GB but according to df -h / it shows: rhel-root 263G
same for used space and free space on the root partition.

Note that this is an LVM: rhel-root 262.5G 0 lvm /
XFS partiion and Red Hat 7.4

I suspect this is the difference between a Gigabyte to some people being 1024
Megabytes, which in turn are 1024 Kilobytes, which are in turn 1024 bytes, and
to other people a Gigabyte is 10^9 bytes.

Check: 263 * 1.024 * 1.024 * 1.024 = 282.39

Antony.

1 Like

Oh yes it worked after changing in Grafana the Unit measure of the pie chart from Unit: Datat (Metric) bytes to Unit Data (IEC): Bytes, and it shows as 141 GiB disk used. instead of 151 GB!!

really weird these calculations as I ruled out the problem from Grafana…

thank this surely helped out with my problem.