Linux CPU monitoring

I would like to request a shell script to run in the background to monitor high CPU using run queue and load . When it reach load average of 3 then send an email to admin
Who is Participating?
simon3270Connect With a Mentor Commented:
while true; do
  if [ $(uptime | awk -F '[ ,.]*' 'NR == 1{print $9}') -ge 3 ]; then
    w | mail -s "Load too high"
  sleep 60

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.