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.
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.
Download and install Apache Maven which is configured with Java 8
to build the extension artifact from source. You can check the java version used in maven using command mvn -v
or mvn --version
. If your maven is using some other java version then please download java 8 for your platform and set JAVA_HOME parameter before starting maven.
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.
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.
git clone <repoUrl>
command.ApacheMonitor-<Version>.zip
from target
directory to the "<MachineAgent_Dir>/monitors" directoryPlease 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.
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/mod_jk.so
JkWorkersFile conf/workers.properties
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>
worker.list=worker1,worker2,loadbalancer,statusmanager
#worker1
worker.worker1.type=ajp13
worker.worker1.host={host1}
worker.worker1.port={host1 ajp post}
worker.worker1.lbfactor=100
#worker2
worker.worker2.type=ajp13
worker.worker2.host={host2}
worker.worker2.port={host2 ajp port}
worker.worker2.lbfactor=100
#Load balancer
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=worker1,worker2
worker.loadbalancer.sticky_session=1
#status manager
worker.statusmanager.type=status
Configure the extension by editing the config.yml file in <MACHINE_AGENT_HOME>/monitors/ApacheMonitor/
.
<COMPONENT_ID>
in metricPrefix: "Server|Component:<COMPONENT_ID>|Custom Metrics|Apache|"
.For example,
metricPrefix: "Server|Component:100|Custom Metrics|Apache|"
More details around metric prefix can be found here
For example:
servers:
- displayName: "Local Apache"
host: "localhost"
port: 80
username: ""
password: ""
encryptedPassword: ""
useSSL: false
connection:
socketTimeout: 5000
connectTimeout: 2500
sslCertCheckEnabled: true
sslVerifyHostname: false
#Encryption key for Encrypted password.
encryptionKey: "axcdde43535hdhdgfiniyy576"
numberOfThreads: 12
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.
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"/>
</stat>
</stat>
For configuring the metrics, the following properties can be used:
Property | Default value | Possible values | Description |
---|---|---|---|
alias | metric name | Any string | The 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 |
multiplier | 1 | Any number | Value with which the metric needs to be multiplied. |
convert | null | Any key value map | Set of key value pairs that indicates the value to which the metrics need to be transformed. eg: UP:0, DOWN:1 |
delta | false | true, false | If 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.
Please refer to metrics.xml file located at <MachineAgentInstallationDirectory>/monitors/ApacheMonitor/metrics.xml
to view the metrics which this extension can report.
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
Please visit this page to get detailed instructions on password encryption. The steps in this document will guide you through the whole process.
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
curl
to verify that the URL works: http://your-apache-server:90/server-status?auto > curl -v 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___……………….
Always feel free to fork and contribute any changes directly here on GitHub.
Name | Version |
---|---|
Extension Version | 2.0.5 |
Product Tested On | 4.5.13+ |
Last Update | 02/02/2023 |
Changes list | ChangeLog |
Note: While extensions are maintained and supported by customers under the open-source licensing model, they interact with agents and Controllers that are subject to AppDynamics’ maintenance and support policy. Some extensions have been tested with AppDynamics 4.5.13+ artifacts, but you are strongly recommended against using versions that are no longer supported.
Owner
Contributors
Categories
Products
AppDynamicsProgramming Languages
JavaLicense
Code Exchange Community
Get help, share code, and collaborate with other developers in the Code Exchange community.View Community