Apache Data Collector
Contributors Download PDF of this topic
This data collector allows collection of data from Apache servers in your environment.
You must have your Apache HTTP Server set up and properly running
You must have sudo or administrator permissions on your agent host/VM
Typically, the Apache mod_status module is configured to expose a page at the '/server-status?auto' location of the Apache server. The ExtendedStatus option must be enabled in order to collect all available fields. For information about how to configure your server, see the Apache module documentation: https://httpd.apache.org/docs/2.4/mod/mod_status.html#enable
From Admin > Data Collectors, click +Data Collector. Under Services, choose Apache.
Select the Operating System or Platform on which the Telegraf agent is installed.
If you haven’t already installed an Agent for collection, or you wish to install an Agent for a different Operating System or Platform, click Show Instructions to expand the Agent installation instructions.
Select the Agent Access Key for use with this data collector. You can add a new Agent Access Key by clicking the + Agent Access Key button. Best practice: Use a different Agent Access Key only when you want to group data collectors, for example, by OS/Platform.
Follow the configuration steps to configure the data collector. The instructions vary depending on the type of Operating System or Platform you are using to collect data.
Telegraf’s plugin for Apache’s HTTP Server relies on the 'mod_status' module to be enabled. When this is enabled, Apache’s HTTP Server will expose an HTML endpoint that can be viewed on your browser or scraped for extraction of status of all Apache’s HTTP Server configuration.
Configuration was developed against Apache’s HTTP Server version 2.4.38.
Enabling and exposing the 'mod_status' modules involves two steps:
Exposing stats from module
The loading of modules is controlled by the config file under '/usr/local/apache/conf/httpd.conf'. Edit the config file and uncomment the following lines:
LoadModule status_module modules/mod_status.so
Exposing stats from module:
The exposing of 'mod_status' is controlled by the config file under '/usr/local/apache2/conf/extra/httpd-info.conf'. Make sure you have the following in that configuration file (at least, other directives will be there):
# Allow server status reports generated by mod_status, # with the URL of http://servername/server-status <Location /server-status> SetHandler server-status </Location> # # ExtendedStatus controls whether Apache will generate "full" status # information (ExtendedStatus On) or just basic information (ExtendedStatus # Off) when the "server-status" handler is called. The default is Off. # ExtendedStatus On
For detailed instructions on the 'mod_status' module, see the Apache documentation
Objects and Counters
The following objects and their counters are collected:
Additional information may be found from the Support page.