check_disk and filesystem issue.

Andreas Ericsson ae at op5.se
Wed Feb 23 01:25:50 CET 2005


It should be fairly straightforward. From the statfs manpage (sorry for 
possibly wonky formatting);

CONFORMING TO
        The Linux statfs was inspired by the 4.4BSD one (but they  do 
not  use
        the same structure).

NOTES ON f_fsid
        Solaris,  Irix  and  POSIX have a system call statvfs(2) that 
returns a
        struct statvfs (defined in <sys/statvfs.h>) containing an 
unsigned long
        f_fsid.   Linux,  SunOS,  HPUX,  4.4BSD  have a system call 
statfs that
        returns a struct statfs (defined in <sys/vfs.h>)  containing  a 
  fsid_t
        f_fsid,  where  fsid_t  is defined as struct { int val[2]; }. 
The same
        holds for FreeBSD, except that it uses the include file 
<sys/mount.h>.

        The  general  idea  is that f_fsid contains some random stuff 
such that
        the pair (f_fsid,ino) uniquely determines a file.   Some  OSes 
use  (a
        variation on) the device number, or the device number combined 
with the
        filesystem type.  Several OSes restrict giving out the f_fsid 
field  to
        the  superuser only (and zero it for nonprivileged users), 
because this
        field is used in the filehandle of the  filesystem  when 
NFS-exported,
        and giving it out is a security concern.

        Under some OSes the fsid can be used as second parameter to the 
sysfs()
        system call.

NOTES
        The kernel has system calls statfs,  fstatfs,  statfs64, 
fstatfs64  to
        support this library call.

        Some   systems   only   have   <sys/vfs.h>,  other  systems 
also  have
        <sys/statfs.h>, where the former  includes  the  latter.  So  it 
  seems
        including the former is the best choice.

        LSB  has  deprecated  the library calls [f]statfs() and tells us 
to use
        [f]statvfs() instead.



Dan Stromberg wrote:
> On Wed, 2005-02-23 at 00:45 +0100, Andreas Ericsson wrote:
> 
>>Mitch Lien wrote:
>>
>>>Hi.
>>>
>>>I am having a problem with the check_disk plugin on an HP/UX 11.11 server.
>>>
>>>A portion of the "df -Pk" command output is shown below.
>>>.
>>>.
>>>/dev/vgexeBKBCV/lvPRD
>>>                      1938469   282786  1655683    15%   /backupBCV/usr/sap/PRD
>>>/dev/vgexeBKBCV/lvoraclePRD
>>>                      1486472   742937   743535    50%   /backupBCV/oracle/PRD
>>>/dev/vg00/lvol7       2083352   329976  1753376    16%   /home
>>>/dev/vg00/lvol4       4169904  1065488  3104416    26%   /opt
>>>/dev/vg00/lvol5       523656   436496    87160    84%   /tmp
>>>/dev/vg_veritas/lvveritas
>>>                      143654360 66712376 76941984    47%   /usr/openv
>>>/dev/vg00/lvol6       4171528  1272152  2899376    31%   /usr
>>>/dev/vg00/lvol8       6107712  1442320  4665392    24%   /var
>>>/dev/vg00/lvol1       269032    91968   177064    35%   /stand
>>>/dev/vg00/lvol3       212216   109480   102736    52%   /
>>>========================
>>>
>>>When I run the check_disk plugin against any file system that occupies a 
>>>single line output (i.e. /, /var, /usr, etc.), the output is fine (example 
>>>shown below).
>>>
>>>$ ./check_disk -w 80 -w 90  -p /usr
>>>DISK OK - [2899376 kB (69%) free on /dev/vg00/lvol6]
>>>
>>>
>>>However, when I run the check_disk command against any file system that 
>>>occupies has a two (2) line output (i.e. /usr/openv, /backupBCV/usr/sap/PRD, 
>>>etc.), I am getting the following output (shown below).
>>>
>>>$ ./check_disk -c 80 -w 90  -p /usr/openv
>>>Unable to read output:
>>>/usr/bin/df -Pk /usr/openv
>>>/dev/vg_veritas/lvveritas
>>>
>>>I think the issue revolves around the two-line output, but am not sure. I need 
>>>to know if anyone has encountered this before and if there may be a possible 
>>>work-around.
>>>
>>
>>It does. Many have. Noone has a workaround (yet).
> 
> 
> Has anyone tried getting around this sort of thing by using GNU df?
> 

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list