标签:监控hp cpu温度
监控HP服务器CPU温度的脚本:
#!/bin/bash
Name=`hostname`
IP=`/sbin/ifconfig eth0 | grep "inet addr" | awk -F[:" "]+ ‘{print $4}‘`
Date=`date +%m%d%y`
Date2=`date +%H:%M`
Num=`/usr/sbin/dmidecode | grep -i ‘serial number‘ | head -n 1`
CPU1=`/sbin/hpasmcli -s "show temp" | grep CPU#2 | awk -F[:" "]+ ‘{print $3}‘ | cut -b 1-2`
CPU2=`/sbin/hpasmcli -s "show temp" | grep CPU#3 | awk -F[:" "]+ ‘{print $3}‘ | cut -b 1-2`
CPU3=60
if [ $(echo "$CPU1 > $CPU3" | bc) -eq 1 ] || [ $(echo "$CPU2 > $CPU3" | bc) -eq 1 ]
then
/usr/bin/touch /log/CPU/hot.log
/bin/echo "$Name($IP) CPU1 is $CPU1 C and CPU2 is $CPU2 C at $Date2" > /log/CPU/hot.log
/usr/bin/mail -s "$Name($IP) Load is $Load" zhi.yang@ming.com < /log/Load/$Date.log
fi
本文出自 “linux” 博客,请务必保留此出处http://yangzhiming.blog.51cto.com/4849999/1701323
标签:监控hp cpu温度
原文地址:http://yangzhiming.blog.51cto.com/4849999/1701323