]> arthur.barton.de Git - nagcollect.git/blob - client/lib/tests/RAID.tst
Remove whitespaces from RAID status text
[nagcollect.git] / client / lib / tests / RAID.tst
1 # NagCollect -- Nagios Data Collector for Passive Checks
2 # Copyright (c)2009 Alexander Barton, alex@barton.de
3
4 SERVICE="RAID_p"
5
6 if [ `uname` = "Darwin" ]; then
7         tmp=`mktemp "/tmp/$$.XXXX"`
8         LC_ALL=C diskutil checkRAID >"$tmp"
9         if [ $? -eq 0 ]; then
10                 # Apple Software-RAID detected
11                 statusText=`grep "^Status:" "$tmp"`
12                 status=`echo $statusText | cut -d' ' -f2-`
13                 if [ "$status" != "Online" ]; then
14                         STATUS=2
15                         TEXT="ERROR - RAID is $status"
16                 else
17                         STATUS=0
18                         TEXT="OK - RAID status is good."
19                 fi
20         fi
21         rm -f "$tmp"
22 fi