Page 2 of 2

Re: Same command, different results w/Debian & CentOS

Posted: Wed Nov 19, 2014 7:35 pm
by jbruyet
Hi sreinhardt, I'm slowly getting caught up on stuff. Emphasis on "slowly."

I just installed 2.0.3 on one of my Debian servers and I'm still getting the same result:

Code: Select all

root@CSDeb:/home/jobee/Downloads/nagios-plugins-2.0.3# /usr/local/nagios/libexec/check_disk -V
check_disk v2.0.3 (nagios-plugins 2.0.3)
root@CSDeb:/home/jobee/Downloads/nagios-plugins-2.0.3# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p "/dev/sda2"
DISK OK - free space: /dev 10 MB (100% inode=99%);| /dev=0MB;8;9;0;10
Are there any obscure places I can look to see why it keeps looking at /dev rather than /dev/sda2?

Thanks,

Joe B

Re: Same command, different results w/Debian & CentOS

Posted: Thu Nov 20, 2014 3:07 am
by millisa

Code: Select all

root@CSDeb:/home/jobee# fdisk -l
Disk /dev/sda: 21.5 GB, 21474836480 bytes
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048    40136703    20067328   83  Linux
/dev/sda2        40138750    41940991      901121    5  Extended
/dev/sda5        40138752    41940991      901120   82  Linux swap / Solaris
/dev/sda2 on that debian system is an extended partition that has your /dev/sda5 swap partition (note the start block of /dev/sda5 is within the /dev/sda2 extended range and they end on the same block).
check_disk is for checking space in a mounted file system (which on that system, it is not a mounted file system)
I suspect /dev/sda2 on your centos system is not an extended partition and likely the location of your root mount point).

What you are seeing when you run check_disk on /dev/sda2 is the usage of your udev mount at /dev (look at your df output earlier and you'll see the 10mb number you're getting)

If you compare your 'fdisk -l /dev/sda' output from both servers, I expect you'll see the difference between the two systems.

Re: Same command, different results w/Debian & CentOS

Posted: Thu Nov 20, 2014 5:25 pm
by sreinhardt
Great points Millisa! If an exact match cannot be found, check_disk will attempt to find the next closest name. Since /dev/sda2 is not truly mounted, millisa is correct you likely will not be able to check a partition for that. You could force exact name matching with -E. It might force it to check lower down the list of partitions.