-1

I would like to configure monit tool If CPU usage > 10% then send top utilization process list by mail. how to configure with monitrc file.

check process all_process if cpu usage > 10% then exec("ps -Ao user,uid,comm,pid,pcpu,tty --sort=-pcpu | head -n 6") result to mail then alert

2 Answers2

0

This is going to be a very bad and chatty monitoring alert. I don't think it's effective to try to assess CPU utilization at the 10% threshold.

What are you really trying to accomplish?

ewwhite
  • 194,921
  • 91
  • 434
  • 799
  • Thanks Ewwhite for answering, I trying to configure e-mail alert for abnormal CPU utilization and long run process activity. so If I get process list when CPU reach beyond 10% it'll be helpful. – Arul Dhandapani Dec 22 '14 at 09:04
  • I able to receive CPU>10% report by mail using monit, and I would like to learn how to configure to get "top process" information by mail. Else if you have any other idea about my requirement let me know. – Arul Dhandapani Jan 13 '15 at 15:05
  • I'm not sure. You may have to script it. – ewwhite Jan 13 '15 at 15:06
-2

check process all_process if cpu usage > 10% then exec "/bin/bash -c 'ps -Ao user,uid,comm,pid,pcpu,tty --sort=-pcpu | head -n 6 | mail -s top admin@foo.bar'"

SimonM
  • 1