AIX vmstat patch

Stef Coene stef.coene at docum.org
Tue Mar 13 11:14:41 CET 2007


Hi,

I patched the code for processing vmstat data.
The vmstat command on AIX has 2 extra fields if you are using Power5: pc and 
ec (physical processors used and used entitled capacity).  I added 2 
definitions to the vmstat template online 79.
I also had to strip . from the vmstat numbers because pc and ec are not 
integers.

See also http://www.docum.org/twiki/bin/view/Hobbit/AixPower5

diff -r hobbit-4.2.0/hobbitd/rrd/do_vmstat.c 
hobbit-4.2.0.ori/hobbitd/rrd/do_vmstat.c
79,80d78
<       { 17, "cpu_pc" },
<       { 18, "cpu_ec" },
327,333d324
<
<       /* Removing . from the numbers */
<       char *p1;
<       while ( (p1 = strchr(p,'.')) != NULL ) {
<          strcpy (p1, p1+1) ;
<       }
<

The main problem is that the vmstat.rrd file is not compatible with older 
versions :(  So you have to convert the rrd file manually or remove it.

To plot the numbers, add this to hobbitgraph.cfg:

[vmstat-ec]
        TITLE Used Entitled CPU Capacity
        YAXIS ec %
        -b 1024
        DEF:ec=vmstat.rrd:cpu_ec:AVERAGE
        LINE2:ec#00CC00
        GPRINT:ec:LAST:ec \: %5.1lf%s%% (cur)
        GPRINT:ec:MAX: \: %5.1lf%s%% (max)
        GPRINT:ec:MIN: \: %5.1lf%s%% (min)
        GPRINT:ec:AVERAGE: \: %5.1lf%s%% (avg)\n
[vmstat-pc]
        TITLE Used Physical CPU
        YAXIS pc (100 = 1 CPU)
        -b 1024
        DEF:pc=vmstat.rrd:cpu_pc:AVERAGE
        LINE2:pc#00CC00
        GPRINT:pc:LAST:pc \: %5.1lf%s (cur)
        GPRINT:pc:MAX: \: %5.1lf%s (max)
        GPRINT:pc:MIN: \: %5.1lf%s (min)
        GPRINT:pc:AVERAGE: \: %5.1lf%s (avg)\n


and TRENDS:*vmstat:vmstat1|vmstat-pc|vmstat-ec|vmstat8 to the hosts in 
bb-hosts.


Stef



More information about the Xymon mailing list