check_disk 1.4.3 (1.64) for AIX not working?

Ton Voon ton.voon at altinity.com
Mon Jul 17 13:16:47 CEST 2006


On 17 Jul 2006, at 12:04, Alexander Harvey wrote:

> Hi Ton
>
> Still no good unfortunately:
>
> # perl t/check_disk.t
> 1..35
> ok 1 - Checking two mountpoints (must have at least 1% free)
> ok 2 - Got two mountpoints in output
> ok 3 - At least 1 MB available on /
> ok 4 - OK output
> ok 5 - Old syntax okay
> ok 6 - At least 1% free
> ok 7 - Get critical on less_free mountpoint /var
> ok 8 - Right output
> ok 9 - Get warning on less_free mountpoint, when checking avg_free
> ok 10 - Get ok on more_free mountpoint, when checking avg_free
> ok 11 - Combining above two tests, get warning
> ok 12 - Get ok on more_free mountpoint, checking avg_free
> ok 13 - Get critical on less_free, checking avg_free
> ok 14 - Combining above two tests, get critical
> ok 15 - And reversing arguments should not make a difference
> not ok 16 - Invalid command line options # TODO Invalid percent  
> figures
> #     Failed (TODO) test (t/check_disk.t at line 118)
> #          got: 0
> #     expected: 3
> ok 17 - Invalid options: -p must come after thresholds
> ok 18 - 100% empty
> ok 19 - Right output
> ok 20 - Check for 100GB free
> ok 21 - 100 GB empty
> ok 22 - Old syntax: 0% used
> ok 23 - Old syntax: 100% used
> ok 24 - Old syntax: warn 0% used
> not ok 25 - Old syntax: Error with values outside percent range #  
> TODO Invalid values
> #     Failed (TODO) test (t/check_disk.t at line 150)
> #          got: 1
> #     expected: 3
> not ok 26 - Old syntax: Error with values outside percent range #  
> TODO Invalid values
> #     Failed (TODO) test (t/check_disk.t at line 153)
> #          got: 0
> #     expected: 3
> not ok 27 - Old syntax: Error with values outside percent range #  
> TODO Invalid values
> #     Failed (TODO) test (t/check_disk.t at line 156)
> #          got: 2
> #     expected: 3
> ok 28 - Checking /bob - return error because /bob does not exist
> ok 29 - Output OK
> ok 30 - Checking /etc - should return info for /
> ok 31 - check_disk /etc gives same as check_disk /
> ok 32 - ... unless -E/--exact-match is specified
> ok 33 - Checking / and /bob gives critical
> ok 34 - perf data does not have /bob in it
> ok 35 - Should not show same filesystem twice
>
> # echo $?
> 0
>
> # ./check_disk -w 20% -c 1%
> DISK CRITICAL - free space: / 9220 MB (87% inode=0%); /usr 1607 MB  
> (57% inode=-700%); /var 1480 MB (72% inode=0%); /tmp 1728 MB (84%  
> inode=0%); /var/adm/ras/platform 255 MB (99% inode=0%); /home 510  
> MB (99% inode=0%); /proc 0 MB (0% inode=-); /opt 121 MB (47%  
> inode=-1000%); /u02 53521 MB (27% inode=0%); /u03 67510 MB (49%  
> inode=0%); /u01 8623 MB (53% inode=-100%);| /=1275MB;;; / 
> usr=1208MB;;; /var=567MB;;; /tmp=319MB;;; /var/adm/ras/ 
> platform=0MB;;; /home=1MB;;; /proc=2147483647MB;;; /opt=134MB;;; / 
> u02=141038MB;;; /u03=68681MB;;; /u01=7504MB;;;

Looks okay. There's a problem with inodes being -700% on /usr, but  
otherwise it looks valid.

I think the /proc is causing your failure (correctly since there is  
no free space). Run ./check_disk -w 20% -c 1% -p / -p /usr and that  
should come back okay.

Ton

