pcp
[Top] [All Lists]

Re: pmval quietness &c

To: tfb@xxxxxxxx
Subject: Re: pmval quietness &c
From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
Date: Tue, 23 Dec 2003 12:37:09 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <E1AYNRU-00038B-0U@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: pcp-bounce@xxxxxxxxxxx
On Mon, 22 Dec 2003 tfb@xxxxxxxx wrote:

> I want to use pcp to generate some statistics which I'm going to
> draw pictures of, on linux boxes.  What I'm doing is using pmval to
> generate numbers, and then feeding this to gnuplot to make gifs &c.
> Obviously this is a bit primitive compared to the tools available on
> SGIs, but it works OK.
>
> Before I reinvent too many wheels, are there better tools (or even
> the same tools written by someone else!) to do this under Linux? I
> can't see any referenced, but I may well be missing something.

pmval is limited by only being able to report multiple instances of a
single metric.

pmie with the -v option is much more general, and has less formatting
fluff around the output.  I have appended some old mail on this subject
and the pmie2col script is attached.

> I have some (slightly ad-hoc) patches to pmval to make it a good
> deal less verbose, so you don't need to do lots of work to strip off
> all the headers &c when feeding it to a script.  Controlled by a switch
> (-q).  Would patches like this be interesting? I can clean them up &
> send them if so. May be there's a better tools than pmval for
> extracting data though.

Patches that are backwards compatible, consistent with PCP the command
line options rules, and add value are always of interest ... send 'em
on down.

> Finally, the installation scripts for various of the pmdas really
> won't work unless run interactively & make various assumptions about
> things which I'd rather they didn't.  For instance the weblog pmda is
> very hard to install noninteractively, and almost impossible to install
> unless it can find an existing server to log.  It ought to be possible
> to have a script which says `just install yourself with a config file
> which does nothing, I will edit it to tell you where the servers are
> later'.  I have a really hacky fix for this, but it's too hacky to use
> for real (it just replaces one of the scripts with one that just
> lies).

I think this is a deeper issue ... many of the PMDAs won't work at all
without a half-sane configuration.  Many of the PMDAs already work with
non-interactive or /dev/null input.

In the case of the weblog PMDA ... there is a script that is supposed
to find the activity logs for a variety of web servers
(/var/pcp/pmdas/weblog/server.sh) if this cannot find your web server
activity logs, then (a) fix the script and send the patches in, else
(b) use the environment variables of the form $FOOPATH in the script to
guide the search for your activity logs.

------
> Date: Wed, 24 Jan 2001 10:37:32 +1100
> From: Ken McDonell <kenmcd@xxxxxxxxxxxxxxxxx>
> To: Patrick Aland <paland@xxxxxxxxxxx>
> cc: pcp@xxxxxxxxxxx
> Subject: Re: Output format
>
> 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

Attachment: pmie2col
Description: pmie2col

<Prev in Thread] Current Thread [Next in Thread>