This repository is deprecated; please follow the main search page or use the ‘Related code repos’ widget on the right side of the current page.

AppDynamics Static Monitoring Extension

This extension works only with the standalone machine agent.

##Use Case

Once per minute, this monitoring extension reads metrics from the metrics.xml file and reports them to the AppDynamics Controller.

For example, you can create a metric named "maintenance mode" and put a value of 0 if the node (where the corresponding Machine Agent is installed) is not in maintenance mode, and a value of 1 if it is in maintenance mode.

At any time you can make manual (or automated) updates -- such as changes in the value or name of a metric -- to the metrics.xml file. It will take up to one minute for the Static Monitoring Extension to report these updates to the Controller.

This extension also gives you the opportunity to create policy alerting based on AND or OR clauses.

For example, if the traffic of a node falls below a certain threshold AND this node is not in maintenance mode, you can have an AppDynamics policy trigger an action.

##Installation

  1. Run 'ant package' from the static-monitoring-extension directory
  2. Deploy the file StaticMonitor.zip located in the 'dist' directory into <machineagent install dir>/monitors/
  3. Unzip the deployed file
  4. In <machineagent install dir>/monitors/StaticMonitor/ open metrics.xml and enter data for at least one metric.
  5. Optional but recommended. Open monitor.xml and configure a custom metric path (see monitor.xml for instructions)
  6. Restart the Machine Agent.

Look for the metrics in the AppDynamics Metric Browser at: Application Infrastructure
Performance | <Tier> | Custom Metrics | Static Monitor | <Metric
name> or at: Application Infrastructure Performance | <Tier> | <your configured name (optional)>

##Directory Structure

Directory/File Description
conf Contains the monitor.xml and metrics.xml files
lib Contains third-party project references
src Contains source code to the Static monitoring extension
dist Only obtained when using ant. Run 'ant build' to get binaries. Run 'ant package' to get the distributable .zip file
build.xml Ant build script to package the project (required only if changing Java code)

XML files:

  • monitor.xml: This is used to execute the Java code which will start
    the monitoring extension. You might need to configure the path to metrics.xml
    (explained in Installation Steps)
  • metrics.xml: Define your own custom metrics here, and update this
    file at any time. The metrics will be reported to the Controller
    once per minute.

Note: Main Java File: src/main/java/com/appdynamics/monitors/staticmonitor/StaticMonitor.java -> This file contains the metric parsing and printing.

##XML Example

###metrics.xml

Parameter Description
<metric-name> The name of the metric
<metric-value> An integer value of the metric. This metric is reported to the Controller once per minute.

<static-monitor>
    <!-- You can have more than one metric if you wish -->
    <metric>
        <!-- Enter the name of your metric -->
        <metric-name>Machine ABC Maintenance Mode</metric-name>

        <!-- Enter an integer. This value is reported to the controller once 
             per minute (default is 0) -->
        <metric-value>1</metric-value>
    </metric>
    <metric>
        <!-- Enter the name of your metric -->
        <metric-name>Machine XYZ Maintenance Mode</metric-name>

        <!-- Enter an integer. This value is reported to the controller once 
             per minute (default is 0) -->
        <metric-value>0</metric-value>
    </metric>
</static-monitor>

##Contributing

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

##Community

Find out more in the AppSphere community.

##Support

For any questions or feature request, please contact AppDynamics Center of Excellence.

View code on GitHub

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.