您的位置:首页 > 其它

HP服务器阵列状态检测报警

2012-09-04 16:27 344 查看
软件环境:

OS:CentOS 5.X/6.X

软件:mail/hpacucli

检测脚本:

Raid_monitor.sh:

#/bin/sh
#get the Raid status
/usr/sbin/hpacucli ctrl all show config > /tmp/raidstatus.txt
#set the Variables
Check_Hour="`date +%m%d-%H`"
Disk_Num=5
Mail_Add=noc@domain.com
Subject="`hostname` Raid Alarm!!"
Statusfile="/tmp/raidstatus.txt"
OK_Num=`grep OK $Statusfile|wc -l`
#Alarms
if [ $OK_Num -le $Disk_Num ];then
mail -s "$Subject" $Mail_Add < $Statusfile
else
echo "$Check_Hour `hostname`'s Raid Status is OK"
fi
exit 0;

频率设定:

0 */6 * * * /home/Raid_monitor.sh >> /home/Raid_status.log


本文出自 “鼠标爱上键盘” 博客,转载请与作者联系!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: