Hi Ton<br><br>Still no good unfortunately:<br><br># perl t/check_disk.t<br>1..35<br>ok 1 - Checking two mountpoints (must have at least 1% free)<br>ok 2 - Got two mountpoints in output<br>ok 3 - At least 1 MB available on /
<br>ok 4 - OK output<br>ok 5 - Old syntax okay<br>ok 6 - At least 1% free<br>ok 7 - Get critical on less_free mountpoint /var<br>ok 8 - Right output<br>ok 9 - Get warning on less_free mountpoint, when checking avg_free<br>
ok 10 - Get ok on more_free mountpoint, when checking avg_free<br>ok 11 - Combining above two tests, get warning<br>ok 12 - Get ok on more_free mountpoint, checking avg_free<br>ok 13 - Get critical on less_free, checking avg_free
<br>ok 14 - Combining above two tests, get critical<br>ok 15 - And reversing arguments should not make a difference<br>not ok 16 - Invalid command line options # TODO Invalid percent figures<br># Failed (TODO) test (t/check_disk.t at line 118)
<br># got: 0<br># expected: 3<br>ok 17 - Invalid options: -p must come after thresholds<br>ok 18 - 100% empty<br>ok 19 - Right output<br>ok 20 - Check for 100GB free<br>ok 21 - 100 GB empty<br>ok 22 - Old syntax: 0% used
<br>ok 23 - Old syntax: 100% used<br>ok 24 - Old syntax: warn 0% used<br>not ok 25 - Old syntax: Error with values outside percent range # TODO Invalid values<br># Failed (TODO) test (t/check_disk.t at line 150)<br># got: 1
<br># expected: 3<br>not ok 26 - Old syntax: Error with values outside percent range # TODO Invalid values<br># Failed (TODO) test (t/check_disk.t at line 153)<br># got: 0<br># expected: 3<br>not ok 27 - Old syntax: Error with values outside percent range # TODO Invalid values
<br># Failed (TODO) test (t/check_disk.t at line 156)<br># got: 2<br># expected: 3<br>ok 28 - Checking /bob - return error because /bob does not exist<br>ok 29 - Output OK<br>ok 30 - Checking /etc - should return info for /
<br>ok 31 - check_disk /etc gives same as check_disk /<br>ok 32 - ... unless -E/--exact-match is specified<br>ok 33 - Checking / and /bob gives critical<br>ok 34 - perf data does not have /bob in it<br>ok 35 - Should not show same filesystem twice
<br><br># echo $?<br>0<br><br># ./check_disk -w 20% -c 1%<br>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;;;
<br><br># df -k<br>Filesystem 1024-blocks Free %Used Iused %Iused Mounted on<br>/dev/hd4 10747904 9441760 13% 1979 1% /<br>/dev/hd2 2883584 1645584 43% 28895 8% /usr<br>/dev/hd9var 2097152 1516452 28% 1805 1% /var
<br>/dev/hd3 2097152 1770068 16% 1460 1% /tmp<br>/dev/fwdump 262144 261776 1% 4 1% /var/adm/ras/platform<br>/dev/hd1 524288 522316 1% 129 1% /home<br>/proc - - - - - /proc
<br>/dev/hd10opt 262144 124436 53% 3135 11% /opt<br>/dev/fslv00 199229440 54806068 73% 48 1% /u02<br>/dev/fslv01 139460608 69130908 51% 131 1% /u03<br>/dev/u01lv 16515072 8830168 47% 20517 2% /u01
<br><br>Kind Regards,<br>Alex<br><br><div><span class="gmail_quote">On 7/17/06, <b class="gmail_sendername">Ton Voon</b> <<a href="mailto:ton.voon@altinity.com">ton.voon@altinity.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="">Alexander,<div><br></div><div>Can you please try the CVS snapshot: <a href="http://nagiosplug.sourceforge.net/snapshot" title="http://nagiosplug.sourceforge.net/snapshot" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://nagiosplug.sourceforge.net/snapshot</a> 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.</div><div><br>
</div><div>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).
</div><div><br></div><div>Ton</div><div><br><div></div><div><span class="e" id="q_10c7baf2ba589ab9_1"><div>On 17 Jul 2006, at 07:05, Alexander Harvey wrote:</div><br></span></div><div><blockquote type="cite"></blockquote>
</div><div><span class="e" id="q_10c7baf2ba589ab9_3">Actually, it still doesn't really work in AIX5L as it always finds the /proc filesystem to be of size -1%.<br><br>I've rewritten this plugin as a shell script for anyone else who might find this useful:
<br><br>#!/bin/ksh<br> # author: alex harvey<br># email: <a href="mailto:alexh19740110@gmail.com" title="mailto:alexh19740110@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">alexh19740110@gmail.com
</a><br><br>Usage ()<br>{<br> printf "Usage: %s: [-w warn] [-c crit]\n" $0<br> exit 3<br>}<br><br>wflag=<br> cflag=<br><br>while getopts w:c: opt<br>do<br> case $opt in<br> w) wflag=1<br> warn=$OPTARG
<br> ;;<br> c) cflag=1<br> crit=$OPTARG<br> ;;<br> ?) Usage<br> ;;<br> esac <br>done<br><br># too many arguments?<br>shift $(($OPTIND -1))<br>[ $# -ne 0 ] && Usage<br><br>
# missing warn or crit option?<br>[ ! -z "$wflag" ] && [ ! -z "$cflag" ] || Usage<br><br># chop the trailing % <br>warn=`echo $warn | sed -e 's/%$//'`<br>crit=`echo $crit | sed -e 's/%$//'`<br>
<br>mounts=`\<br> df -k |\<br> grep -v /proc |\<br> grep -v /var/adm/ras/platform |\<br> tail +2 |\<br> awk '{print $7}'`<br><br>STATE=0 <br><br>for i in $mounts; do<br> free_pcent=`df -k |\<br> awk -v input=$i '{if ($7 == input) print $4}' |\
<br> sed -e 's/%//'`<br> free_pcent=`echo 100 - $free_pcent | bc`<br> free_kb=`df -k |\<br> awk -v input=$i '{if ($7 == input) print $3}'` <br> if [ $free_pcent -le $warn ] && [ $STATE -le 1 ]; then<br>
STATE=1<br> mess="$mess, $free_kb kB (${free_pcent}%) free on $i"<br> fi<br> if [ $free_pcent -le $crit ]; then<br> STATE=2 <br> mess="$mess, $free_kb kB (${free_pcent}%) free on $i"
<br> fi<br>done<br><br>case $STATE in<br> 0) echo "DISK OK"<br> exit 0<br> ;;<br> 1) STATE_MESS=WARNING<br> ;;<br> 2) STATE_MESS=CRITICAL <br> ;;<br>esac<br><br>mess=`echo $mess | sed -e 's/^, //'`
<br>mess="DISK $STATE_MESS [$mess]"<br>echo $mess<br>exit $STATE<br><br><br>Kind Regards,<br>Alex<br><br><br><div>On 7/10/06, <b class="gmail_sendername">Alexander Harvey</b> <<a href="mailto:alexh19740110@gmail.com" title="mailto:alexh19740110@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
alexh19740110@gmail.com</a>> wrote:<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div>Well, I got this to work using the earlier version:
</div><div><br><br># ./plugins/check_disk -w 10% -c 5% -p /home<br></div><div>DISK OK - free space: /home 508 MB (99%);| /home=5MB;460;486;0;512 <br><br># ./plugins/check_disk --version<br>check_disk (nagios-plugins 1.4.2
) 1.57<br><br>Perhaps this is a bug?<br><br>Regards,<br>Alex</div><div><br><br><div>On 7/10/06, <b class="gmail_sendername">Alexander Harvey</b> < <a href="mailto:alexh19740110@gmail.com" title="mailto:alexh19740110@gmail.com (mailto:alexh19740110@gmail.com)" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
alexh19740110@gmail.com </a>> wrote:<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div>Hi,<br><br>Has anyone else had any problems using the latest check_disk
v1.64 plugin in AIX5.3?<br><br>Here's my list of filesystems:<br><br># df -k<br>Filesystem 1024-blocks Free %Used Iused %Iused Mounted on<br> /dev/hd4 10747904 1515560 86% 1975 1% /<br>/dev/hd2 2883584 1653188 43% 28814 8% /usr
<br>/dev/hd9var 2097152 1454828 31% 2898 1% /var<br>/dev/hd3 2097152 1770060 16% 1453 1% /tmp <br>/dev/fwdump 262144 261776 1% 4 1% /var/adm/ras/platform<br>/dev/hd1 524288 519920 1% 118 1% /home
<br>/proc - - - - - /proc<br> /dev/hd10opt 262144 125340 53% 3127 10% /opt<br>/dev/fslv00 167772160 23425268 87% 48 1% /u02<br>/dev/fslv01 139460608 69102616 51% 131 1% /u03
<br>/dev/u01lv 16515072 9477800 43% 22322 2% /u01 <br><br>1. First example of false or misleading output:<br><br># ./plugins/check_disk -w 10% -c 5%<br>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;1
6128
<br><br>(Looks like it's failing to understand the /proc entry?)<br><br>2. Second example of failed output:<br><br># ./plugins/check_disk -w 10% -c 5% -p /home<br>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<br>check_disk: Could not parse arguments<br>Usage: check_disk -w limit -c limit [-p path | -x device] [-t timeout][-m] [-e] [-W limit] [-K limit] [-v] [-q]
<br><br>3. Furthermore I noticed it failed the test in 'make test':<br><br>./t/check_disk......dubious<br> Test returned status 255 (wstat 65280, 0xff00)<br>DIED. FAILED tests 1, 3-32<br> Failed 31/32 tests,
3.12% okay<br><br>Anyone seen any of this before?<br><br>My configure options were:<br><br># ./configure --with-openssl=no --with-ipv6=no<br><br>Thanks in advance,<br><br>Alex Harvey<br><br> </div></blockquote></div><br>
</div></blockquote></div><br> <br><br></span></div><div><p align="center">This message has been scanned for viruses by <a href="http://www.MailController.altohiway.com/" title="http://www.MailController.altohiway.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
MailController</a>.</p><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">-------------------------------------------------------------------------</div><div style="margin: 0px;">Using Tomcat but need to do more? Need to support web services, security?
</div><div style="margin: 0px;">Get stuff done quickly with pre-integrated technology to make your job easier</div><div style="margin: 0px;">Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo</div>
<div style="margin: 0px;"><a href="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642" title="http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642</a></div><div style="margin: 0px;">_______________________________________________</div><div style="margin: 0px;">Nagios-users mailing list
</div><div style="margin: 0px;"><a href="mailto:Nagios-users@lists.sourceforge.net" title="mailto:Nagios-users@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nagios-users@lists.sourceforge.net
</a></div><div style="margin: 0px;"><a href="https://lists.sourceforge.net/lists/listinfo/nagios-users" title="https://lists.sourceforge.net/lists/listinfo/nagios-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.sourceforge.net/lists/listinfo/nagios-users</a></div><div style="margin: 0px;">::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.<span> </span></div><div style="margin: 0px;">
::: Messages without supporting info will risk being sent to /dev/null</div> </div><br></div><br><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;">
<div><br></div><div><br></div><div><a href="http://www.altinity.com" title="http://www.altinity.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.altinity.com</a></div><div>T: +44 (0)870 787 9243
</div><div>F: +44 (0)845 280 1725</div><div>Skype: tonvoon</div></span></span></span></span></span><br></span> </div><br></div>
</div></blockquote></div><br>