AppDynamics Monitoring Extension for use with Apache

Use Case

The Apache HTTP Server is a widely-used web server supported by the Apache Software Foundation. The Apache HTTP Server monitoring extension captures metrics from an Apache web server and displays them in the AppDynamics Metric Browser.


  1. Before the extension is installed, the prerequisites mentioned here need to be met. Please do not proceed with the extension installation if the specified prerequisites are not met.
  2. Please enable mod_status on the HTTP server to get stats. Install Apache mod_status on your Apache instance. For more information, see Apache Module mod_status.
  3. The extension needs to be able to connect to Apache in order to collect and send metrics. To do this, you will have to either establish a remote connection in between the extension and the product, or have an agent on the same machine running the product in order for the extension to collect and send the metrics.


  1. Download and unzip the to the "<MachineAgent_Dir>/monitors" directory
  2. Edit the file config.yml located at <MachineAgent_Dir>/monitors/ApacheMonitor The metricPrefix of the extension has to be configured as specified here. Please make sure that the right metricPrefix is chosen based on your machine agent deployment, otherwise this could lead to metrics not being visible in the controller.
  3. All metrics to be reported are configured in metrics.xml. Users can remove entries from metrics.xml to stop the metric from reporting, or add new entries as well.

Please place the extension in the "monitors" directory of your Machine Agent installation directory. Do not place the extension in the "extensions" directory of your Machine Agent installation directory.


Load balancing metrics

This extension can also show the load balancing metrics from mod_jk status. In order to do this, please configure mod_jk in the apache HTTP server. More info on mod_jk is available here

Following are the sample configuration files that need to be setup for mod_jk metrics. Please check this link for more details.


