Monit system cpu usage

cpu-usagemonitmonitoringubuntu-10.04

Monit version: 5.0.3
Server: Ubuntu 10.04.4 LTS

I want to monitor the system cpu usage with Monit and I am trying as follows:

check system host_name
   if cpu usage (user) > 70% then alert
   if cpu usage (system) > 30% then alert
   if cpu usage (wait) > 20% then alert

But when I use this command:

monit -v

The response is:

'host_name' cpu wait usage check succeeded [current cpu wait usage=-1.0%]
'host_name' cpu system usage check succeeded [current cpu system usage=-1.0%]
'host_name' cpu user usage check succeeded [current cpu user usage=-1.0%] 

I guess it is not working 🙂 Why do I get this message? The cpu usage is not -1.0% of course, so why do I get this false result?

Best Answer

I think you have this result because no check has already been performed.

I would suggest to edit file /etc/monit/monitrc and uncomment line :

set daemon  120

Then restart monit : /etc/init.d/monit restart

Should be OK.

The fact is that your monit version comes with a control file fully commented.