[collectd] cpu stats on SMP machines

Doug MacEachern doug.maceachern at springsource.com
Wed Sep 23 20:36:26 CEST 2009


On Sep 19, 2009, at 1:39 PM, Florian Forster wrote:

> Hi Bill,
>
> On Sat, Sep 19, 2009 at 11:22:12AM -0500, Bill Harris wrote:
>> I was just curious, is the current cpu plugin limited to values for a
>> single cpu (or combined) on a given platform?   I looked at the
>> roadmap, but couldn¹t determine if that was in the plans, or already
>> exists ( and I don¹t know how to configure it).
>>
>> Have recently upgrade an HP Proliant DL580 to 4 cpus (8 cores) and  
>> was
>> curious.
>>
>> Btw, 4.8 compiles and runs great on that machine with FreeBSD 7.2-R
>
> I haven't checked in a while, but the reason for this is actually
> FreeBSD: On FreeBSD information about the CPU usage is read using
> sysctlbyname (or sysctl, I'm not quite sure). Other BSDs (dunno which
> ones, sorry) provide the {CTL_KERN, KERN_CPTIME2, <num>} MIB, which
> returns the CPU counters for the specified CPU <num>. Unfortunately,
> FreeBSD doesn't. It only offers the sysctlbyname interface with the
> "kern.cp_time" key, which only returns consolidated numbers.
>
> If you find out how to get the values, adding that to the CPU plugin  
> is
> probably not much work.

"kern.cp_times" as of 7.0-ish: http://github.com/hyperic/sigar/commit/039080f722b66d825e557d941986eca0e3956ab4
I can make a patch later this week unless somebody else wants to.

-Doug

> Regards,
> —octo
> -- 
> Florian octo Forster
> Hacker in training
> GnuPG: 0x91523C3D
> http://verplant.org/
> <signature.asc><ATT00001.c>




More information about the collectd mailing list