公司本来有个用手机卡发短信报警的小东东。但经常欠费。NND。。。
用linux+ipmitool+fetion来做机房温度免费报警
1.要在dell服务器上配置好IPMI (很简单的)
2.监控OS平台Linux 安装 Fetion 和IPMITool
3.写个shell脚本如下:
log_day=`date +%Y%m%d`;
to_day=`date +%Y%m%d,%H:%M:%S`;
set Darfon;
logfile=/usr/local/ipmi/log/ipmi$log_day.log;
Darfon=$(/usr/local/ipmi/bin/ipmitool -H 10.83.201.211 -U root -P ******(密码) sensor get "Ambient Temp"| /bin/grep -i "Sensor Reading"|/bin/cut -c 26-28);
if [ $Darfon -ge 30 ]; then
/usr/local/fetion/fetion --mobile 139******** -- --pwd=dfs123 --to=134******** --msg-utf8="WARNING-Darfon Host Housing Temperature:$Darfon 'C";
echo $to_day"::WARNING-Darfon Host Housing Temperature:$Darfon 'C" >> $logfile
exit 1
fi
echo $to_day"::Darfon Host Housing Temperature:$Darfon 'C" >> $logfile;
DELL机器的ipmi连接默认密码是:calvin
4.把shell文件放入crontab中每半小时运行一次。就OK
阅读(1796) | 评论(0) | 转发(0) |