summaryrefslogtreecommitdiff
path: root/sysutils/arcconf/files/410.status-aac-raid.in
blob: 6fabbff7d766c4c7f80ce6c8a2a8518f695e65f1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
 
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi
 
case "$daily_status_aac_raid_enable" in
    [Yy][Ee][Ss])
        echo
        echo 'Checking status of Adaptec RAID:'
 
        rc=0
        arcconf=/usr/local/sbin/arcconf
        tmpfile=`mktemp -q /tmp/aac-raid.XXXXXX`
        $arcconf GETCONFIG 1 AD | tee $tmpfile
        control_ok=`grep -i -c 'Controller Status.*Optimal' $tmpfile`
        $arcconf GETCONFIG 1 LD | tee $tmpfile
        volume_ok=`grep -i -c 'Status of logical device.*Optimal' $tmpfile`
        rm $tmpfile
        if [ $control_ok -eq 0 -o $volume_ok -eq 0 ]; then
            rc=3
        fi
        ;;
 
    *)  rc=0;;
esac
 
exit $rc