[collectd] curl_xml plugin

Amit Gupta amit.gupta221 at gmail.com
Wed Dec 30 14:10:19 CET 2009


On Tue, Dec 29, 2009 at 9:23 PM, Sebastian Harl <sh at tokkee.org> wrote:

> Hi Amit,
>
> On Tue, Dec 29, 2009 at 07:24:46PM +0530, Amit Gupta wrote:
> > On Tue, Dec 29, 2009 at 3:31 PM, Amit Gupta <amit.gupta221 at gmail.com>
> wrote:
> > > On Mon, Dec 21, 2009 at 11:59 PM, Florian Forster <octo at verplant.org
> >wrote:
> > > Just a clarification, "Instance" here will be type_instance(s) and thus
> can
> > > be anything (not just xpath), right?
> >
> > I guess I understood why "Instance" has to be a xpath expression if
> "table"
> > is true. Instance xpath would return list of values which will be used as
> > type_instances for multiple type values returned by evaluating xpaths in
> > "Values". Is my understanding correct?.
>
> Yep, that's right.
>
> If "Table" is false, a simple string would be sufficient as well, but
> changing the semantics of "Instance" depending on "Table" would be
> confusing -- also, people might still want to fetch the instance from
> the XML file.
>
> Other plugins (e.g., postgresql) handle that by introducing an option
> called "InstancePrefix" which expects a string as argument. That string
> is prepended to the type_instance.
>
> If "Table" is false, "Instance" would be optional, thus making it
> possible to specify a constant string as type_instance using "Instance-
> Prefix".
>

Thanks for the detailed explanation.

I was thinking about the implementation of the suggested configuration and
it seems that the implementation can be simpler if we consider the following
approach:

The evaluation of the <base_xpath> (i.e argument to the XPATH element) will
return either of the following:
   a.) Single result: This can be assumed as "Table" false case. The
relative xpath expression(s) in "Values" is/are always expected to return
one text node/attribute result.
   b.) Multiple results : This can be assumed as "Table" true case.
"Instance" xpath expression will be evaluated and result(s) will be stored
in a list.  Multiple results will be iterated and the relative xpath(s) in
"Values" will be evaluated relative to each of the result (node) [the
result(s) of the relative xpath(s) can be dispatched to the rrd file at the
same time]. The relative xpath expression(s) in "Values" is/are always
expected to return one text node/attribute result.

Do note that "Table" won't be required since single/multiple result(s) of
the <base_xpath> evaluation can be used for the same as described above.

Does this make sense?. Let me know if something is unclear.

Regards
Amit

>
> Cheers,
> Sebastian
>
> --
> Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/
>
> Those who would give up Essential Liberty to purchase a little Temporary
> Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAks6JgcACgkQEFEKc4UBx/zbtQCfWIIVzQr9nhm1sHZPpedUkmRV
> W7AAmwfaoj4/EhrGveBDh7yCbbJ7EUVv
> =NM8M
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20091230/272e03ff/attachment.htm 


More information about the collectd mailing list