>
> # df -k
> Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
> /dev/hd4         10747904   9441760   13%     1979     1% /
> /dev/hd2          2883584   1645584   43%    28895     8% /usr
> /dev/hd9var       2097152   1516452   28%     1805     1% /var
> /dev/hd3          2097152   1770068   16%     1460     1% /tmp
> /dev/fwdump        262144    261776    1%        4     1% /var/adm/ 
> ras/platform
> /dev/hd1           524288    522316    1%      129     1% /home
> /proc                   -         -    -         -     -  /proc
> /dev/hd10opt       262144    124436   53%     3135    11% /opt
> /dev/fslv00     199229440  54806068   73%       48     1% /u02
> /dev/fslv01     139460608  69130908   51%      131     1% /u03
> /dev/u01lv       16515072   8830168   47%    20517     2% /u01
>
> Kind Regards,
> Alex
>
> On 7/17/06, Ton Voon <ton.voon at altinity.com> wrote:
> Alexander,
>
> Can you please try the CVS snapshot: http:// 
> nagiosplug.sourceforge.net/snapshot for the latest check_disk. I've  
> made changes so that is more closely mimics df from the coreutils  
> project. I'd be interested to hear how well this works on AIX.
>
> When you have compile check_disk, please run: cd plugins && perl t/ 
> check_disk.t. This runs some tests to see if check_disk is working  
> as expected. The return code should be 0 (there are a couple of  
> TODOs that will show as fail, but are expected).
>
> Ton
>
> On 17 Jul 2006, at 07:05, Alexander Harvey wrote:
>
> Actually, it still doesn't really work in AIX5L as it always finds  
> the /proc filesystem to be of size -1%.
>
> I've rewritten this plugin as a shell script for anyone else who  
> might find this useful:
>
> #!/bin/ksh
> # author: alex harvey
> # email: alexh19740110 at gmail.com
>
> Usage ()
> {
>     printf "Usage: %s: [-w warn] [-c crit]\n" $0
>     exit 3
> }
>
> wflag=
> cflag=
>
> while getopts w:c: opt
> do
>    case $opt in
>       w) wflag=1
>          warn=$OPTARG
>          ;;
>       c) cflag=1
>          crit=$OPTARG
>          ;;
>       ?) Usage
>          ;;
>    esac
> done
>
> # too many arguments?
> shift $(($OPTIND -1))
> [ $# -ne 0 ] && Usage
>
> # missing warn or crit option?
> [ ! -z "$wflag" ] && [ ! -z "$cflag" ] || Usage
>
> # chop the trailing %
> warn=`echo $warn | sed -e 's/%$//'`
> crit=`echo $crit | sed -e 's/%$//'`
>
> mounts=`\
>   df -k |\
>   grep -v /proc |\
>   grep -v /var/adm/ras/platform |\
>   tail +2 |\
>   awk '{print $7}'`
>
> STATE=0
>
> for i in $mounts; do
>    free_pcent=`df -k |\
>      awk -v input=$i '{if ($7 == input) print $4}' |\
>      sed -e 's/%//'`
>    free_pcent=`echo 100 - $free_pcent | bc`
>    free_kb=`df -k |\
>      awk -v input=$i '{if ($7 == input) print $3}'`
>    if [ $free_pcent -le $warn ] && [ $STATE -le 1 ]; then
>       STATE=1
>       mess="$mess, $free_kb kB (${free_pcent}%) free on $i"
>    fi
>    if [ $free_pcent -le $crit ]; then
>       STATE=2
>       mess="$mess, $free_kb kB (${free_pcent}%) free on $i"
>    fi
> done
>
> case $STATE in
>    0) echo "DISK OK"
>       exit 0
>       ;;
>    1) STATE_MESS=WARNING
>       ;;
>    2) STATE_MESS=CRITICAL
>       ;;
> esac
>
> mess=`echo $mess | sed -e 's/^, //'`
> mess="DISK $STATE_MESS [$mess]"
> echo $mess
> exit $STATE
>
>
> Kind Regards,
> Alex
>
>
> On 7/10/06, Alexander Harvey < alexh19740110 at gmail.com> wrote:
> Well, I got this to work using the earlier version:
>
>
> # ./plugins/check_disk -w 10% -c 5% -p /home
> DISK OK - free space: /home 508 MB (99%);| /home=5MB;460;486;0;512
>
> # ./plugins/check_disk --version
> check_disk (nagios-plugins 1.4.2 ) 1.57
>
> Perhaps this is a bug?
>
> Regards,
> Alex
>
>
> On 7/10/06, Alexander Harvey < alexh19740110 at gmail.com > wrote:
> Hi,
>
> Has anyone else had any problems using the latest check_disk v1.64  
> plugin in AIX5.3?
>
> Here's my list of filesystems:
>
> # df -k
> Filesystem    1024-blocks      Free %Used    Iused %Iused Mounted on
> /dev/hd4         10747904   1515560   86%     1975     1% /
> /dev/hd2          2883584   1653188   43%    28814     8% /usr
> /dev/hd9var       2097152   1454828   31%     2898     1% /var
> /dev/hd3          2097152   1770060   16%     1453     1% /tmp
> /dev/fwdump        262144    261776    1%        4     1% /var/adm/ 
> ras/platform
> /dev/hd1           524288    519920    1%      118     1% /home
> /proc                   -         -    -         -     -  /proc
> /dev/hd10opt       262144    125340   53%     3127    10% /opt
> /dev/fslv00     167772160  23425268   87%       48     1% /u02
> /dev/fslv01     139460608  69102616   51%      131     1% /u03
> /dev/u01lv       16515072   9477800   43%    22322     2% /u01
>
> 1. First example of false or misleading output:
>
> # ./plugins/check_disk -w 10% -c 5%
> DISK CRITICAL - free space: / 1480 MB (14% inode=99%); /usr 1614 MB  
> (57% inode=93%); /var 1421 MB (69% inode=99%); /tmp 1729 MB (84%  
> inode=100%); /var/adm/ras/platform 256 MB (100% inode=100%); /home  
> 508 MB (99% inode=100%); /proc 0 MB (0% inode=NaNQ%); /opt 122 MB  
> (48% inode=90%); /u02 22876 MB (14% inode=100%); /u03 67483 MB (50%  
> inode=100%); /u01 9256 MB (57% inode=99%);| /=9016MB; 
> 9446;9971;99;10496 /usr=1202MB;2534;2675;92;2816 /var=628MB; 
> 1843;1945;99;2048 /tmp=320MB;1843;1945;99;2048 /var/adm/ras/ 
> platform=1MB;230;243;99;256 /home=5MB;460;486;99;512 /proc=-1MB; 
> 1717986917;858993458;-2147483648;-1 /opt=134MB;230;243;90;256 / 
> u02=140964MB;147456;155648;99;163840 /u03=68709MB; 
> 122572;129382;99;136192 /u01=6873MB;14515;15321;98;! 16128
>
> (Looks like it's failing to understand the /proc entry?)
>
> 2. Second example of failed output:
>
> # ./plugins/check_disk -w 10% -c 5% -p /home
> INPUT ERROR: C_IDFP (0.000000) should be less than W_IDFP ( 0.0)  
> and both should be between zero and 100 percent, inclusive for /home
> check_disk: Could not parse arguments
> Usage: check_disk -w limit -c limit [-p path | -x device] [-t  
> timeout][-m] [-e] [-W limit] [-K limit] [-v] [-q]
>
> 3. Furthermore I noticed it failed the test in 'make test':
>
> ./t/check_disk......dubious
>         Test returned status 255 (wstat 65280, 0xff00)
> DIED. FAILED tests 1, 3-32
>         Failed 31/32 tests, 3.12% okay
>
> Anyone seen any of this before?
>
> My configure options were:
>
> # ./configure --with-openssl=no --with-ipv6=no
>
> Thanks in advance,
>
> Alex Harvey
>
>
>
>
>
> This message has been scanned for viruses by MailController.
>
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> 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
>
>
>
>
>
> http://www.altinity.com
> T: +44 (0)870 787 9243
> F: +44 (0)845 280 1725
> Skype: tonvoon
>
>
>



http://www.altinity.com
T: +44 (0)870 787 9243
F: +44 (0)845 280 1725
Skype: tonvoon


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060717/f4381acc/attachment.html>
-------------- next part --------------

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
-------------- next part --------------
_______________________________________________
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