influxdbWriter ignores perfdata for check_disk when unit is MiB

Hello,

I have this issue. when i created a check with check_disk command with default unit(MiB)
/usr/lib64/nagios/plugins/check_disk -w 10% -c 5% -W 20% -K 15% /tmp
i get the following error:
warning/InfluxdbWriter: Ignoring invalid perfdata for checkable ‘server1!os_disk /tmp’ and command ‘by_ssh’ with value: /tmp=38MiB;1834;1936;0;2038
If I define the unit as MB, it works but report wrong disk space : /usr/lib64/nagios/plugins/check_disk --units=MB -w 10% -c 5% -W 20% -K 15% /tmp

Do you know why InfluxdbWriter ignore the default unit MiB? Is there way to make this work?

Thank you.

Hello,

MiB is a non allowed UOM, see https://nagios-plugins.org/doc/guidelines.html#AEN200
But anyway dont use MiB parameter as icinga will always convert all performance data to bytes.

Regards,
Carsten

yes, I indeed have to use the unit=MB. However performance data shows the wrong disk space compare to the output of df.

df -m

Filesystem 1M-blocks Used Available Use% Mounted on
/dev/mapper/vg_system-lv_root 18422 7989 10434 44% /

df -h

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_system-lv_root 18G 7.9G 11G 44% /

server1 # /usr/lib64/nagios/plugins/check_disk --units=MB -w 10% -c 5% -W 20% -K 15% /
DISK OK - free space: / 10940 MB (56.63% inode=99%);| /=8376MB;17384;18350;0;19316

server1 # /usr/lib64/nagios/plugins/check_disk --units=MiB -w 10% -c 5% -W 20% -K 15% /
DISK OK - free space: / 10433 MiB (56.63% inode=99%);| /=7988MiB;16579;17500;0;18422

Performance data: (it should be only 18G instead of 18.86)
/ 8.18 GiB 18.86 GiB 16.98 GiB 17.92 GiB

i don’t know how icinga converts the value from MB to GiB to display on performance data, but seems to be wrong

I used option -m and it gave me good result, influxdbWriter is also happy
/usr/lib64/nagios/plugins/check_disk -m -w 10% -c 5% -W 20% -K 15% /tmp