Difference between revisions of "Plugin:cURL-XML"

From collectd Wiki
Jump to: navigation, search
(Created initial page.)
 
(Undo revision 3274 by 202.171.253.71 (talk))
 
(10 intermediate revisions by 5 users not shown)
Line 3: Line 3:
 
   | Type=read
 
   | Type=read
 
   | Callbacks={{Callback|config}}, {{Callback|read}}
 
   | Callbacks={{Callback|config}}, {{Callback|read}}
   | Status= {{in development}}
+
   | Status= {{supported}}
 
   | FirstVersion={{Version|4.10}}
 
   | FirstVersion={{Version|4.10}}
 
   | Copyright=''2009,2010'' Amit Gupta
 
   | Copyright=''2009,2010'' Amit Gupta
Line 10: Line 10:
 
}}
 
}}
  
The '''cURL-XML plugin''' reads files using ''libcurl'' and parses it as ''Extensible Markup Language'' (XML). The parsed tree is then traversed according to the user's configuration, using the ''XML Path Language'' (XPath).
+
The '''cURL-XML plugin''' reads files using ''libcurl'' and parses it as ''Extensible Markup Language'' (XML). The parsed tree is then traversed according to the user's configuration, using the ''[http://www.w3schools.com/Xpath/ XML Path Language]'' (XPath).
  
 
{{Generic Plugin|curl_xml}}
 
{{Generic Plugin|curl_xml}}
  
 
== Synopsis ==
 
== Synopsis ==
 +
{{See|[[Plugin:cURL-XML/Config]]}}
  
 
  <Plugin "curl_xml">
 
  <Plugin "curl_xml">
   <URL "http://localhost/stats.xml">
+
   <URL "<nowiki>http://localhost/stats.xml</nowiki>">
 
     Host "my_host"
 
     Host "my_host"
 
     Instance "some_instance"
 
     Instance "some_instance"
Line 26: Line 27:
 
     CACert "/path/to/ca.crt"
 
     CACert "/path/to/ca.crt"
 
      
 
      
     <XPath "table[@id=\"magic_level\"]/tr">
+
     <xpath "table[@id=\"magic_level\"]/tr">
 
       Type "magic_level"
 
       Type "magic_level"
 
       #InstancePrefix "prefix-"
 
       #InstancePrefix "prefix-"
 
       InstanceFrom "td[1]"
 
       InstanceFrom "td[1]"
 
       ValuesFrom "td[2]/span[@class=\"level\"]"
 
       ValuesFrom "td[2]/span[@class=\"level\"]"
     </XPath>
+
     </xpath>
 
   </URL>
 
   </URL>
 
  </Plugin>
 
  </Plugin>
Line 45: Line 46:
 
== See also ==
 
== See also ==
  
 +
* [[Plugin:cURL-XML/Config|Example configurations]]
 
* {{Plugin|cURL}}
 
* {{Plugin|cURL}}
 
* {{Plugin|cURL-JSON}}
 
* {{Plugin|cURL-JSON}}

Latest revision as of 15:56, 23 February 2016

cURL-XML plugin
Type: read
Callbacks: config, read
Status: supported
First version: 4.10
Copyright: 2009,2010 Amit Gupta
License: GPLv2
Manpage: collectd.conf(5)
List of Plugins

The cURL-XML plugin reads files using libcurl and parses it as Extensible Markup Language (XML). The parsed tree is then traversed according to the user's configuration, using the XML Path Language (XPath).

This plugin is a generic plugin, i.e. it cannot work without configuration, because there is no reasonable default behavior. Please read the Plugin curl_xml section of the collectd.conf(5) manual page for an in-depth description of the plugin's configuration.

Synopsis

→ See: Plugin:cURL-XML/Config
<Plugin "curl_xml">
  <URL "http://localhost/stats.xml">
    Host "my_host"
    Instance "some_instance"
    User "collectd"
    Password "thaiNg0I"
    VerifyPeer true
    VerifyHost true
    CACert "/path/to/ca.crt"
    
    <xpath "table[@id=\"magic_level\"]/tr">
      Type "magic_level"
      #InstancePrefix "prefix-"
      InstanceFrom "td[1]"
      ValuesFrom "td[2]/span[@class=\"level\"]"
    </xpath>
  </URL>
</Plugin>

Example graphs

None yet. Add one now!

Dependencies

See also