[Nagiosplug-help] check_disk path truncation issue

Mike Lindsey mike+nagiosplug at bettyscout.org
Mon Jan 7 21:25:22 CET 2008


On Mon, 7 Jan 2008, Matthias Eble wrote:

> Hi Mike,
>
> Mike Lindsey wrote:
>>  I have a problem with check_disk v1973
>
> hmm strange my svn version claims to be
> $ ./check_disk -V
> check_disk v1848 (nagios-plugins 1.4.11)

Sorry, transposed numbers.  It's v1793 from package version 1.4.10

>>  The path to an nfs mount is being truncated if I check it with -A, causing
>>  the stat() to fail.  If I check it explicitly with -p, it works, but still
>>  truncates the output of the pathname.
>
> Handling between -p and -A slightly differs. So as a first shot,I'd suspect 
> gnulib (mountlist.c) to be the cause. What's your OS platform?


  $ uname -a
FreeBSD xxxxxx 6.0-STABLE FreeBSD 6.0-STABLE #0: 
Tue Jun  5 20:07:15 UTC 2007 
root at xxxxx:/usr/src/sys/i386/compile/MESSAGING_GATEWAY.i386_INSTALL 
i386

>>  Here's the df output, followed by the bad output with truss, followed by
>>  the explicit check output:
>>
>>    $ df
> ...
>>  xxxx.xxxx.xxxx:/home/mga/phlog 414797610 174350584 207263218 46%
>>  /data/home/mga/phlog
>
> i tested on my laptop:
> ./check_disk -w 50 -c 10 -A
> DISK OK - free space: / 36028 MB (80% inode=96%); /var/run 505 MB (99% ...
> /data/home/mga/phlog=8523MB;46886;46926;0;46936
>
> and df:
> thisis.a.veryveryverylong.hostname.and.domain:/home/mga/phlog/
>                        46G  8.4G   36G  20% /data/home/mga/phlog
>
> without problems.
>
>
>>    $ truss /usr/local/nagios/libexec/check_disk -w 20 -c 10 -A
> ...
>>  stat("/data/home/mga/p",0x805f000)               ERR#2 'No such file or 
>
> in this case all by mountlist reported partitions are checked.
>
>
>>  $ truss /usr/local/nagios/libexec/check_disk -w 20 -c 10 -p
>>  /data/home/mga/phlog
> ...
>>  DISK OK - free space: /data/home/mga/p 2098861531865 MB (0% inode=99%);|
>>  /data/home/mga/p=-2147483648MB;-2147483648;-2147483648;0;-2147483648
>
> here, your path is checked but path output comes from mountlist. But free 
> space is too large, though..

It shows up correctly as a 400GB partition, under df.  There is a bug with 
freebsd with very large nfs partitions that might be part of all this. 
But, since I'm not actually checking for free space on the partition, 
just that it's mounted, I don't much care.

> Please send some output of running these checks using -vvvv
> this might help.

$ /usr/local/nagios/libexec/check_disk -w 20 -c 10 -e -A -L -X procfs -X 
devfs -X fdescfs -vvvv
calling stat on /
For /, used_pct=2 free_pct=98 used_units=33 free_units=1786 
total_units=1978 used_inodes_pct=1 free_inodes_pct=99 
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
calling stat on /usr
For /usr, used_pct=18 free_pct=82 used_units=1566 free_units=7556 
total_units=9916 used_inodes_pct=22 free_inodes_pct=78 
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
calling stat on /var
For /var, used_pct=3 free_pct=97 used_units=36 free_units=1783 
total_units=1978 used_inodes_pct=1 free_inodes_pct=99 
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
calling stat on /data
For /data, used_pct=25 free_pct=75 used_units=54820 free_units=173504 
total_units=248179 used_inodes_pct=1 free_inodes_pct=99 
fsp.fsu_blocksize=2048 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
calling stat on /net
calling stat on /host
calling stat on /data/home/mga/p
stat failed on /data/home/mga/p
DISK CRITICAL - /data/home/mga/p is not accessible: No such file or 
directory

and:
$ /usr/local/nagios/libexec/check_disk -w 20 -c 10 -e -p 
/data/home/mga/phlog -L -X procfs -X devfs -X fdescfs -vvvv
calling stat on /data/home/mga/phlog
For /data/home/mga/p, used_pct=100 free_pct=0 used_units=5.05581e+12 
free_units=5.55317e+12 total_units=1.69904e+13 used_inodes_pct=100 
free_inodes_pct=0 fsp.fsu_blocksize=6577187268 mult=1048576
Freespace_units result=0
Freespace% result=0
Usedspace_units result=0
Usedspace_percent result=0
Usedinodes_percent result=0
Freeinodes_percent result=0
DISK OK /data/home/mga/p 5553169071946 MB (0% inode=0%);| 
/data/home/mga/p=-2147483648MB;-2147483648;-2147483648;0;-2147483648


--
Mike Lindsey




More information about the Help mailing list