X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=nagcollect.git;a=blobdiff_plain;f=client%2Flib%2Ftests%2FRAID.tst;h=3ce95d992d66991f1c69c1d05e48c892820b5d14;hp=d536e121a56034626cad2f8aa1e1a6334504e4a0;hb=ba1c1c91f1ff555dc53a95ba817035c8d0cc469f;hpb=6b76f2469e3b6ba5dfd12738cafcc33e64787c17 diff --git a/client/lib/tests/RAID.tst b/client/lib/tests/RAID.tst index d536e12..3ce95d9 100644 --- a/client/lib/tests/RAID.tst +++ b/client/lib/tests/RAID.tst @@ -1,5 +1,5 @@ # NagCollect -- Nagios Data Collector for Passive Checks -# Copyright (c)2009 Alexander Barton, alex@barton.de +# Copyright (c)2009-2010 Alexander Barton, alex@barton.de SERVICE="RAID_p" @@ -8,11 +8,13 @@ if [ `uname` = "Darwin" ]; then LC_ALL=C diskutil checkRAID >"$tmp" if [ $? -eq 0 ]; then # Apple Software-RAID detected - statusText=`grep "^Status:" "$tmp"` - status=`echo $statusText | cut -d' ' -f2-` + statusString1=`grep "^Status:" "$tmp" | uniq` + status=`echo $statusString1 | sed -e 's/Status: //g'` + statusString=`grep "^Status:" "$tmp"` + statusText=`echo $statusStringAll | sed -e 's/Status: //g' | sed -e 's/ /, /g'` if [ "$status" != "Online" ]; then STATUS=2 - TEXT="ERROR - RAID is $status" + TEXT="ERROR - RAID is $statusText" else STATUS=0 TEXT="OK - RAID status is good."