[ nagiosplug-Bugs-3590374 ] check_disk: inconsistency when given device file as -p

SourceForge.net <[email protected]>
Newsgroups gmane.network.nagios.plugins.devel
Message-ID <[email protected]>
Bugs item #3590374, was opened at 2012-11-27 06:44
Message generated for change (Tracker Item Submitted) made by jmeurer
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3590374&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: release-1.4.15
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jonas Meurer (jmeurer)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_disk: inconsistency when given device file as -p

Initial Comment:
Hello,

I observed a inconstency in check_disk plugin when device files are given as argument to option -p:

On recent linux system fstab and mtab often list symlinks like '/dev/disk/by-uuid/...' as device path. The nagios plugin check_disk supports only the exact same device name as given in fstab (and listed in mtab) as argument to -p. If you give a device path like '/dev/sda1' instead of the one from fstab, the argument is not treated as device path, but instead as path to a file on mountpoint '/dev'. This should be fixed, best by using libblkid.

In Debian/Squeeze:

# mount
[...]
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
udev on /dev type tmpfs (rw,mode=0755)
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
DISK OK - free space: / 68787 MB (85% inode=99%);| /=11402MB;67585;76033;0;84482
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
DISK OK - free space: / 68787 MB (85% inode=99%);| /=11402MB;67585;76033;0;84482
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev
DISK OK - free space: /dev 36312 MB (99% inode=99%);| /dev=0MB;29049;32680;0;36312

in Debian/Wheezy (another system):

# mount
[...]
/dev/disk/by-uuid/********** on / type ext4 (rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered)
udev on /dev type devtmpfs (rw,relatime,size=10240k,nr_inodes=3090668,mode=755)
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /
DISK CRITICAL - free space: / 16313 MB (7% inode=99%);| /=200808MB;182992;205866;0;228741
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev/sda1
DISK OK - free space: /dev 10 MB (100% inode=99%);| /dev=0MB;8;9;0;10
# /usr/local/nagios/libexec/check_disk -w 20% -c 10% -p /dev
DISK OK - free space: /dev 10 MB (100% inode=99%);| /dev=0MB;8;9;0;10

I verified that the same nagiosplugins 1.4.15 source was compiled on both systems. Only difference is the underlying Debian release. I guess that some shared library or kernel changes triggered this bug.

Kind regards,
 Jonas Meurer



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3590374&group_id=29880

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.