Url Monitoring Extension

An AppDynamics Machine Agent extension to visit a set of URLs and report whether they are up or down.

This extension requires the Java Machine Agent.

Metrics Provided

- Average Response time (ms)
- Response Bytes
- Response Code
- Status : FAILED(2), ERROR(3), SUCCESS(4)

Response Code (HTTP Status code)Status
2004
other than 2003
any exceptions2

Installation

1. Download UrlMonitor-<version>.zip and unzip UrlMonitor-<version>.zip into $MACHINE_AGENT_HOME/monitors. This will create a new directory called UrlMonitor.
2. In $MACHINE_AGENT_HOME/monitors, edit the file monitor.xml and config.yml to configure the plugin referring to the below section.
3. Restart the machine agent.

In the AppDynamics Metric Browser, look for: Application Infrastructure Performance | <Tier> | Individual Nodes | <Node> | Custom Metrics | URL Monitor

Configuration

Every AppDynamics extension has amonitor.xmlfile that configures the extension. In this case, themonitor.xmlfor this extension just has a single option: the path where the extension can find the mainconfig.yamlfile. Note that the path is relative to$AGENT_HOME.

   <task-arguments>
      <argument name="config-file" is-required="true" default-value="monitors/UrlMonitor/config.yaml" />
    </task-arguments>

 

clientConfig:
    maxConnTotal:             1000
    maxConnPerRoute:          1000
    ignoreSslErrors:          true
    userAgent:                Mozilla/5.0 AppDynamics-UrlMonitor/1.0.6

defaultParams:
    method:                   HEAD
    socketTimeout:            30000
    connectTimeout:           30000
    numAttempts:              3
    treatAuthFailedAsError:   true

sites:

- name:       Google
  url:        http://www.google.com

- name:       AppDynamics
  url:        https://www.appdynamics.com

- name:       My Slow Site
  url:        http://www.wordpress.com
  connectTimeout: 60000

- name:       Help
  url:        https://help.appdynamics.com

- name:       My Controller
  url:        https://mycontroller.saas.appdynamics.com/controller/rest/applications
  username:   demouser@customer1
  password:   welcome

- name:     My POST site
  url:      http://posturl
  username: ""
  password: ""
  connectTimeout: 60000
  method:   POST
  headers:
        Content-Type: application/json
  requestPayloadFile: path/to/postrequestPayloadFile
  matchPatterns:
      - name:       Error
        type:       substring
        pattern:    Error 400

Configuration Reference

Client Section

The clientConfig section sets options for the HTTP client library, including:

Option NameDefault ValueOption Description
maxConnTotal1000Maximum number of simultaneous HTTP connections
maxConnPerRoute1000Maximum number of simultaneous HTTP connections to a single host
threadCount10Maximum number of Threads spawned to cater HTTP request
ignoreSSlErrorsfalseWhether to ignore errors in SSL certificate validation or host validation
userAgentMozilla/5.0 (compatible; AppDynamics UrlMonitor;http://www.appdynamics.com/)Custom User-Agent header to send with requests (can be used to mimic desktop or mobile browsers)
followRedirectstrueWhether the client should follow Redirect responses
maxRedirects10Maximum redirects
Default Site Section

The defaultParams section sets the default options for all sites. These options can then be overriden at the individual site level.

Option NameDefault ValueOption Description
methodGETHTTP method to use (e.g. GET, POST, HEAD, OPTIONS, etc.). The default is "HEAD", which avoids the overhead of retrieving the entire body of the response, but which prevents the agent from doing pattern matching or reporting the response size. Make sure you set the method to GET if you want these features.
socketTimeout30000Maximum time to wait for a socket connection to open, in milliseconds
connectTimeout30000Maximum time to wait for the HTTP handshake, in milliseconds
numAttempts1Number of times the site will be retrieved. The metrics then reported will be an average over all attempts.
treatAuthFailedAsErrortrueIf false, the extension will report the site status as "SUCCESS" even if authentication fails.
proxyConfignullProvide host and port.
ProxyConfig section
Option NameDefault ValueOption Description
hostnoneproxy host
portnoneproxy port
usernamenoneproxy username
passwordnoneproxy password
Site Section
Option NameDefault ValueOption Description
namenoneName of the url with which metric folder that will be created in Metric Browser
urlnoneThe url to monitor
usernamenoneusername if url has Basic Authentication
passwordnonepassword if url has Basic Authentication
matchPatternsnonematch patterns to search for in the response
Match Pattern Section
Option NameDefault ValueOption Description
namenoneName of the metric folder that will be created in Metric Browser
patternnoneThe string to search for
typesubstringCan be one of: substring, caseInsensitiveSubstring, regex, or word (see below)

 

The options for the pattern type are:

ValueMeaning
substringExact match on the given string
caseInsensitiveSubstringCase-insensitive match on the given string
regexRegular expression match
wordCase-insensitive, but the target string must be surrounded by non-word characters

Custom Dashboard

url-pinger-dashboard.png

Contributing

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

Community

Find out more in the Community

Support

For any support questions, please contact help@appdynamics.com.

 

Version:

1.2.3

Compatibility:

3.7 or later

Last Update:

07/28/2016

 

 1.0.2 - Fixed Memory leak

 1.0.3 - Fixed thread pool shutdown issue

 1.0.4 -  Using ning async library.adding more flexibility, features and metrics.

 1.1.0 - Added Regex Matching Patterns

 1.1.1 - Fixing the typo in the pom for config.yml file

 1.1.2 - Fixing bug in response status and adding proxy support

 1.2.0 - Making sure the Machine agent is provided and is not bundled in the jar

 1.2.1 - Support for POST and change in timerollup_type to average for some metrics

 1.2.2 - ignoreSSLErrors functionality

 1.2.3 - Fixed metric drop issue in case of large number of URLs