[geeks] getting CPU status in FreeBSD

Sridhar Ayengar ploopster at gmail.com
Thu Sep 13 14:36:49 CDT 2007


Charles Shannon Hendrix wrote:
>>> Does anyone know of a decent routine to get the CPU stats under FreeBSD?
>>>
>>> I basically just want a function that returns 0-100 for each CPU in the
>>> system so I can print the results to an LCD.
>>>
>>> I'm trying to dig this information out of top sources, but it's a real
>>> hairball, so I'm looking for something easier if I can find it.
>> I don't suppose you could write a little awk-ism to read it right out of 
>> top's console output?
> 
> No, this is an embedded LCD in an appliance system.

I don't know if that's relevant.  Just interact with the top process 
using pipes.

Or do you not have access to awk?

Peace...  Sridhar



More information about the geeks mailing list