#!/bin/bash
DATE=`date +%Y-%m%d-%H%M`
SMS_DATE=`date +%Y%m%d%H%M%S`
SMS_QUERY="xxxxxxxxxxxxxxxxxxxxx"
RAID_CHECK=`/usr/local/bin/tw_cli info |/bin/awk '{print $1}' |/bin/grep -w "c[0-9]" |while read a; do /usr/local/bin/tw_cli info $a ;done |/bin/egrep -v -i '\--|OK|RAID|Port|Unit' |/bin/sed '/^[[:space:]]*$/d' |/bin/awk '{print "Port:"$1, " Status:"$2, $4, $5, " Serial:"$7}'`
SMS_MSG="RAID ERROR [`/bin/hostname`] ${RAID_CHECK}"
if [ -z "${RAID_CHECK}" ]; then
exit;
else
echo "${DATE} RAID ERROR ${SMS_MSG}" >> /var/log/raid_check.log
echo "${SMS_MSG}"
echo "¹®ÀÚ¹ß¼Û Äõ¸®"
fi