Issue: We have HSG80/HSG60/HSZ70 SANs and the StorageWork agent installed on the different servers as steamd daemon doesn’t inform the system administrator(s) the concrete status of faield disks on the SANs. Every time, to check the status of disks on SA we have to connect to the SAN via serial connection and run the command SHOW FAILED


#!/bin/sh
#
exec expect -f "$0"
spawn /usr/bin/minicom -C temp.txt
expect "hsg80_2>"
send "show failedr"
sleep 2
send "exitr"
expect eof
Script checkhsg80.sh

#!/bin/sh
# created by Vinh Le <vinhlg_at_vcomtech.net> June 2007
# second script
ADMINS=systemadmin@vcomtech.net,vinhlg@vcomtech.net
./checkhsg80.sh
#kill -HUP `ps -ef | grep minicom | awk -F" " ' { print $2 } '`
FAILED=`cat temp.txt | grep FAILEDSET | awk -F" " ' { print $3 }' `
if [ "$FAILED" != "" ]; then
 cat ./temp.txt | mail -s "Warning: Failed disk(s) on HSG80" $ADMINS
else
# echo "HSG80 is OK" |  mail -s "SAN HSG 80 is OK" systemadmin@vcomtech.net
fi
rm -f temp.txt

Script checkhsg80b.sh

Set this script running as cron job. It checks the SAN every hour.
0 * * * * /root/checkhsg80b.sh > /dev/null 2>&1