6

I need to monitor CPU usage by a given process and each of its threads.
For each of them I want to have:

  • average and maximum CPU usage percent,
  • total CPU time used during the captured period,
  • a graph of CPU usage over time,
  • all the above for user and system mode separately.

I've found some references to sysstat/sar, collectd, munin, naggios, but I'm not sure whether they have the features I need.

The system is Ubuntu Hardy.

2 Answers 2

3

Ouch.. that's quite a task.

Software like Munin, cacti or zabbix would probably be most suited and would easily cover the 1st and 3rd points. I suspect Munin is possibly the easiest of the three for those points. The 2nd and 4th are slightly trickier. I'm not sure of any monitoring system that might provide you with total CPU time for a period. Usually system metric collection is focussed around the idea of "Whats going wrong" rather than system accounting. Hopefully someone else might have a suggestion.

As a starting point for point 4, you need to enable the process accounting features, something that's been integral to Linux for a while. There is some good detail here: http://shibuvarkala.blogspot.com/2009/04/howto-enable-process-accounting-in.html that will get you started with enabling process accounting and reading information it returns.

One reason for suggesting Munin is that it's relatively trivial to write plugins for, and I suspect you'll need to for what you're trying to achieve.

Wish I could be more help.

0

Here is a plugin that can monitor processes seperately. https://redmine.koumbit.net/projects/munin-contrib/repository/revisions/256709738d6a15b80715d91de4b7af55f1e3905e/entry/plugins/processes/multicpu

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .