Collects Apache webserver mod_status metrics
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Build Status


This project will no longer be maintained by Intel. Intel will not provide or guarantee development of or support for this project, including but not limited to, maintenance, bug fixes, new releases or updates. Patches to this project are no longer accepted by Intel. If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the community, please create your own fork of the project.

Snap collector plugin - Apache

This plugin collects metrics from the Apache Webserver for mod_status: ?auto is the machine-readable format for the status file.

It's used in the Snap framework.

  1. Getting Started
  1. Documentation
  1. Community Support
  2. Contributing
  3. License
  4. Acknowledgements

Getting Started

In order to use this plugin you need Apache2 installed.

Operating systems

  • Linux/amd64



sudo apt-get install apache2


You can get the pre-built binaries for your OS and architecture at Snap's GitHub Releases page.

To build the plugin binary:

Fork Clone repo into $GOPATH/src/

$ git clone<yourGithubID>/snap-plugin-collector-apache.git

Build the plugin by running make within the cloned repo:

$ make

(It may take a while to pull dependencies if you don't have them already.)

This builds the plugin in /build/${GOOS}/${GOARCH}

Run tests
export TEST_TYPE=small
make test

Configuration and Usage


The Apache mod_status documentation says to enable mod_status in httpd.conf, but it was located in mods-enabled/status.conf for me:

$ ls /etc/apache2/
apache2.conf  conf-available  conf-enabled  envvars  magic  mods-available  mods-enabled  ports.conf  sites-available  sites-enabled

Make sure mod_status is enabled with the following uncommented. Extended status needs to be on. If you want the mod status url to be mod_status instead of server-status just change the location line and the apache_suffix in the config.json file to match.

ExtendedStatus on
<Location /mod_status>
  SetHandler server-status

If no changes needed to be made, run the following to start apache.

$ sudo service apache2 start

If any changes needed to be made, run the following to restart apache after you save the file.

$ sudo service apache2 restart

If it doesn't seem like anything changed when you start up the server, it likely means that you had other Apache instances running.
You can stop Apache2 and then if there are any Apache processes running, kill them, and start Apache:

$ sudo service apache2 stop
$ ps aux | grep apache
$ kill -9 <PIDs>
$ sudo service apache2 start

Check to see if Apache2 is running:

$ service apache2 status
 * apache2 is running



There are a number of other resources you can review to learn to use this plugin:

Collected Metrics

All metrics gathered by this plugin are exposed by the status file produced by mod_status.
This plugin has the ability to gather the following metrics: Available Metrics

This plugin will provide two seperate metric catalogs based on whether safe or unsafe collection is configured.


If this is your directory structure:


In one terminal window in the /snap directory: Running snapteld with auto discovery, log level 1, and trust disabled. The config.json file has the webserver configuration parameters.

$ snapteld -l 1 -t 0

Download desired publisher plugin eg.

$ wget

Load collector and publisher

$ snaptel plugin load snap-plugin-collector-apache
$ snaptel plugin load snap-plugin-publisher-file

Create task manifest for writing to a file. See ../snap-plugin-collector-apache/examples/tasks/apache-file.json:

  "version": 1,
  "schedule": {
      "type": "simple",
      "interval": "1s"
  "workflow": {
      "collect": {
          "metrics": {
              "/intel/apache/CPULoad": {},
              "/intel/apache/BytesPerSec": {},
              "/intel/apache/workers/Sending": {}
          "config": {
            "/intel/apache": {
              "apache_mod_status_url": ""
          "publish": [
                  "plugin_name": "file",
                  "config": {
                      "file": "/tmp/snap-apache-file.log"

Another terminal window, also in /snap:

$ snaptel task create -t ../snap-plugin-collector-apache/examples/tasks/apache-file.json


2016-01-27 15:08:51.09527825 -0800 PST|[intel apache BytesPerSec]|92.0861|
2016-01-27 15:08:51.09527251 -0800 PST|[intel apache CPULoad]|.0209417|
2016-01-27 15:08:51.095292429 -0800 PST|[intel apache workers Sending]|1|
2016-01-27 15:08:52.096059795 -0800 PST|[intel apache BytesPerSec]|92.086|
2016-01-27 15:08:52.096056768 -0800 PST|[intel apache CPULoad]|.0209417|
2016-01-27 15:08:52.096089108 -0800 PST|[intel apache workers Sending]|1|

Unsafe collection

Not all version of the apache status endpoint return the same metrics. To allow for consistent collections from different apache servers safe collection is enabled for the plugin by default. To override safe collection and expose all the available metrics alter the snapteld global configuration to include the following:

            safe: false

The provided example config can be used to load this plugin in unsafe mode


The next step for this plugin is to make sure it works with Lightppd and it is in active development. As we launch this plugin, we do not have any outstanding requirements for the next release. If you have a feature request, please add it as an issue and/or submit a pull request.

Community Support

This repository is one of many plugins in the Snap framework: a powerful telemetry framework. See the full project at To reach out to other users, head to the main framework


We love contributions!

There's more than one way to give back, from examples to blogs to code updates. See our recommended process in


Snap, along with this plugin, is an Open Source software released under the Apache 2.0 License.


Thank you! Your contribution is incredibly important to us.