On Tue, 23 Jan 2001, Patrick Aland wrote:
> Sorry to reply again but is there a metric for the time the entry was made?
As I was working on the quick and dirty script I noticed this short
coming, and had a bet with myself on how long it would take someone
else to notice.
I won the bet.
There is now a "-e" option to pmie, and this produces output like ...
load_1 (Wed Jan 24 15:24:13 2001): 0.57
idle (Wed Jan 24 15:24:13 2001): 11.0
EOL (Wed Jan 24 15:24:13 2001): 12
I'll add this in the next open source release, and mail the trivial
patch here in the interim.
To convert pmie2col to recognize this new format and report accordingly
is left as an exercise for the reader.
> > On Wed, Jan 24, 2001 at 10:37:32AM +1100, Ken McDonell wrote:
> > > On Tue, 23 Jan 2001, Patrick Aland wrote:
> > >
> > > > Which program will take the pcp data and output it in a certain format?
> > > > Mainly I am looking to use our current system which take logs of the
> > > > form
> > > >
> > > > [column1_name] [column2_name] ... [columnx_name]
> > > > [column1_data] [column2_data] ... [columnx_data]
> > > > [column1_data] [column2_data] ... [columnx_data]
> > > > [column1_data] [column2_data] ... [columnx_data]
> > > > [column1_data] [column2_data] ... [columnx_data]
> > > >
> > > > I think i could use pmie to do this but am not sure. Any help is
> > > > appreciated. Thanks.
> > >
> > > depends a little ... can you expand on what columnx_name might be?
> > >
> > > If these are instance of a single metric, pmval will do this
> > > out of the box.
> > >
> > > If these are different metrics (with or without instances), then
> > > if you have the IRIX or pcp-pro pieces, pmdumptext will do this,
> > > otherwise something like ...
> > >
> > > cat <<End-of-File \
> > > | pmie \
> > > | some-awk
> > > column1_name=some expression;
> > > column2_name=some other expression;
> > > column3_name=a third expression;
> > > ...
> > > End-of-File
> > >
> > > To be more concrete, here's a pmie script ...
> > >
> > > load_1 = kernel.all.load #'1 minute';
> > > idle = kernel.all.cpu.idle;
> > > EOL = hinv.ncpu;
> > >
> > > The EOL line is a sentinel and special in what follows, so there
> > > are 2 metrics being reported here.
> > >
> > > Running pmie -v produces ...
> > >
> > > load_1: 3.70
> > > idle: ?
> > > EOL: 12
> > >
> > > load_1: 3.55
> > > idle: 8.3
> > > EOL: 12
> > >
> > > load_1: 3.20
> > > idle: 9.9
> > > EOL: 12
> > >
> > > load_1: 3.04
> > > idle: 9.4
> > > EOL: 12
> > >
> > > load_1: 3.22
> > > idle: 8.6
> > > EOL: 12
> > >
> > > Now feed this to pmie2col (a quick and dirty awk script, copy attached)
> > > and you get ...
> > >
> > > load_1: idle:
> > > 3.70 ?
> > > 3.55 8.30
> > > 3.20 9.90
> > > 3.04 9.40
> > > 3.22 8.60
> > >
> >
> > Content-Description: pmie2col
> > > #!/bin/sh
> > > #
> > > # convert pmie
> > > #
> > >
> > > awk '
> > > NF == 0 { next }
> > > state == 0 && $1 == "EOL:" { print ""; ncol = i; state = 1 }
> > > state == 0 { printf " %7.7s",$1 }
> > > $1 == "EOL:" { for (i = 0; i < ncol; i++) {
> > > if (v[i] == "?") printf " %7.7s","?"
> > > else printf " %7.2f",v[i]
> > > v[i] = "?"
> > > }
> > > print ""
> > > i = 0
> > > next
> > > }
> > > { v[i++] = $2 }'
> >
> >
> > --
> > ------------------------------------------------------------
> > Patrick Aland paland@xxxxxxxxxxx
> > Network Administrator Voice: 904.822.7217
> > Stetson University Fax: 904.822.7367
> > ------------------------------------------------------------
>
> --
> ------------------------------------------------------------
> Patrick Aland paland@xxxxxxxxxxx
> Network Administrator Voice: 904.822.7217
> Stetson University Fax: 904.822.7367
> ------------------------------------------------------------
>
patch
Description: pmie patch for -e
|