Xymon Mailing List Archive search

vmstat graphing with CPU io wait

list Henrik Størner
Mon, 24 Jan 2005 22:06:31 +0000 (UTC)
Message-Id: <ct3rh7$g1t$user-e356fad9864f@xymon.invalid>

In <user-1109dc7e0465@xymon.invalid> Tom Georgoulias <user-e7ef09aae711@xymon.invalid> writes:
My old BB setup has a customized vmstat-larrd.pl script which allows for 
 variations in vmstat output based on the version of procps.  In other 
words, it compensates for the fact that RHEL3 and old red hat linux 
systems have vmstat output who's column ordering doesn't match up.
Hobbit knows these two layouts of the vmstat data as "linux" and
"debian3", the latter being the one for the older linux versions
(essentially, systems running vmstat for a Linux 2.2 kernel).

So I'd like to bring some of those vmstat changes into my new hobbit 
setup, most notably the ability to plot CPU wait for IO (wa) alongside 
user, system & idle time, but poking around in hobbitgraph.cfg doesn't 
reveal an easy way to do it.
Any tips on how I might accomplish this?
As with LARRD, there are two steps: Collecting the data, and
displaying them.

Data collection is handled by hobbitd_larrd. The interesting stuff
here is in hobbitd/do_larrd.c, and hobbitd/larrd/*.c . do_larrd.c
determines which function should parse an incoming status or data
message, by looking at the name of the "status" or "data" name.
It also consults the LARRDS environment variable, e.g. to figure out
that "ftp" is handled by the "tcp" parser. Each type of RRD file then
has it's own little routine in one of the hobbitd/larrd/*.c files to
pick out the interesting data, and put it into the RRD file.

Where do you get the I/O wait information from ?


Data display is handled by hobbitgraph.cgi, and the config file
hobbitgraph.cfg. This is very similar to the looong set of 
definitions in larrd-grapher.cgi, except that you need not worry about
hostnames in the RRD files, because Hobbit keeps all RRD files for a
given host in a separate directory. So e.g. the "vmstat" graph can
just get the CPU idle-time value with

     DEF:cpu_idl=vmstat.rrd:cpu_idl:AVERAGE

i.e. grab the "vmstat.rrd" file, and extract the current average value
of the "cpu_idl" dataset.

You can mix values from different RRD files in the same graph,
e.g. the "vmstat2" graph uses both the "vmstat.rrd" file and the
"la.rrd" file:

	DEF:avg=la.rrd:la:AVERAGE
        CDEF:la=avg,100,/
        DEF:cpu_idl=vmstat.rrd:cpu_idl:AVERAGE
        CDEF:cpu_idl2=cpu_idl,100,/


If you have more questions, please ask. And if you have something that
could be of interest to others, I'll be happy to include it with
Hobbit.


Regards,
Henrik