[geeks] getting CPU status in FreeBSD

Patrick Giagnocavo patrick at zill.net
Thu Sep 13 13:21:19 CDT 2007


On Sep 13, 2007, at 1:49 PM, 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 would think that vmstat | awk -F {print $11}
  or whatever would suffice, depending on whether you wanted to show  
cpu idle or cpu busy.

Digging  into the source of vmstat would probably be much easier as  
well.
> -- 
> shannon           | An Irishman is never drunk as long as he can  
> hold onto
>                   | one blade of grass and not fall off the face of  
> the earth.
> _______________________________________________
> GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks

Cordially

Patrick Giagnocavo
patrick at zill.net



More information about the geeks mailing list