Skip to content
Florian Forster edited this page Nov 21, 2023 · 1 revision
Name: Apache plugin
Type: read
Callbacks: config, read
Status: supported
FirstVersion: 3.9
Copyright: 2006–2008 Florian Forster, 2007 Florent Monbillard
License: GPLv2
Manpage: collectd.conf(5)
See also: 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">
        <nowiki>URL "http://localhost/mod_status?auto"</nowiki>
        User "collectd"
        Password "hoh2Coo6"
    </Instance>
    <Instance "lighttpd8080">
        <nowiki>URL "http://localhost:8080/mod_status?auto"</nowiki>
    </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 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

Clone this wiki locally