-3

I have a CentOS server running on a VPS via Virtuozoo containers.

I feel like there are high CPU usage spikes. Is there a way I can log every time CPU usage goes beyond a certain limit lets say 50%.

Thanks

HTTP500
  • 4,833
  • 4
  • 23
  • 31
kritya
  • 97
  • 2

2 Answers2

1

Monit can do that:

check system localhost.localdomain.tld
    if loadavg (1min) > 5 for 6 cycles then alert
    if loadavg (5min) > 2 for 3 cycles then alert
    if loadavg (15min) > 2 for 2 cycles then alert
    if memory usage > 90% for 6 cycles then alert
    if cpu usage (user) > 75% for 6 cycles then alert
    if cpu usage (system) > 75% for 6 cycles then alert
    if cpu usage (wait) > 75% for 6 cycles then alert
petrus
  • 5,297
  • 26
  • 42
0

Look into munin and graphite, both are excellent and free tools for system management.

Stephan
  • 999
  • 7
  • 11
  • wouldn't munin just monitor things like apache instead ? – kritya Feb 05 '13 at 21:24
  • Munin can log all kinds of things. Here's an example: http://imageshack.us/photo/my-images/46/cpur.png/ – Stephan Feb 05 '13 at 21:28
  • is that in the normal configuration ? if no , how do configure it to log CPU ? – kritya Feb 05 '13 at 21:32
  • Your question is a little out of the scope of this comment. Here's one approach. http://www.howtoforge.com/server_monitoring_monit_munin – Stephan Feb 05 '13 at 21:38
  • If this is an _answer_, answering the question shouldn't be out of scope. If this is just a comment, it shouldn't be an _answer_. – mattdm Feb 05 '13 at 23:28