23 lines
463 B
Bash

#!/bin/bash
ALERT=0
CORE=1
SENSORS=/usr/bin/sensors
for N in `$SENSORS|grep Core|cut -f 2 -d "+" | cut -f 1 -d "."`
do
if [ $N -gt "80" ];
then
echo "ALERT: CPU core $CORE temperature to high, $N degrees Celcius"
ALERT=1
else
echo "OK: CPU core $CORE Temperature $N degrees Celcius"
fi
CORE=$((CORE+1))
done
if [ $ALERT -eq "1" ];
then
exit 2
else
exit 0
fi