[collectd] curl_xml plugin
Amit Gupta
amit.gupta221 at gmail.com
Tue Dec 29 11:01:04 CET 2009
On Mon, Dec 21, 2009 at 11:59 PM, Florian Forster <octo at verplant.org> wrote:
> Hi Amit,
>
> On Mon, Dec 21, 2009 at 02:11:01PM +0530, Amit Gupta wrote:
>
> > > > I have been working on curl_xml plugin. The idea of this plugin is
> > > > to query the xml data using the curl library and parse it
> > > > according to the user's configuration using libxml2. I have worked
> > > > on the top of curl-json plugin code and got this plugin to work.
>
> Sounds interesting :) What do you plan to use this plugin for?
>
Sun Java System Web Server 7.0. This server exposes monitoring data in xml
format via a URL and thus, the need of this plugin.
>
> > > > I am proposing the following configuration for curl_xml:
> > > >
> > > > <Plugin curl_xml>
> > > > <URL "[some url]">
> > > > Instance "<instance-name>"
> > > > <xpath "<xpath1>">
> > > > Instance "<instance-name>" (Optional)
> > > > Type "<type>"
> > > > </xpath>
> > > > <xpath "<xpath2>">
> > > > Instance "<instance-name>" (Optional)
> > > > Type "<type>"
> > > > </xpath>
> > > > </URL>
> > > > <URL .....>
> > > > ......
> > > > </URL>
> > > > </Plugin>
>
> Looks okay to me. However, I'd expect XML to contain a lot of tabular
> data in general. Wouldn't it make sense to make it possible to configure
> columns for instance name and values. Something like:
>
> <XPath "/path/to/table[class=magic]"> # I don't know the XPath
> Instance "tr/th[class=type_of_magic]" # syntax, so I'm making
> Values "tr/td[class=magic_level]" # something up here.
> Type "magic_level"
> Table true
> </XPath>
>
Looks good to me. I will try to implement this configuration and re-post the
updated plugin.
> Where:
>
> * The argumetn to "XPath" is an xpath which returns a base block in
> which to look further.
> * The arguments to "Instance" and "Values" are xpath expressions, too.
>
Just a clarification, "Instance" here will be type_instance(s) and thus can
be anything (not just xpath), right?
Regards
Amit
Regards,
> -octo
>
> [0] <http://collectd.org/wiki/index.php/Roadmap#cURL-XML_plugin>
> --
> Florian octo Forster
> Hacker in training
> GnuPG: 0x91523C3D
> http://verplant.org/
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFLL753Hdggu3Q05IYRApOzAJ9M/xrz7O71WzaGjXLaxcGW+yEcNQCeLTho
> STt3An3XvyTdiRy3mduVrDg=
> =C15x
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20091229/d5823249/attachment.htm
More information about the collectd
mailing list