LoadModule    jk_module  modules/
JkWorkersFile conf/
JkShmFile     /var/log/httpd/mod_jk.shm
JkLogFile     /var/log/httpd/mod_jk.log
JkLogLevel    info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount  /examples/* loadbalancer

<Location /status>
   JkMount statusmanager
   Order deny,allow
   Allow from localhost
</Location> file


worker.worker1.port={host1 ajp post}

worker.worker2.port={host2 ajp port}

#Load balancer

#status manager


Configure the extension by editing the config.yml file in <MACHINE_AGENT_HOME>/monitors/ApacheMonitor/.

  1. Configure the "COMPONENT_ID" under which the metrics need to be reported. This can be done by changing the value of <COMPONENT_ID> in metricPrefix: "Server|Component:<COMPONENT_ID>|Custom Metrics|Apache|".

    For example,

    metricPrefix: "Server|Component:100|Custom Metrics|Apache|"
  2. The extension supports reporting metrics from multiple apache instances. Have a look at config.yml for more details.

    For example:

     - displayName: "Local Apache"
       host: "localhost"
       port: 80
       username: ""
       password: ""
       encryptedPassword: ""
       useSsl: false
      socketTimeout: 5000
      connectTimeout: 2500
      sslCertCheckEnabled: true
      sslVerifyHostname: false
  3. Configure the encyptionKey for encryptionPasswords(only if password encryption required). For example,

    #Encryption key for Encrypted password.
    encryptionKey: "axcdde43535hdhdgfiniyy576"
  4. Configure the numberOfThreads For example, If number of servers that need to be monitored is 3, then number of threads required is 3 * 4 = 12

    numberOfThreads: 12

Restart the Machine Agent after configuring config.yml as mentioned above.


You can add/remove metrics of your choosing by modifying the provided metrics.xml file. This file consists of all the metrics that will be monitored and sent to the controller. Please look at how the metrics have been defined and follow the same convention when adding new metrics. You do have the ability to also chose your Rollup types as well as for each metric as well as set an alias name that you would like displayed on the metric browser.

This monitor provides an option to add a custom URL for monitoring the metrics provided by the particular end-point.

Custom Stats Configuration

If you have any custom URL's which return delimiter separated metrics, please define them in metrics.xml as following:

<stat name="customStats">
    <stat url=<URL-of-custom-stats> keyValueSeparator=<Delimiter> >
       <metric attr=<AttributeToMonitor> alias="<PathofMetric>" aggregationType = "OBSERVATION" timeRollUpType = "CURRENT" clusterRollUpType = "COLLECTIVE"/>

For configuring the metrics, the following properties can be used:

PropertyDefault valuePossible valuesDescription
aliasmetric nameAny stringThe substitute name to be used in the metric browser instead of metric name.
aggregationType"AVERAGE""AVERAGE", "SUM", "OBSERVATION"Aggregation qualifier
timeRollUpType"AVERAGE""AVERAGE", "SUM", "CURRENT"Time roll-up qualifier
clusterRollUpType"INDIVIDUAL""INDIVIDUAL", "COLLECTIVE"Cluster roll-up qualifier
multiplier1Any numberValue with which the metric needs to be multiplied.
convertnullAny key value mapSet of key value pairs that indicates the value to which the metrics need to be transformed. eg: UP:0, DOWN:1
deltafalsetrue, falseIf enabled, gives the delta values of metrics instead of actual values.

For example:

 - name: "CPUUtilization"
          alias: "CPULoad"
          aggregationType: "OBSERVATION"
          timeRollUpType: "CURRENT"
          clusterRollUpType: "COLLECTIVE"
          delta: false
**All these metric properties are optional, and the default value shown in the table is applied to the metric(if a property has not been specified) by default.**



Uptime (1 or 0)

Resource Utilization:

CPU Load (N/A on Windows)The substitute name to be used in the metric browser instead of metric name.
Busy WorkersThe number of Apache processes actively processing an HTTP request
Idle WorkersThe number of idle Apache processes waiting for an HTTP request.
Total Connections


AccessesTotal number of accesses per Minute
Total Traffic (kb)
Requests per secondThe number of HTTP requests the web server is processing per second.
Bytes per secondThe amount of data the web server is transferring per second.
Bytes per requestThe average number of bytes being transferred per HTTP request.
Activity Types
Starting up
Reading Request
Sending Reply
DNS Lookup
Closing Connection
Gracefully Finishing
Cleaning up of working

Load balancing metrics:

In addition to the above specified metrics, this extension can also show metrics from mod_jk status. To do this we have to configure mod_jk in the apache HTTP server. More info on mod_jk can be found here

Credentials Encryption

Please visit this page to get detailed instructions on password encryption. The steps in this document will guide you through the whole process.

Extensions Workbench

Workbench is an inbuilt feature provided with each extension in order to assist you to fine tune the extension setup before you actually deploy it on the controller. Please review the following document on How to use the Extensions WorkBench


  1. Please look at the troubleshooting document and make sure that everything is followed correctly.
  2. Please enable mod_status on the HTTP server to get stats. For more information, see Apache Module mod_status.
  3. Use curl to verify that the URL works: http://your-apache-server:90/server-status?auto
 > curl http://localhost:90/server-status?auto
  Total kBytes: 3
  Total Accesses: 3
  Total kBytes: 3
  Uptime: 119503
  ReqPerSec: 2.5104e-5
  BytesPerSec: .0257065
  BytesPerReq: 1024
  BusyWorkers: 1
  IdleWorkers: 7
  Scoreboard: __W___……………….

Support Tickets

If after going through the Troubleshooting Document you have not been able to get your extension working, please file a ticket and add the following information.

Please provide the following in order for us to assist you better.

1. Stop the running machine agent.
2. Delete all existing logs under <MachineAgent>/logs.
3. Please enable debug logging by editing the file <MachineAgent>/conf/logging/log4j.xml. Change the level value of the following <logger> elements to debug.
    <logger name="com.singularity">
    <logger name="com.appdynamics">
4. Start the machine agent and please let it run for 10 mins. Then zip and upload all the logs in the directory <MachineAgent>/logs/*.
5. Attach the zipped <MachineAgent>/conf/* directory here.
6. Attach the zipped <MachineAgent>/monitors/ExtensionFolderYouAreHavingIssuesWith directory here.

For any support related questions, you can also contact


Always feel free to fork and contribute any changes directly here on GitHub.


Extension Version2.0.1
Controller Compatibility3.7 or Later
Product Tested On2.4.33
Last Update10/23/2018