PRO40 Server Monitoring 01july2015
PRO40 Server Monitoring 01july2015
PRO40 Server Monitoring 01july2015
Page 1
Server Monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Standalone Machine Agent Requirements and Supported Environments . . . . . . . . . . . . 3
Standalone Machine Agent Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Quick Install for the Standalone Machine Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Install the Standalone Machine Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Standalone Machine Agent Configuration Properties . . . . . . . . . . . . . . . . . . . . . . . . . 10
Install the Standalone Machine Agent as a Windows Service . . . . . . . . . . . . . . . . . . 16
Deploy Multiple Standalone Machine Agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Configure Multiple Standalone Machine Agents for One Machine for Java . . . . . . . . 20
Resolve Installation Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Start the Standalone Machine Agent Automatically on Linux . . . . . . . . . . . . . . . . . . . 23
Start the Standalone Machine Agent Automatically on Windows . . . . . . . . . . . . . . . . 24
Associate Standalone Machine Agents with Applications . . . . . . . . . . . . . . . . . . . . . 25
Metrics Collected by the Standalone Machine Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Configure Metrics for Virtual Disks and External Network Traffic . . . . . . . . . . . . . . . . 27
Limit Disk Backup Metrics Collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Configure Custom Metrics for the z-OS Machine Agent . . . . . . . . . . . . . . . . . . . . . . . 29
Extensions and Custom Metrics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Build a Monitoring Extension Using Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Build a Monitoring Extension Using Java . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Standalone Machine Agent HTTP Listener . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
JVM Crash Guard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Remediation Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Administer the Standalone Machine Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Upgrade the Standalone Machine Agent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Determine Whether a Server is Down . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Controller Settings for Machine and Database Agents . . . . . . . . . . . . . . . . . . . . . . . . 57
Machine Agent FAQ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Page 2
Server Monitoring
Related pages:
Install the Standalone Machine Agent
Standalone Machine Agent Architecture
Metrics Collected by the Standalone Machine Agent
Machine Agent FAQ
Watch the video:
Standalone Machine Agent: An Overview
The Standalone Machine Agent is a standalone Java program that collects hardware-related
performance statistics from your servers. It can be deployed on any machine that hosts application
servers, database servers, messaging servers, Web servers, etc. It has an extensible architecture.
Use the Standalone Machine Agent to:
Collect basic metrics from the operating system that display in the Hardware tabs of
the Node Dashboard.
Report the metrics passed in by custom monitors.
Run remediation scripts for policy actions.
Run JVM Crash Guard.
The Standalone Machine Agent provides platform-level metrics. It has a default built-in plugin for
hardware monitoring. See Install the Standalone Machine Agent.
The Standalone Machine Agent runs on a Java Virtual Machine. JVMs versions 1.5 and higher
are supported for most installations. If you are using AppDynamics Application Analytics, JVM 1.7
is required.
Solaris x86 8, 9, 10
Solaris x64 8, 9, 10
HP-UX PA-RISC 11
HP-UX ia64 11
Windows x86 NT 4.0, 2000 Pro/Server, 2003 Server, XP, Vista, 2008
Server, 7
Distribution Versions
RHEL 3, 4, 5, 6
CentOS 3, 4, 5
Fedora 2, 3, 4, 5, 6, 7, 8, 9, 10
SuSE 8, 9, 10, 11
Slackware 10, 11
Mandrake 10
Scientific Linux 5
Gentoo
Note: If you are using a 64-bit Operating System, use only a 64-bit Java Runtime Environment
(JRE).
Hardware Requirements
Agent: 1 additional GB of Ram
Controller: Although we recommend that the AppDynamics Controller be installed on a dedicated
server, in some cases the Standalone Machine Agent can co-exist with the Controller on the same
system. A Controller with more than 250 nodes must run on a dedicated machine.
CPU Consumption
In terms of CPU consumption, the agent can add anywhere from 0% to 2% additional overhead on
CPU usage, depending on how the extensions are coded and how many extensions are running.
AppDynamics Essentials
Standalone Machine Agent Configuration Properties
Watch the video:
If you downloaded the agent from the AppDynamics download zone, see Install the Standalone
Machine Agent.
1. Ensure you have Java 1.5 or later installed on the machine. Java 1.7 is required if you want
to use AppDynamics Analytics.
2. Shut down the Standalone Machine Agent process before you install. A machine can have
only one active Standalone Machine Agent installation at a time.
3. Download the Standalone Machine Agent installation zip file.
4. Extract the zip file to the destination directory.
Do not use spaces in the destination directory path.
For Windows environments, unblock the zip file before you extract it as follows:
right-click on the zip file, select Properties, and choose unblock.
5. Configure how the agent connects to the Controller.
Configure properties for the Controller host name and port number using either the
<agent home>/conf/controller-info.xml file or by adding system properties to the JVM
startup script file.
If you start a Standalone Machine Agent on a machine that already has a Java Agent
or the PHP Agent installed, the Standalone Machine Agent will automatically associate
itself with the app agent's application, tier, and node settings. If you install an App Agent
for PHP on the same machine as the Standalone Machine Agent, install the App Agent
before the Standalone Machine Agent, and do not specify the tier and node in the
machine agent configuration.
To configure agent to use SSL see Enable SSL for Communicating with the Controller.
To configure the agent to use proxy settings see Proxy Settings for the Controller.
6. (For Multi-tenant mode or SaaS installations only.) Configure the agent account information.
Specify the properties for Account Name and Account Key as provided in the welcome
email sent by AppDynamics Support Team.
Edit the agent <agent home>/conf/controller-info.xml file and specify the following
elements:
Alternatively, in a Linux environment, you can execute the following command in the
background:
Note: The agent requires read, write, and delete permission to the <agent home>\conf
and <agent home>\logs directories. Depending on the version of unix and whether
you're using the Sigar or shell script version of the OS monitor, the agent may require
elevated privileges in order to make some system calls to collect metrics.
If your application uses a large number of AppDynamics extensions with the
Standalone Machine Agent, you may need to increase the size of the memory
allocation as follows:
11. Verify that the agent is reporting to the Controller on the Tier Dashboard.
You should see an "up" arrow symbol for the agent in the Machine Agent Status
column.
<controller-host>192.10.10.10</controller-host>
<controller-port>8090</controller-port>
<controller-ssl-enabled>false</controller-ssl-enabled>
<enable-orchestration>false</enable-orchestration>
<account-access-key></account-access-key>
<application-name></application-name>
<tier-name></tier-name>
<node-name></node-name>
<force-agent-registration>false</force-agent-registration>
</controller-info>
-Dappdynamics.controller.hostName=192.168.1.20
-Dappdynamics.controller.port=8090
-Dappdynamics.agent.applicationName=ACMEOnline
-Dappdynamics.agent.tierName=Inventory
-Dappdynamics.agent.nodeName=inventory1 org.tomcat.TomcatServer
This section describes the Standalone Machine Agentconfiguration properties, including their
controller-info-xml elements and their system property options.
Description: This is the host name or the IP address of the AppDynamics Controller, e.g.
192.168.1.22 or myhost or myhost.abc.com. This is the same host that you use to access the
AppDynamics browser-based user interface.
Element in controller-info.xml: <controller-host>
System Property: -Dappdynamics.controller.hostName
Type: String
Default: None
Required: if the Enable Orchestration property is false.
If Enable Orchestration is true, and if the agent is deployed in a compute cloud instance created by
an AppDynamics workflow, do not set the Controller host unless you want to override the
auto-detected value. See Enable Orchestration Property.
Description: This is the HTTP(S) port of the AppDynamics Controller. This is the same port that
you use to access the AppDynamics browser-based user interface. If the Controller SSL Enabled
property is set to true, specify the HTTPS port of the Controller; otherwise specify the HTTP port.
See Controller SSL Enabled Property.
Element in controller-info.xml: <controller-port>
System Property: -Dappdynamics.controller.port
Type: Positive Integer
Default: For On-premise installations, port 8090 for HTTP and port 8181 for HTTPS are the
defaults.
For the SaaS Controller Service, port 80 for HTTP and port 443 for HTTPS are the defaults.
Required: Yes, if the Enable Orchestration property is false.
If Enable Orchestration is true, and if the agent is deployed in a compute cloud instance created by
an AppDynamics workflow, do not set the Controller port unless you want to override the
If the Standalone Machine Agent is installed on a machine that does not have an App Server
agent, configure the application name, tier name and the node name. Otherwise these
configurations are not required for the Standalone Machine Agent.
Description: This is the account access key used to authenticate with the Controller.
Element in controller-info.xml: <account-access-key>
System Property: -Dappdynamics.agent.accountAccessKey
Type: String
Default: None
Required: Yes.
Description: This is the name of the logical business application that this JVM node belongs to.
Note that this is not the deployment name(ear/war/jar) on the application server.
If a business application of the configured name does not exist, it is created automatically.
Element in controller-info.xml: <application-name>
System Property: -Dappdynamics.agent.applicationName
Type: String
Defaults: None
Required: If a registered app server agent is already installed on the same host as this machine
agent, this configuration is not required.
Description: This is the name of the logical tier that this JVM node belongs to. Note that this is
not the deployment name (ear/war/jar) on the application server.
If a tier of the configured name does not exist, it is created automatically.
Element in controller-info.xml: <tier-name>
System Property: -Dappdynamics.agent.tierName
Type: String
Defaults: None
Required: If a registered app server agent is already installed on the same host as this machine
agent, this configuration is not required.
If the AppDynamics Controller is running in multi-tenant mode or if you are using the AppDynamics
SaaS Controller, specify the account name and account access key for this agent to authenticate
with the Controller.
If the Controller is running in single-tenant mode (the default) there is no need to configure these
values.
When the agent is registered with an AppDynamics SaaS Controller, features used to run Remedi
ation Scripts are disabled If you later reconfigure the agent controller-info.xml to register with a
non-SaaS or on-premise Controller, the agent can run local scripts as usual.
Description: This is the account name used to authenticate with the Controller.
If you are using the AppDynamics SaaS Controller, the Account Name is provided in the Welcome
email sent by AppDynamics.
Element in controller-info.xml: <account-name>
System Property: -Dappdynamics.agent.accountName
Type: String
Default: None
Required: Yes for AppDynamics SaaS Controller and other multi-tenant users; no for
single-tenant users.
Other Properties
Description: This property specifies whether the agent should use SSL (HTTPS) to connect to
the Controller. If SSL Enabled is true, set the Controller Port property to the HTTPS port of the
Controller. See Controller Port Property.
Element in controller-info.xml: <controller-ssl-enabled>
System Property: -Dappdynamics.controller.ssl.enabled
Type: Boolean
Default: False
Required: No
Description: When set to true, this property enables Standalone Machine Agent workflow task
execution.
It also enables auto-detection of the controller host and port when the app server is a compute
cloud instance created by an AppDynamics orchestration workflow. In a cloud compute
environment, auto-detection is necessary for the Create Machine tasks in the workflow to run
correctly.
See Controller Host Property and Controller Port Property.
The machine agent polls for task executions only when orchestration is enabled.
If the host machine on which this agent resides is not created through AppDynamics workflow
orchestration, this property should be set
to false.
Element in controller-info.xml: <enable-orchestration>
System Property: Not applicable
Type: Boolean
Default: False
Description: This property logically partitions a single physical host or virtual machine.
You can use the unique host id when you want to use the same node name for multiple nodes on
the same physical machine.
Set the value to a string that is unique across the entire managed infrastructure. The string may
not contain any spaces.
If this property is set on the Standalone Machine Agent, it must be set on the app agent as well.
Note that if more than one app agent is running on the host, to see machine agent metrics it is
necessary to run a new Standalone Machine Agent instance every time you specify a different
unique host id on that host.
Element in controller-info.xml: Not applicable
System Property: -Dappdynamics.agent.uniqueHostId
Type: String
Default: None
Required: No
Most Windows server software runs as a service when the machine boots up. To secure your
environment and ensure Standalone Machine Agent availability, you can install the Standalone
Machine Agent as a Windows service using the SRVANY.EXE and SC.EXE utilities that are part of
the Microsoft Resource Kit for Windows 2003 Server. The SRVANY.EXE tool creates a Windows
service that launches the JVM processes for the agent in non-GUI mode using parameters
specified in the registry of the service. The SC.EXE command is used to install and uninstall the
agent service.
Install the Standalone Machine Agent as a Windows Service - Pre Windows 2008
The following procedure involves editing the registry. Before proceeding, know how to backup
and restore the registry as described in the WIndows Registry Editor online help.
1. Install the agent as usual, described in Install the Standalone Machine Agent.
2. Obtain the INSTSRV.EXE and SC.EXE utilities.
Download the Windows Server 2003 Resource Kit Tools, at http://www.microsoft.com/en-us/
download/details.aspx?id=17657. The required utilities are included in this resource kit
3. Prepare registry and batch command files.
To simplify service creation and deregistration, we have attached two batch command files
to this page, InstallService.cmd and UninstallService.cmd. InstallService.cmd requires the
information in the MachineAgent.reg file to set the registry key for the service.
MachineAgent.reg to set the registry key values for the service
InstallService.cmd to install the service
UninstallService.cmd to uninstall the service
Download these files and edit them as indicated below. Specify the same service
name in all three files.
a. Customize MachineAgent.reg
Edit the service name, Application, AppParameters, and AppDirectory values of this
file for your environment.
Specify the service name on the first line of this file.
AppDynamics Machine Agent Service in the sample file attached.
Application is the path to the JDK you use for Standalone Machine Agent.
d:\\AppDynamics\\MachineAgent\\jre6\\bin\\java.exe in the
sample above.
AppParameters is everything you want to pass to the JVM as arguments.
-jar MachineAgent.jar in the sample attached.
AppDirectory points to the agent working directory.
d:\\AppDynamics\\MachineAgent in the sample attached.
b. Customize InstallService.cmd
Edit the create and binPath values in this file for your environment.
Specify the service name in quotes in the sc command create option as follows:
The service installed runs with the permissions of the user logged in
when service is created. To change the user running the installed
process, modify InstallService.cmd by inserting the following anywhere
before "pause" at the end of the file.
sc config <service> obj= <username> password=
<password>
Note: There is a required space between obj= and <username> .
c. Customize UninstallService.cmd
Specify the name of the service in quotes after the sc stop or delete options.
"AppDynamics Machine Agent Service" in the sample attached.
4. From the Windows Explorer, right-click InstallService.cmd and click Run as Administrator.
Install the Standalone Machine Agent as a Windows Service - Windows 2008 and 2012
From the Windows Explorer, right-click UninstallService.cmd and click Run as Administrator.
This stops and removes the service from Windows.
If you used NSSM:
From a command shell, enter
nssm.exe remove <service name>
where <service name> is the name of the agent service.
Known Issues
In Windows Server 2003 you must install and start or stop the service from the console window. If
1. Download the latest Standalone Machine Agent ZIP file from http://download.appdynamics.com/
.
2. Unzip the downloaded file on the destination machine in the desired directories.
3. Modify the <agent home>/conf/controller-info.xml files to set the application name, tier name,
node name, Controller host and Controller port properties. The -D settings allowed for Standalone
Machine Agent are not the same as those for Java Agent. The only one supported,
agent.runtime.dir is described below.
4. Configure the startup script for the machine to start the Standalone Machine Agent every time
the machine reboots. For example, you could add the machine startup command to .bashrc.
To handle large values for metrics, run the Standalone Machine Agent using a 64-bit JDK.
If you want to deploy your agents from a common directory, such as an NFS mounted, shared
directory, you can launch the Standalone Machine Agent installation executable from multiple
servers which have access to the same NFS mounted, shared directory.
All properties common to the Standalone Machine Agents can be in the controller-info.xml file,
such as controller host, controller post, and account name.
Properties unique to each Standalone Machine Agent such as app name, tier name, node name
and log directory must be provided with -D parameters in the JVM startup script on each machine
that is running the Standalone Machine Agent such as the following:
You can use either of the following methods to specify where the log files for the agent should be
stored.
Add the following system property to the system properties of the JVM startup script for
the Standalone Machine Agent:
-Dappdynamics.agent.runtime.dir=<$Absolute-path-to-local-logs-directory>
Add the agent.runtime.dir element to specify the absolute path to the local logs directory
the <machine agent install directory>/conf/controller-info.xml file, but in this case you must also
edit the agent installation\logs\log4j.xml file to provide the absolute path to the local logs directory
as follows:
Configure Multiple Standalone Machine Agents for One Machine for Java
On this page:
Unique Host ID Property
Configuring Multiple Standalone Machine Agents
Sample Configuration
Related pages:
Java Agent Configuration Properties
Standalone Machine Agent Configuration Properties
If you have different applications running on the same machine, to get hardware metrics for each
application, run separate Standalone Machine Agents on the same machine.
To do this, create multiple copies of the Standalone Machine Agent. Then configure each
Standalone Machine Agent / app agent pair to use the same applicationName and uniqueHostId.
The uniqueHostId property is required when multiple Standalone Machine Agents are run on same
machine or host.
When an app agent runs on the same machine as a machine agent, configure the same
uniqueHostId property value on for both the app agent and the machine agent. If there are multiple
app agent/machine agent pairs on the same host, each pair should have a different uniqueHostId
property.
When different tiers in the same application are associated with different machine agents,
configure a different uniqueHostId property for each app agent-tier/machine agent pair.
To retain historical data if the nodes are moved to a different machine, use the hostname of the old
machine from which the nodes were moved as the UniqueHostId parameter when you configure
the app agent/machine agent pair on the new host. For example, if the hostname of the original
machine was "12345.sample.com", on the new host start the app agent and the machine agent
with:
-Dappdynamics.agent.uniqueHostId=12345.sample.com
The following instructions assume two applications and two standalone machine agents on a
single machine, but they can be interpolated to cover more than two.
To configure two Standalone Machine Agents for two applications running on the same machine
1. Download two copies of the Standalone Machine Agent, one for each application.
2. Assign the standalone machine agents different names, for example: "MachineAgent1" and
"MachineAgent2".
If there are custom scripts running on the standalone machine agents, they must not use the
same resources.
3. Configure the first application/machine agent pair for the first application:
a. Delete the app agent node from the Controller UI.
b. Configure the applicationName and uniqueHostID properties for the app agent.
c. Configure the applicationName and uniqueHostID properties for the machine agent
using the same application name and unique host id values that you used for the app
agent configuration.
4. Configure the second application/machine agent pair for the second application:
a. Delete the app agent node from the Controller UI.
b. Configure the applicationName and uniqueHostID properties for the app agent. These
values must be different from the values used for the first application.
c. Configure the applicationName and uniqueHostID properties for the Standalone
Machine Agent using the same applicationName and uniqueHostId values that you
Sample Configuration
The following image shows a sample configuration of two physical machines with two applications
each. In it:
Machine1 runs App1, which is instrumented with one app agent (AppAgent1) and one
Standalone Machine Agent (MachineAgent1).
Machine1 also runs App2, which is instrumented with one app agent (AppAgent2) and one
Standalone Machine Agent (MachineAgent2).
Machine2 runs App1, which is instrumented with one app agent (AppAgent3) and one
Standalone Machine Agent (MachineAgent3).
Machine2 also runs App2 is instrumented with one app agent (AppAgent4) and one
Standalone Machine Agent (MachineAgent4).
Given this deployment, the Controller would report separate metrics for each of Machine1_App1,
Machine1_App2, Machine2_App1, and Machine2_App2.
Use the following command to verify that the agent process is running:
Linux:
Windows:
1. Open a command line console.
2. Start the Task Manager and click the Processes tab.
3. The agent process should be running. If it is not running, stop and then restart the agent
If when you start the Standalone Machine Agent, it cannot register with the controller or associate
with the same node in the Controller, the stack trace may reveal the reason why.
For example, the following message in the stack trace may indicate that the application, tier, and
node information was not provided during the Standalone Machine Agent startup command or in
the controller-info.xml file.
Make sure you have configured the application, tier, and node information either in the
agent startup command or in the controller-info.xml file.
After configuring, restart the agent and check the behavior. Standalone Machine Agent log files
may also provide some insight into problems.
1. Create an initialization script that starts the Standalone Machine Agent agent, as in the
sample initialization script that is an attachment to this page.
In your script, set the JAVA and AGENT_HOME values to the paths for your system. Also
configure agent options, as needed.
2. Enable execution permissions for the script. For example, given an initialization script
named machineagent, enter:
3. Place the script in the initialization directory on your system, typically /etc/init.d. Alternatively,
create a symbolic link to the script from the init.d directory to the script if you want to keep it in
another location.
4.
On Ubuntu and Debian Operating Systems, run this command, replacing "machineag
ent" with the name of your file or symbolic link:
In the command:
start is the argument given to the script (start, stop).
99 is the start order of the script (1 = first one, 99 = last one)
2 3 4 5 are the runlevels to start
Be sure to include the dot (.) at the end of the command.
The Standalone Machine Agent now starts automatically upon machine startup.
If your application uses a large number of AppDynamics extensions with the Standalone
Machine Agent, you may need to increase the size of the memory allocation as follows:
8.
If no configuration details are provided during installation, or if the node has been moved to
another application, then the Standalone Machine Agent appears in the System -> Agents tab as
"not associated with any applications". To have the Standalone Machine Agent start sending
metrics to a tier or executing workflow tasks, manually associate it with an application.
The following message in the agent log (< agent home>/logs/machine-agent.log) indicates that
there is no application associated with the agent:
If an App Agent is installed on the same machine, AppDynamics automatically makes the
association. However, if there is no App Agent on the machine and you haven't specified the
app/tier/node properties in the controller.xml file, you can set them in the UI as follows:
1. In the AppDynamics Agents window, select a Standalone Machine Agent.
2. Click Associate with an Application.
If the machine is hosting servers that belong to multiple business applications, you may need
multiple agents.
If there are nodes belonging to multiple business applications, you can run multiple agents each
configured to report metrics for a different node, tier, and application.
You cannot "assign" a single Standalone Machine Agent to multiple business application per se.
A Standalone Machine Agent on a specific machine is automatically associated with all nodes
running on that machine. A node is associated with a single business application. Therefore an
application is associated with the agents of its nodes. By default a Standalone Machine
Agent inherits the application/tier/node names of the App Agent installed on the same hardware.
If you have an application where a tier has three nodes, each running on a separate VM on the
1. Stop the agents for all app agent nodes and the machine agent node associated with the
application. If this is is fresh application association ignore this step.
2. Start the appserver agent node for each VM (using the app, tier and node details provided in
<agent home>/conf/controller-info.xml) with the -D JVM arg, in addition to the -javaagent
argument as below .
-Dappdynamics.agent.uniqueHostId=myTierAHostName1 -javaagent
3. Start the Standalone Machine Agent with same uniquehostid used for agent nodes
associated above.
java -Dappdynamics.agent.uniqueHostId=myTierAHostName1 -jar machineagent.jar
Ensure sure you have not provided application-name, tier-name, and node-name details in
<agent home>/conf/controller-info.xml file.
The Standalone Machine Agent automatically collects and displays CPU, Memory, Disk, and
Network metrics on the Node Dashboard Hardware tab. There are many more metrics collected
which you can view in the Metric Browser > Application Infrastructure Performance >Hardware
Resources or add them to your Custom Dashboard. To add CPU metrics to your Custom
Dashboard, add the metrics for only one node per server. Metrics collected for a node associated
with the Standalone Machine Agent are for the entire server hosting that node. The Standalone
Machine Agents reports metrics and hardware usage data to the Controller once a minute.
CPU Utilization: Average, minimum, and maximum values in percentage for CPU Busy Time
for the selected point in the graph.
Memory Utilization: Average, minimum, and maximum values in KB for Memory Used for the
selected point in the graph.
Disk I/O: Average, minimum, and maximum values for data (KB) written/sec for the selected
point in the graph.
Network I/O: Average, minimum, and maximum values for outgoing data in KB/sec for the
By default, the Standalone Machine Agent reports metrics for only network mounted and local
disks. Also, only the external network traffic is aggregated (to ensure backward compatibility with
previous versions of AppDynamics).
However, you can customize this default behavior by modifying the auto-generated configuration
file, task-template.xml. The task-template.xml file provides information about the current
configuration of the Standalone Machine Agent.
To enable aggregation operation for localhost (lo) network metrics, change the value of the
aggregate attribute (for the network element "lo") to "true".
To enable monitoring for a virtual disk, set the value of the enabled attribute to "true" for that
disk.
Step 3: Rename the task-template.xml file to task.xml.
It is important to rename the task-template.xml file (else it will be overwritten by Machine
Agent). The task-template.xml file is automatically generated by the Standalone Machine
Agent.
If you want the Standalone Machine Agent to monitor a special device that is not enabled,
add a file named "task.xml" in the <agent home>/monitors/JavaHardwareMonitor/ directory.
The format of the task.xml file must be exactly the same format aa the task-template.xml file.
Not all disks and networks have to be listed in task.xml. If the machine agent finds a disk or
a network that is not listed in task.xml, default properties are applied.
Step 4: Restart the Machine Agent.
Restart the machine agent for the changes to take effect.
By default, the Standalone Machine Agent uses the Java Hardware Monitor (Sigar API-based),
which may collect more metrics than you need.
For example, you may not want to see backup metrics such as the following, where out of a total
3315 metrics reported by the Standalone Machine Agent, 2584 are due to back up disk metrics :
1. Stop the Standalone Machine Agent by stopping its process. See below for info on
identifying the agent process.
2. Switch from the Java Hardware Monitor to Hardware Monitor as follows:
a. Open for edit monitor.xml from <Agent install
directory>/monitors/HardwareMonitor/monitor.xmll
b. Change <enabled>false</enabled> to <enabled>true</enabled> and then save the
file.
c. Open for edit <Agent install directory>/monitors/JavaHardwareMonitor/monitor.xml.
d. Change <enabled>true</enabled> to <enabled>false</enabled> and then save the
file.
3. Restart the Standalone Machine Agent.
From the command line, enter java -jar <Agent install directory>/machineagent.jar.
This limits the future disks metrics but will not delete the existing metrics.
AppDynamics requires the RMF (Resource Management Facility) to collect the data for the
1. Connect to the EPTDFRH user and initialize the ETPGZCK user, if not already done.
2. Connect to TSO and provide the details of IBMUSER.
3. Upon a successful connection, choose the SD (System Display and Search Facility) optio
n.
4. Use the following commands to initialize and start the RMF:
/S RMF
/F RMF,START III
/S GPMSERVE,MEMBER=01
http://192.86.32.72:8803/
After successful RMF startup, the URL should display a valid HTML page.
6. Click Explore and then Metrics to display all the available metrics for SVSCPLEX,
SYSPLEX.
1. Download and unzip the attached zos-machine-agent.zip file to the <machine-agent install
directory>/monitors/ directory.
2. Select the required metric locations, and add them to urls.list file in the zos-monitor
directory. For example:
Once the above steps are performed successfully, start the Standalone Machine Agent in debug
mode.
The following information in the Standalone Machine Agent log confirms that the processing is
successful.
Using the Standalone Machine Agent, you can supplement the existing metrics in the
AppDynamics Controller UI with your own custom metrics. There are many extensions currently
available on the AppSphere Community site. Some are created by AppDynamics and some have
been created by users.
Like built-in metrics, your custom metrics are subject to the following AppDynamics features:
automatic baselines and anomaly detection
availability for display on custom dashboards
availability for use in policies
visibility of all metrics in the Metric Browser, where you can display external metrics along
with AppDynamics metrics on the same graph
You can write a monitoring extension script (also known as a custom monitor or hardware monitor)
to add custom metrics to the metric set that AppDynamics already collects and reports to the
Controller. Your script reports the custom metrics every minute to the Standalone Machine Agent.
The Standalone Machine Agent passes these metrics to the Controller.
This topic describes the steps for adding custom metrics using a shell script and includes an
example.
Metric Names
Metric names must be unique within the same metric path but need not be unique for the entire
metric hierarchy.
It is a good idea to use short metric names so that they will be visible when they are displayed in
the Metric Browser.
Prepend the metric path to the metric name when you upload the metrics to the Controller.
The Controller has various qualifiers for how it processes a metric with regard to aggregation, time
rollup and tier rollup.
There are three types of metric qualifiers:
Aggregation qualifier
Time roll-up qualifier
Cluster roll-up qualifier
In the script, specify the metric qualifiers after the name-value pair for the metric.
A typical metric entry in the script file has the following structure:
Aggregation Qualifier
The aggregator qualifier specifies how the Standalone Machine Agent aggregates the values
reported during a one-minute period.
Specify the aggregation qualifier as aggregator="aggregator type"
This value is an enumerated type. Valid values are:
Aggregator Description
Type
SUM Sum of all reported values in the minute, causes the metric to behave like a
counter.
OBSERVATION Last reported value in the minute. If no value is reported in that minute, the
last reported value is used.
The time-rollup qualifier specifies how the Controller rolls up the values when it converts from
one-minute granularity tables to 10-minute granularity and 60-minute granularity tables over time.
The value is an enumerated type. Valid values are:
Roll up Description
Strategy
AVERAGE Average of all one-minute values when adding it to the 10-minute granularity table;
average of all 10-minute values when adding it to the 60-minute granularity table.
SUM Sum of all one-minute values when adding it to the 10-minute granularity table;
sum of all 10-minute values when adding it to the 60-minute granularity table.
CURRENT Last reported one-minute value in that 10-minute interval; last reported ten-minute
value in that 60-minute interval.
The cluster-rollup qualifier specifies how the Controller aggregates metric values in a tier (a
cluster of nodes).
Roll up Description
Strategy
INDIVIDUAL Aggregates the metric value by averaging the metric values across each node
in the tier.
COLLECTIVE Aggregates the metric value by adding up the metric values for all the nodes in
the tier.
For example, if a tier has two nodes, Node A and Node B, and Node A has 3 errors per minute
and Node B has 7 errors per minute, the INDIVIDUAL qualifier reports a value of 5 errors per
minute and and COLLECTIVE qualifier reports 10 errors per minute. INDIVIDUAL is appropriate
for metrics such as % CPU Busy where you want the value for each node. COLLECTIVE is
appropriate for metrics such as Number of Calls where you want a value for the entire tier.
Step 1. Create a directory under the Standalone Machine Agent monitors directory
The <agent home>\monitors directory is the repository for all monitoring extensions. For each new
extension, create a sub-directory under the /monitors directory. The user running the agent
requires read, write, and execute permissions to this sub-directory.
For example, to create a monitoring extension that monitors open files in the JVM, create a
sub-directory named "openfiles" under the <machine agent home/monitors> directory.
A script writes data to STDOUT. The Standalone Machine Agent parses STDOUT and sends
information to the Controller every minute. Use the following instructions to create the script file.
1. Specify a name-value pair for the metrics.
Format
The "|" character separates the branches in the metric hierarchy, telling the Controller where
the metric should appear in the metric tree:
You can insert a custom metric alongside an existing type of metric. For example, the
following declaration causes the custom metric named pool usage to appear alongside the
JMX metrics:
Server|Component:18|JMX|Pool|First|pool usage
The metric can then be used in health rules as would other types of JMX metrics.
To monitor multiple metrics with the same script file, have the script write a different line for
each one to STDOUT, such as the following:
Ensure that the agent process has execute permissions not only for the script file but also for the
contents of the file.
The os-type attribute is optional for the executable-task file element when only one os-type
is specified. One monitor.xml file executes one script per os-type.
2. Select the execution style from one of the following:
3. Add the name of this script file to the <file> element in the monitor.xml file. Be sure to use
the correct os-type attribute. The os-type value should match the value returned from
calling System.getProperty("os.name"). See http://docs.oracle.com/javase/1.5.0/docs/api/jav
a/lang/System.html#getProperties%28%29(opens in new window).
You can use either the relative or absolute path of the script.
After restarting the Standalone Machine Agent, you should see following message in your log file:
This section provides instructions to create a custom monitor for monitoring all the open files for
JVMs.
1. Create a new directory in the custom monitor repository.
2. Create the script file.
This is a sample script. Modify this script for the specific process name (for example: Author,
Publish, and so on).
3. Create the monitor.xml and point this XML file to the script file created in step 2.
<monitor>
<name>MyMonitors</name>
<type>managed</type>
<description>Monitor open file count </description>
<monitor-configuration>
</monitor-configuration>
<monitor-run-task>
<execution-style>continuous</execution-style>
<name>Run</name>
<type>executable</type>
<task-arguments>
</task-arguments>
<executable-task>
<type>file</type>
<file>openfilecount.sh</file>
</executable-task>
</monitor-run-task>
</monitor>
A Java monitoring extension enables the Standalone Machine Agent to collect custom metrics,
which you define and provide, and to report them to the Controller. This is an alternative to adding
monitoring extensions using scripts.
When you capture custom metrics with a monitoring extension, they are supported by the same
AppDynamics services that you get for the standard metrics captured with the AppDynamics
application and machine agents. These services include automatic baselining, anomaly detection,
display in the Metric Browser, availability for display on custom dashboards and availability for use
in policies to trigger alerts and other actions.
This topic describes the procedure for creating a monitoring extension in Java.
To the Standalone Machine Agent, a monitoring extension is a task that runs on a fixed schedule
and collects metrics. The task can be either AJavaTask, which executes a task within the machine
agent process, or AForkedJavaTask, which executes a task in its own separate process.
Before creating your own extension from scratch, look at the extensions that have been created
and shared among members of the AppDynamics community. The extensions are described and
their source is available for free download at:
https://github.com/Appdynamics/
New extensions are constantly being added. It is possible that someone has already created
exactly what you need or something close enough that you can download it and use it after making
a few simple modifications.
Metric Path
All custom metrics processed by the Standalone Machine Agent appear in the Application
Infrastructure Performance tree in the metric hierarchy.
Within the Application Infrastructure Performance tree you specify the metric path, which is the
position of the metric in the metric hierarchy, using the "|" character. The first step in the metric
path must be "Custom Metrics."
For example:
Custom Metrics|WebServer|
Custom Metrics|WebServer|XXX|, CustomMetrics|WebServer|YYY|
If the metrics apply to a specific tier, use the metric path for the tier, with "Component" followed by
a colon ":" and the tier ID. The metric will appear under the specified tier in the metric path. For
example:
Server|Component:18|
You can insert a custom metric alongside an existing type of metric. For example, the following
declaration causes the custom metric named pool usage to appear alongside the JMX metrics:
name=Server|Component:18|JMX|Pool|First|pool usage,value="$pool_value
The metric can then be used in health rules as would other types of JMX metrics.
You can test the appearance of your custom metric in the Controller API by posting the
metric data to the machine agent's REST API. Pass the path, name type and values of the
metric as URL arguments. See Standalone Machine Agent HTTP Listener for more
information.
Metric Names
Metric names must be unique within the same metric path but need not be unique for the entire
metric hierarchy.
It is a good idea to use short metric names so that they will be visible when they are displayed in
the Metric Browser.
Prepend the metric path to the metric name when you upload the metrics to the Controller.
The Controller has various qualifiers for how it processes a metric with regard to aggregation, time
rollup and tier rollup.
There are three types of metric qualifiers:
Aggregation qualifier
Time roll-up qualifier
Cluster roll-up qualifier
You specify these options with the enumerated types provided by the MetricWriter class. These
types are defined below.
The aggregator qualifier specifies how the Standalone Machine Agent aggregates the values
reported during a one-minute period.
Specify the aggregation qualifier as aggregator="aggregator type"
This value is an enumerated type. Valid values are:
Time Roll Up
The time-rollup qualifier specifies how the Controller rolls up the values when it converts from
one-minute granularity tables to 10-minute granularity and 60-minute granularity tables over time.
Cluster Roll Up
The cluster-rollup qualifier specifies how the controller aggregates metric values in a tier.
The NGinXMonitor class gets the following metrics from the Nginx Web Server and adds them to
the metrics reported by AppDynamics:
Active Connections: number of active connections
Accepts: number of accepted requests
Handled: number of handled requests
Requests: total number of requests
Reading: number of reads
Writing: number of writes
Waiting: number of keep-alive connections
The source for the extension class is included as an attachment.
Create a monitor.xml file with a <monitor> element to configure how the machine agent will
execute the extension.
1. Set the <name> to the name of your Java monitoring extension class.
2. Set the <type> to "managed".
3. The <execution-style> can be "continuous" or "periodic".
Continuous means to collect the metrics averaged over time; for example, average
CPU usage per minute. In continuous execution, the Standalone Machine Agent
invokes the extension once and the program runs continuously, returning data every
60 seconds.
Periodic means to invoke the monitor at a specified frequency. In periodic execution
the Standalone Machine Agent invokes the extension, runs it briefly, and returns the
data on the schedule set by the <execution-frequency-in-seconds> element.
4. If you chose "periodic" for the execution style, set the frequency of collection in
<execution-timeout-in-secs> element. The default frequency is 60 seconds. If you chose
"continuous" this setting is ignored.
5. Set the <type> in the <monitor-run-task> child element to "java".
6. Set the <execution-timeout-in-secs> to the number of seconds before the extension times
out.
7. Specify any required task arguments in the <task-arguments> element. The default
arguments that are specified here are the only arguments that the extension uses. They are
not set anywhere else.
8. Set the <classpath> to the jar file that contains your extension's classes. Include any
dependent jar files, separated by semicolons.
9.
This attached monitor.xml file configures the NGinXMonitor monitoring extension. This extension
executes every 60 seconds.
This attached monitor.xml file configures the MysqlMonitor. This monitor executes every 60
seconds, has four required task arguments and one optional task argument and one dependent jar
file.
Your monitoring extension can be invoked as a task in a workflow if you upload the zip file to the
task library. Use the instructions in To package the XML files as a Zip archive to upload the Java
monitor to the Task Library.
You can send metrics to the Standalone Machine Agent using its HTTP listener. You can report
metrics through the Standalone Machine Agent by making HTTP calls to the agent instead of
piping to the agent through sysout.
Send metrics
Send events
Upload metrics
You can use GET or POST to upload metrics to the Metric Browser under Application
Performance -> <Tier> where the tier is the one defined for the Standalone Machine Agent. For
example:
http://host:port/machineagent/metrics?name=Custom Metrics|Test|My
Metric&value=42&type=average
Upload events
http://localhost:8293/machineagent/event?type=<event_type>&summary=<summary_text
>
GET /machineagent/shutdown
On this page:
To Start Monitoring for JVM Crashes
Related pages:
Server Monitoring
When a JVM crash occurs,you need to be notified as soon as possible. Learning of a JVM crash
is very critical because it maybe a sign of a severe runtime problem in an application.
Furthermore, you may want to to take remediation steps once you are aware that a crash event
has occurred. JVM Crash is a new event type, implemented as part of JVM Crash Guard, that you
can activate to provide you with the critical information you need to expeditiously handle JVM
crashes.
The following image shows the Events window where notification of two JVM Crash events
detected is displayed.
Double-clicking the JVM Crash event on the Events window displays more information to assist
you in troubleshooting the underlying reason for the JVM crash.
On the Summary page you can download any logs associated with the JVM Crash event.
The JVM Crash event captures the following information: timestamp, crash reason, host name, IP
Prerequisite
JVM Crash Guard is a policy trigger that works with the Standalone Machine Agent to fire
an AppDynamics policy when a JVM Crash event occurs. You must therefore have a
Standalone Machine Agent installed on the system which you want to monitor for JVM
crashes. On Windows, the Standalone Machine Agent must run in Administrator root
mode. On Linux, JVM Crash Guard requires that the Standalone Machine Agent user be
able to read all the processes in /proc/*. This may be the ‘root’ user or another user with
this privilege.
1. From the left-hand navigation menu, click Alert & Respond ->Policies and then click Creat
e a Policy.
OR
Navigate to the Policies tab and then click Create a Policy.
The Create Policy dialog appears.
2. In the Other Events section, expand the Server Crashes option and click JVM Crash.
The JVM Crash event then becomes a trigger to fire a policy.
3.
Note: If an uninstrumented JVM crash happens within less than a minute of a previous crash then
it will not be reported by the Standalone Machine Agent. In some circumstances, the JVM may
crash and then be restarted only to crash again within one minute. For this repetitive cycle crash
and restart scenario, only the first JVM crash is reported by the agent.
Remediation Scripts
On this page:
Prerequisites for Local Script Actions
Remediation Scripts
Troubleshooting Remediation Scripts
Related pages:
Actions
Policies
Remediation Actions
Extensions and Integrations
A remediation action runs a remediation script in a node. The script executes on the machine from
which it was invoked or on the node specified by the remediation action configuration. You can use
this type of action to automate your runbook procedures. For example, when a specific event
occurs such as a JVM crash or a code problem and triggers a policy that calls the script, you could
have the remediation script restart the JVM or increase the size of the connection pool on the JVM
respectively.
Remediation Scripts
A remediation script is run on the machines that you specify in the remediation script configuration.
You can run the script from the machine affected by the violation that triggered the action or from a
central management server. It is not necessary for an app agent to be running on the machine on
which the script executes, just a Standalone Machine Agent.
By default the script is a shell script in /bin/sh invoked with the -ex option, unless the script has a
header, in which case the interpreter in the header is used. For example, if the script header is
"#!/bin/perl", the PERL interpreter is invoked.
A process exit code of zero indicates that the script execution succeeded. A non-zero exit code
indicates that it failed.
The script should be written as generically as possible to allow it run on any of the nodes for which
is it invoked. AppDynamics exports the following environment variables to the script runtime to
provide context regarding the environment and the event that triggered the action.
EVENT_ID 1 Event Id
Remediation scripts must be stored in a sub-directory of the machine agent installation. The
sub-directory must be named "local-scripts". The following paths are all valid:
${machine.agent.home}/local-scripts/runMe.sh
${machine.agent.home}/local-scripts/johns_scripts/runMe.sh
${machine.agent.home}/local-scripts/ops/johns_scripts/runMe.sh
The AppDynamics Pro Controller and agents are easy to install and administer.
The following topics describe procedures and provide reference material relevant to the
AppDynamics Pro Administrator.
Upgrade the Standalone Machine Agent
Determine Whether a Server is Down
Controller Settings for Machine and Database Agents
Machine Agent FAQ
Related pages:
Standalone Machine Agent Configuration Properties
Agent - Controller Compatibility Matrix
If an application server agent is not reporting to the Controller, the App Agent Status in the App
Servers list displays a red icon with a downward-facing arrow and a status of zero.
Similarly, if a machine agent is not reporting to the Controller, the Machine Agent Status in the App
Servers list displays the same icon.
If the agent is not reporting, it is possible that the server is down, although here could be other
reasons why the agent is not reporting.
To investigate further, in the Metric Browser locate the individual node in question in the Agent
branch of the Application Infrastructure Performance tree. If the value of the Availability metric for
the application is zero, the app server is down. If the value of the Availability metric for the
machine is zero, the machine is down.
Related pages:
Access the Administration Console
Database Size and Data Retention
The following describes settings on the Controller Admin window that are specific to the Database
Agent and Standalone Machine Agent.
You can change the amount of data you retain in the Controller database by changing the
1. Log in to the Controller administration console using the root account password. See Acces
s the Administration Console.
http://<controller host>:<port>/controller/admin.html
Use the root account password to access the Admin console when the Controller is installed
in single- or multi-tenant mode. If you have not set this password, call AppDynamics Support
to get the default password.
2. Click Controller Settings.
3. Change the following parameters as required and then click Save.
Changes to the settings will be in effect the next time the agent is restarted and connects to the
Controller.
If the machine agent process is running in the background, you can stop it by simply entering the
kill command with the process ID as the argument. If it is running in the foreground in a console,
you can press Ctrl+C to shut down the agent.
Note that the Machine Agent implements a shutdown hook, so issuing the kill command (or Ctrl+C)
from the operating system causes the the agent to perform a graceful shut down.
For Linux
Use the following command to identify which process is running the Standalone Machine Agent.
For Windows
Process Explorer is a free application from Microsoft that can help you identify the Standalone
Machine Agent process. When there are multiple java processes running, hover over a java
process in Process Explorer to identify the process that was started using the machineagent.jar
file.
For example, in Process Explorer, hover over a process to see information about how the process
was started as you can see in the following window:
If an application server agent is not reporting to the Controller, the App Agent Status in the App
Servers list displays a red icon with a downward-facing arrow and a status of zero.
Similarly, if a machine agent is not reporting to the Controller, the Machine Agent Status in the App
This situation may occur when a 32-bit JRE is used with 64-bit operating system. To solve this
problem, use a 64-bit JRE with the 64-bit operating system.
The Standalone Machine Agent monitors a particular machine and not a particular application
server. The agent can therefore refer to multiple nodes running on the same machine. A flow map,
on the other hand, displays the communication between different nodes during application
execution, or the business transaction flow from tier to tier. A Standalone Machine Agent cannot
be a part of the flow and therefore is not shown in the flow map.
Metrics monitored by the agent are included in the infrastructure health indicator in the
dashboards.
The health indicator is driven by health rule violations in the given time period and health rule
violations are configured on hardware metrics collected by the Standalone Machine Agent. Health
rules for all possible metrics are not pre configured out-of-the-box. To configure additional health
rules, see Configure Health Rules.
Switch from the Java Hardware Monitor to the Hardware Monitor if you see messages similar to
the following in the logs: