[hobbit] sar & cpu-utilization graph

Henrik Stoerner henrik at hswn.dk
Mon Dec 5 22:54:55 CET 2005

On Mon, Dec 05, 2005 at 02:37:18PM -0600, Jeff Newman wrote:
> My boss wants the cpu-utilization graph to reflect the statistics on a per
> cpu basis.
> Investigating, I see that sar can do this, while reporting similar data to
> vmstat (i.e. User, System Idle, average etc...) with
> the addition of a cpu number. Output:
> What is the easiest way to change the cpu utilization graph in hobbit to
> take advantage of this?
> It's one of those things that's either more complicated than it looks, or
> easier than I think :-)

"The devil is in the detail" ... but it really comes down to the same
issue as when you want to build graphs from some custom test you are

Your boxes should send in the "sar" data using a "data" or "status"
message. If you use a "status" message, you have the benefit (for
debugging) of having the raw data visible on your Hobbit display.
So use a custom column-name, like "sardata" or something unique.

Then you'll have to write a script to interpret these data, and save
them in an RRD file. The hobbitd_rrd tool does this for the standard
data, but you'll have to write your own module to interpret the data
from sar, and save it to one or more RRD files - see the hobbitd_rrd
man-page, the "Custom RRD data via scripts" section. You probably have
a varying number of CPU's in each box, so I'd suggest using one RRD file
for each CPU, and collecting the user/system/idle average for each CPU.
Then you can name the RRD files "sar.[cpu number].rrd".

Finally, build a graph definition in hobbitgraph.cfg to generate a graph
from the RRD files; look at one of the existing definitions and it
should be fairly doable. E.g. use the "la1-multi" definition as a
template for building a "sarcpu" graph definition.


More information about the Xymon mailing list