cpu 301 B

123456789101112
  1. #!/bin/bash
  2. source config.sh
  3. loadavg=$(cat /proc/loadavg | awk '{print $1}' )
  4. tmp_loadavg=$(echo "$loadavg * 100" | bc -l | cut -d'.' -f1)
  5. if [ $tmp_loadavg -ge 90 ]; then
  6. echo """
  7. hi
  8. i'm clara. a server Manager bot
  9. the server CPU Load average is greater than 0.9
  10. """ | mutt -s "CPU Lo" $email
  11. fi