Plugin:Apache

From collectd Wiki
Revision as of 02:07, 29 July 2015 by Binocvlar (talk | contribs) (Synopsis: Add explanation of ?auto in status URL)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Apache plugin
Type: read
Callbacks: config, read
Status: supported
First version: 3.9
Copyright: 2006–2008 Florian Forster
2007 Florent Monbillard
License: GPLv2
Manpage: collectd.conf(5)
List of Plugins

The Apache plugin queries the page generated by mod_status, the status module of the Apache web server, parses it and submits the number of bytes transfered, the number of requests received, and the number of processes in the various states of the scoreboard. The output of the status module of lighttpd is understood, too.

The plugin uses libcurl to connect to the web server, optionally using a configured username/password to authenticate. It tries to keep a keep-alive connection open to minimize the overhead of connecting to the server. It's also possible to query hosts over SSL.

Details of the configuration can be found in the collectd.conf(5) manual page.

Synopsis

Apache

ExtendedStatus on
<Location /mod_status>
  SetHandler server-status
</Location>

collectd

LoadPlugin "apache"
<Plugin "apache">
   <Instance "apache80">
       URL "http://localhost/mod_status?auto"
       User "collectd"
       Password "hoh2Coo6"
   </Instance>
   <Instance "lighttpd8080">
       URL "http://localhost:8080/mod_status?auto"
   </Instance>   
</Plugin>

NB: The "apache" plugin requires that you specify a URL which produces a "Machine Readable Status File" ( httpd.apache.org/docs/2.2/mod/mod_status.html#machinereadable ). Failing to append '?auto' to the end of the URL will result in the status page being returned with a MIME type of 'text/html' rather than 'text/plain', which is incompatible with the plugin.

Example graphs

Plugin-apache-bytes.png Plugin-apache-requests.png Plugin-apache-scoreboard.png

See also

Dependencies