]> arthur.barton.de Git - nagcollect.git/blobdiff - client/lib/tests/RAID.tst
RAID.tst: suppress warning and error messages
[nagcollect.git] / client / lib / tests / RAID.tst
index 53c57b2557f508ce2b57562279306793b4da5215..d814588d4f83dd27316e8e84b84d97502850f525 100644 (file)
@@ -5,7 +5,7 @@ SERVICE="RAID_p"
 
 if [ `uname` = "Darwin" ]; then
        tmp=`mktemp "/tmp/$$.XXXX"`
-       LC_ALL=C diskutil checkRAID >"$tmp"
+       LC_ALL=C diskutil checkRAID >"$tmp" 2>/dev/null
        if [ $? -eq 0 ]; then
                # Apple Software-RAID detected
                statusString1=`grep "^Status:" "$tmp" | uniq`
@@ -20,7 +20,7 @@ if [ `uname` = "Darwin" ]; then
                        TEXT="OK - RAID status is good."
                fi
        fi
-       LC_ALL=C raidutil list status | grep "RAID " >"$tmp"
+       LC_ALL=C raidutil list status 2>/dev/null | grep "RAID " >"$tmp"
        if [ $? -eq 0 ]; then
                # Apple Hardware-RAID detected
                declare -i good=0
@@ -28,11 +28,12 @@ if [ `uname` = "Darwin" ]; then
                status=""
                while read x; do
                        v=`echo "$x" | cut -d' ' -f1`
-                       s=`echo "$x" | cut -b78-`
+                       s=`echo "$x" | cut -b67- | sed -e 's/://g'`
+                       s2=`echo "$x" | cut -b78-`
                        [ -n "$status" ] \
-                               && status="$status $v:$s" \
+                               && status="$status, $v:$s" \
                                || status="$v:$s"
-                       [ "$s" = "Good" ] && good=$good+1 || bad=bad+1
+                       [ "$s2" = "Good" ] && good=$good+1 || bad=bad+1
                done <"$tmp"
                if [ $bad -eq 0 -a $good -ge 1 ]; then
                        STATUS=0