Page 1 of 2

check_disk fails to check disk path

Posted: Wed Jun 18, 2014 5:48 am
by SteffenPoulsen
check_disk fails to check disk path

I would like to use check_disk to check the free space of /var01. This is a simple directory created under /.

How do I do this?

If I do _not_ use -E, check_disk will report the free space of /var. Which does not make sense to me, instead I would expect it to report the free space of /.

If I _do_ use -E, check disk will complain that /var01 is not found.

I am probably missing the obvious, looking forward to be enlightened :-)

---

Code: Select all

# mkdir /var01

# df -h /
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             8.9G  3.0G  5.5G  35% /

# df -h /var
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             9.5G  5.0G  4.1G  56% /var

# df -h /var01
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             8.9G  3.0G  5.5G  35% /

# ./plugins/check_disk -w 10% -c 5% -W 10% -K 5% -p /var01
DISK OK - free space: /var 4119 MB (44% inode=98%);| /var=5068MB;8719;9203;0;9688

# ./plugins/check_disk -w 10% -c 5% -W 10% -K 5% -E -p /var01
DISK CRITICAL: /var01 not found

# ./plugins/check_disk --version
check_disk v2.0.2 (nagios-plugins 2.0.2)

Re: check_disk fails to check disk path

Posted: Wed Jun 18, 2014 12:42 pm
by tmcdonald
I'm a bit confused by what you are trying to do. check_disk is not used to check a directory, but rather a disk or a partition. Unless /var01 is a mount point for another disk/partition, checking it will only reveal information about "/". The -E flag just looks for an exact match, so leaving that out goes for /var which is the closest match to /var01.

Re: check_disk fails to check disk path

Posted: Thu Jun 19, 2014 4:15 am
by SteffenPoulsen
Ok, I understand the confusion on the "what are you trying to do" part. Let me see if I can explain this a bit more in detail.

In the real world I am trying to set up check_disk checks for some Oracle cluster file systems. An introduction can be seen at http://docs.oracle.com/cd/E19680-01/htm ... 4n6c5.html.

This involves /global, /global01, /global02 etc., and under each of these a set of mount points that I would like to monitor with check_disk.

So, sometimes a partition is mounted at i.e. /global01/oracle, sometimes it is not.

What I am trying to figure out is how to avoid that the checks that I set up against /global01/* can be prevented from reporting the status of /global (when no partition is currently mounted in /global01/*).
Unless /var01 is a mount point for another disk/partition, checking it will only reveal information about "/"
Yes, that is precisely what I would like check_disk to do. To report the information about the actual partition that the path belongs to currently. And this is what I can't get it to do. What it does in the example is that it reveals information about "/var". Which is completely unrelated. It is not a "closest match" in my book. It is a directly misleading "match" at best.

Perhaps check_disk is just not the right tool for this job. It is possible that check_disk simply does not support this scenario. I am just curious if there is any way at all to get it to do what I want it to do.

Re: check_disk fails to check disk path

Posted: Thu Jun 19, 2014 2:45 pm
by sreinhardt
that's very interesting behavior. What happens if you remove -p and simply append the path /var01 to the end of your command? Otherwise I will do some digging tonight into check_disk, I have to already anyway so this works out well!

Re: check_disk fails to check disk path

Posted: Fri Jun 20, 2014 3:19 am
by SteffenPoulsen
In this case it doesn't appear to change the behaviour to remove the -p flag.

And happy digging :-)
# ./plugins/check_disk -w 10% -c 5% -W 10% -K 5% -p /var01 /var01
DISK OK - free space: /var 4115 MB (44% inode=98%);| /var=5072MB;8719;9203;0;9688

# ./plugins/check_disk -w 10% -c 5% -W 10% -K 5% /var01
DISK OK - free space: /var 4115 MB (44% inode=98%);| /var=5072MB;8719;9203;0;9688

# df -h /var01
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 8.9G 3.0G 5.5G 35% /

Re: check_disk fails to check disk path

Posted: Fri Jun 20, 2014 12:49 pm
by lmiltchev
Maybe you can try this plugin as an alternative:

http://exchange.nagios.org/directory/Pl ... ks/details

Re: check_disk fails to check disk path

Posted: Tue Aug 26, 2014 4:07 am
by SteffenPoulsen
Neither SNMP or PHP are available here, so the check_usolved_disks plugin is not a viable alternative. But thank you anyway, lmiltchev :-)

Out of ideas for check_disk?

Re: check_disk fails to check disk path

Posted: Tue Aug 26, 2014 4:41 pm
by lmiltchev
Out of ideas for check_disk?
Almost. :(
What happens when you use "-M" flag (--mountpoint) instead of "-p"?

Re: check_disk fails to check disk path

Posted: Wed Dec 17, 2014 6:59 am
by SteffenPoulsen
Thank you for the suggestion, lmiltchev.

With -M it is still the same problem, check_disk again checks the wrong partition :-(

(It still reports the usage of /dev/sda2 instead of /dev/sda3 as expected).

Code: Select all

# df -h /var01
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda3             8.9G  2.9G  5.5G  35% /
# ./check_disk -w 10% -c 5% -W 10% -K 5%  -M /var01
DISK OK - free space: /dev/sda2 2907 MB (31% inode=98%);| /dev/sda2=6280MB;8719;9203;0;9688

Re: check_disk fails to check disk path

Posted: Thu Dec 18, 2014 3:07 pm
by sreinhardt
Updates: not yet, it is on my short list for the 2.1 release, but it might be a week or more before I have a proper fix for it. I will definitely post back when we do.