Same command, different results w/Debian & CentOS

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
jbruyet
Posts: 235
Joined: Wed Dec 28, 2011 12:14 pm

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

Post 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
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

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

Post 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.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

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

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked