I have this script:
#!/bin/bash
# rsync using variables
CPU=$(sar 1 5 | grep "Average" | sed 's/^.* //')
if [ $CPU -lt 100 ]
then
cat mail_content.html | /usr/lib/sendmail -t
else
echo "Normal"
fi
when I am executing it I am getting the following error message:
./monitor_cpu.sh: line 6: [: 99.25: integer expression expected
Normal
I want it to be able to identify that the number x.x (99.25) will be recognized which is not happening right now.