Initial commit
This commit is contained in:
commit
b78154d176
8 changed files with 84 additions and 0 deletions
19
check-temp.sh
Executable file
19
check-temp.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
IPMIHOST=`cat /host.txt`
|
||||
IPMIUSER=`cat /user.txt`
|
||||
IPMIPW=`cat /pw.txt`
|
||||
FANSPEED=`cat /fanspeed.txt`
|
||||
|
||||
MAXTEMP=32
|
||||
|
||||
TEMP=$(ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW sdr type temperature |grep Ambient |grep degrees |grep -Po '\d{2}' | tail -1)
|
||||
|
||||
echo "Current Temp is $TEMP C"
|
||||
if [ $TEMP -gt $MAXTEMP ];
|
||||
then
|
||||
echo "Temp is too high. Activating dynamic fan control"
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x01
|
||||
else
|
||||
echo "Temp is OK. Using manual fan control"
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x01 0x00
|
||||
ipmitool -I lanplus -H $IPMIHOST -U $IPMIUSER -P $IPMIPW raw 0x30 0x30 0x02 0xff $FANSPEED
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue