I have written a script which checks server load and emails me.
I am running into the error:
./load_alert.sh: line 8: [: 1.25: integer expression expected
What am i doing wrong here?
# Get the server load last minute
svrcpuload=`uptime|awk '{ print $11 }'|perl -pe 's/.$//'`
svrcpuload=`expr $svrcpuload`
threshold=10.00
threshold=`expr $threshold`
echo "Server cpu load " $svrcpuload
echo "Threshold is " $threshold
if [ $svrcpuload -gt $threshold ]; then
printf "WARNING - cpu load high in xyz server"
fi