pcp
[Top] [All Lists]

Re: a PMDA using another PMDA

To: Nathan Scott <nathans@xxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: a PMDA using another PMDA
From: Mark Goodwin <markgw@xxxxxxx>
Date: Tue, 17 Jul 2001 13:17:31 +1000 (EST)
Cc: gilly@xxxxxxxxxx, pcp@xxxxxxxxxxx
In-reply-to: <10107171212.ZM204950@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-pcp@xxxxxxxxxxx
On Tue, 17 Jul 2001, Nathan Scott wrote:

> Yes, that is possible.  In fact on IRIX & in pcp-pro there
> is a configurable "summary" PMDA which used pmie(1) to do
> just this sort of thing.

Specifically, see the -x flag to pmie. This tells pmie to periodically 
send PDUs rather than print results. A really nice feature of pmie
is that the PDU's sent by pmie can contain metric values that have
been derived as arbitrary expressions of other metric values from
one or multiple hosts, even localhost. Your PCP agent should fork, then dup
stdin/stdout and exec pmie -x. Your agent also needs to add pmie's
file descriptor to it's select mask. To do this you need to provide your
own pmdaMainLoop; read the man page for pmdaMain(3) and then base your
agent's main loop on the code in src/libpcp_pmda/src/mainloop.c. When
pmie sends something, your agent will wake up, read the new value(s)
and cache locally.

> 
> > Does it matter if the PMDA's are installed as DSO?
> 
> Do you mean in general or in this particular instance?  See
> my mail to the list from the other day for some thoughts on
> this topic.

I would not advise a DSO agent that fiddles with the select mask.
(pmcd's select loop is already complicated enough).

-- Mark


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