[collectd] cpu.c patch to capture average on linux

Daniel Hilst danielhilst at gmail.com
Wed Feb 8 19:09:01 CET 2012

I have made a patch to get average of cpu usage on linux. I read the 
first line of /proc/stat and
then divide the value by the number of cpus. It works on a lot of 
machines but on a slicehost machine
is reporting 200% idle. I know that cpu dont collectd in percentage, is 
jiffies but is still weird behavior
as on other machines works without problems

Here is the patch generated for such http://sprunge.us/LUSS

How can I debug this better? I can't grasp how the numbers of /proc/stat 
become 0 to 100~

Thanks for all,


More information about the collectd mailing list