Check_disk plugin returning incorrect filesystem usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
crystal.then
Posts: 57
Joined: Mon Oct 27, 2014 12:05 am

Check_disk plugin returning incorrect filesystem usage

Post by crystal.then »

Hello,

I'm having issues with the check_disk plugin - it's returning the incorrect filesystem usage for a single filesystem.

Check returns:
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /tsm/tsmdbbackup
DISK CRITICAL - free space: /tsm/tsmdbbackup 413556 MB (9% inode=99%);| /tsm/tsmdbbackup=3780235MB;3355033;3774412;0;4193792

Actual usage (in MB):
# df -m /tsm/tsmdbbackup
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/tsmdbb_01 20971008.00 17190772.54 19% 76 1% /tsm/tsmdbbackup

So the expected output of the check is "DISK OK - 81% free"

Version is:
check_disk v1.4.16 (nagios-plugins 1.4.16)

OS is:
AIX 7100-03-05-1524

Anybody else run into this issue, or have any ideas?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_disk plugin returning incorrect filesystem usage

Post by rkennedy »

There may have been a bug fixed between your version, and the current. I just verified the current check_disk version on my local machine and it's 2.0.3.

Code: Select all

[root@localhost libexec]# ./check_disk -V
check_disk v2.0.3 (nagios-plugins 2.0.3)
Could you update and let us know the result?
Former Nagios Employee
crystal.then
Posts: 57
Joined: Mon Oct 27, 2014 12:05 am

Re: Check_disk plugin returning incorrect filesystem usage

Post by crystal.then »

Hi rkennedy,

Thanks for your reply. I've updated the check_disk plugin to 2.0.3, but I'm still running in to the same issue:

# ./check_disk -e -w 20% -c 10% -p /tsm/tsmdbbackup
DISK CRITICAL - free space: /tsm/tsmdbbackup 269480 MB (6% inode=99%);| /tsm/tsmdbbackup=3924311MB;3355033;3774412;0;4193792

# df -m /tsm/tsmdbbackup
Filesystem MB blocks Free %Used Iused %Iused Mounted on
/dev/tsmdbb_01 20971008.00 17046696.55 19% 76 1% /tsm/tsmdbbackup

# ./check_disk -V
check_disk v2.0.3 (nagios-plugins 2.0.3)
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Check_disk plugin returning incorrect filesystem usage

Post by rkennedy »

Are you seeing the correct result without the -e? I'm trying to replicate this over here, but having issues.

Code: Select all

[root@localhost libexec]# ./check_disk -V
check_disk v2.0.3 (nagios-plugins 2.0.3)
[root@localhost libexec]# ./check_disk -w 20% -c 10% -p /dev/sda1
DISK OK - free space: /boot 374 MB (75% inode=99%);| /boot=122MB;396;446;0;496
[root@localhost libexec]# df -m /dev/sda1
Filesystem     1M-blocks  Used Available Use% Mounted on
/dev/sda1            497   123       375  25% /boot
Former Nagios Employee
crystal.then
Posts: 57
Joined: Mon Oct 27, 2014 12:05 am

Re: Check_disk plugin returning incorrect filesystem usage

Post by crystal.then »

Yes, it detects the same amount of space regardless of the flags I use. It's also getting the total size of the filesystem wrong as well, as seen in the perf data. Seems like it can't handle such large filesystems. I've just checked on another server with a 15TB filesystem and it gets that wrong too.

I found this post, so I guess that it was a known issue at one point:
https://support.nagios.com/forum/viewto ... 35&t=28474

Nagios Plugins 2.1.0 comes with the note "check_disk.c – Prevent large tide values from truncation (JesperForsberg)", but I've just tried 2.1.1 and unfortunately it's still getting it wrong:

Code: Select all

# ./check_disk.2.1.1 -V
check_disk v2.1.1 (nagios-plugins 2.1.1)
# ./check_disk -w 20% -c 10% -p /tsm/tsmdbbackup
DISK CRITICAL - free space: /tsm/tsmdbbackup 224172 MB (5% inode=99%);| /tsm/tsmdbbackup=3969619MB;3355033;3774412;0;4193792
From my testing the plugin does well with filesystems up to 6TB, although I don't have any filesystems sized between 6-15TB so I'm not sure where the cutoff is. We can check the filesystem with our own scripts, just wanted to use check_disk to keep it all standardised... I'm happy for you to close this as a known issue :)
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Check_disk plugin returning incorrect filesystem usage

Post by lmiltchev »

Nagios Plugins 2.1.0 comes with the note "check_disk.c – Prevent large tide values from truncation (JesperForsberg)", but I've just tried 2.1.1 and unfortunately it's still getting it wrong:
This commit only fixed the "up to 4GB" problem. It would need a different change to go even higher. Please enter a new issue in github:

https://github.com/nagios-plugins/nagios-plugins/issues
I'm happy for you to close this as a known issue :)
I will be locking this thread now. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked