Previous Topic: Monitoring AppliancesNext Topic: Switches


MON Application Monitoring Appliance

Latest version: 4.1.3-1

MON: Application Monitoring Appliance

At a Glance

Catalog

System

Category

Monitoring

User volumes

yes

Min. memory

288 MB

OS

Linux

Constraints

no

Functional Overview

MON is an application monitoring appliance that collects performance and resource usage statistics, such as counters, from other appliances in an application. Appliances report their counters to MON through the mon terminal.

MON provides a visual interface using a web browser to access and view the appliance counters. Through the visual interface, you create views containing one or more graphs. Each graph displays one or more appliance counters.

In addition, MON supports background monitoring of appliance counters. All counters in a single view, as specified by the alarm_view property, are monitored in the background by MON. Whenever one of these counters falls below or exceeds a specified threshold, MON generates an alarm to the grid controller, which posts a message to the dashboard. A browser to the MON visual interface does not have to be open for MON to monitor the appliance counters in the background.

Collection is done using a custom REST-based protocol, running over HTTP. For additional information on the monitoring API functionality, refer to the Monitoring API Reference.

Resources

Resource

Minimum

Maximum

Default

CPU

0.05

4

0.10

Memory

288 MB

2 GB

288 MB

Bandwidth

1 Mbps

500 Mbps

100 Mbps

Terminals

Name

Dir

Protocol

Description

mon

in

CCE

Terminal on which performance and resource usage statistics are received.

web

in

HTTP

Terminal used to access and view the appliance counters.

aux

in

Any

Input used for programmatic collection of counters.

The default interface is enabled. The default interface is used by the appliance to report to AppLogic that it has booted successfully. It can also be used to log in over secure shell to the appliance from the controller, primarily for diagnostic and troubleshooting purposes. The default interface is used by the GUI to access the visual interface of a MON appliance.

User Volumes

Volume

Description

data

Read/write, providing storage for persistent state of MON. For example, views and graphs.

Properties

Property name

Type

Description

title

String

Title to display in the browser windows of MON's visual interface. If empty, the application name is used. Default is empty.

user

String

User name for web-based authentication. Authentication is only used when accessing MON through the web terminal (that is, through a gateway). There is no authentication when accessing MON's visual interface through the CA AppLogic GUI. If empty, there is no authentication. Default is empty.

password

String

Password for web-based authentication. This property is not used if user is empty. Default is empty.

alarm_view

String

Name of the view containing the appliance counters to be monitored in the background. Only one view name can be specified. If empty, background monitoring is disabled. Default is empty.

Error Messages

The following messages may appear in either the appliance log file or the system log of the grid controller when the appliance fails to start:

Counter Groups and Counters

The following counters groups are defined for all appliances:

See Creating Custom Counters on how to create and monitor custom counters in an appliance.

Monitoring Applications Through the CA AppLogic GUI

The following diagram shows a typical usage of MON for a simple application. In this application, the monitor can be accessed through the AppLogic GUI only.

Appliances in use:

The mon terminal of all appliances are connected to the mon terminal of mon.

Note: To display graphs using Windows Internet Explorer, you must set display all websites in compatibility mode. To set this mode, access the menu bar, click Tools and Compatibility View Settings, then select the Display all websites in Compatibility View check box and click close.

Monitoring Application Through Both the GUI and an IP Address

The following diagram shows how MON can be used to access the application monitor through the GUI or through an IP address on port 80.

Appliances in use:

The mon terminal of all appliances are connected to the mon terminal of mon.

The out terminal of admin is connected to the web terminal of mon so users can access the monitor through the IP address specified by the ip_addr property on admin.

Monitoring Applications Through Both the CA AppLogic GUI and an Application IP Address on Port 8080

The following diagram shows how MON can be used to access the application monitor through the GUI or through an application IP address on port 8080.

Example: How MON can be used in order to access the application monitor through the AppLogic GUI or through an application IP address on port 8080

Appliances in use:

The mon terminal of all appliances are connected to the mon terminal of mon.

INSSLR is configured to forward https traffic to the WEBx8 and all other TCP traffic to the aux terminal. PS8 is configured to forward all traffic on port 8080 through out8 to the web terminal of mon. This allows users to monitor the application through the application IP address specified by the ip_addr property on INSSLR on port 8080.

Note: The MAIL appliance is not distributed with CA AppLogic.

Background Monitoring

This use case describes how to use MON to monitor appliance counters in the background and have it generate alerts when an appliance counter is out of range.

  1. Set the alarm_view property on MON to the name of a view that contains the counters to be monitored.
  2. (Re)start the application.
  3. Login to the Application Monitor.
  4. Click on the New button to create a new view and give it the same name as the alarm_view property.
  5. Click on the Add Graph button to create a new graph and add it to the view.
  6. Select a counter to be monitored and add it to the graph.
  7. Set the alarm threshold by filling in the two boxes next to Alarm.
    To set a minimum threshold, enter a value in the left text box. There is no minimum threshold if this text box is left empty.
    To set a maximum threshold, enter a value in the right text box. There is no maximum threshold if this text box is left empty.
  8. Repeat steps 5-7 to monitor additional appliance counters.

Whenever an appliance counter falls below or exceeds the specified threshold, MON generates an alert to the CA AppLogic Controller. A message is then logged to the dashboard specifying which counter of which appliance is out of range. For each appliance, the CA AppLogic Controller only logs the last alert to the dashboard, however it will specify in the dashboard message if multiple alerts have been received for the appliance. All alerts are logged to /var/log/messages on the CA AppLogic Controller.

Note: A browser to the Application Monitor does not have to be open for MON to monitor the appliance counters in the background.

To stop monitoring a specific appliance counter:

To disable background monitoring, execute one of the following:

Data Collection Interface

Since version 1.1.3, the MON appliance provides a REST-service-like data collection API, it exports counter configuration and values in XML, JSON and UDL formats. For more details on the API, visit MonDataCollectionInterface.

Notes

Known Limitations

To monitor an application through the GUI, the name of the MON appliance in the application should be mon.

Open source and 3rd party software used inside of the appliance

Software

Version

Modified

License

Notes

CGI.pm

3.51-127

No

GPL+ or Artistic

N/A

perl-CGI-Session

4.35-5

No

GPL+ or Artistic

N/A

perl-Error

0.17015-4

No

GPL+ or Artistic

N/A

perl-IPC-Run

0.84-2

No

GPL+ or Artistic

N/A

freetype

2.3.11-6.el6_2.9

No

FreeType License and GPLv2+

N/A

httpd

2.0.63

No

Apache license

N/A

mod_perl

2.0.4-6

No

GPLv2

N/A

Appliance Counters
Overview

This document defines the list of all standard counters exported by CCA. CCA is the counter collection agent that runs in all AppLogic appliances. CCA is used to report counters to the monitoring GUI exposed by the MON appliance. The availability of these counters might be limited on some of the supported appliance platforms. When the appliance OS supports a given counter it should be visible in the MON GUI when the appliance's mon output terminal is connected to the MON appliance.

CPU Summary

Counter

Linux

Windows

CPU I/O Wait

yes

no

CPU Idle

yes

yes

CPU Irq

yes

yes

CPU Nice

yes

no

CPU Soft Irq

yes

no

CPU System

yes

yes

CPU Total

yes

yes

CPU User

yes

yes

File System

Counter

Linux

Windows

Allocated File Handles

yes

no

Block Devices

yes

no

Block Devices Unique

yes

no

Character Devices

yes

no

Character Devices Unique

yes

no

Directories

yes

no

Directories Unique

yes

no

Fifos

yes

no

Fifos Unique

yes

no

Free File Handles

yes

no

Regular Files

yes

no

Regular Files Unique

yes

no

Sockets

yes

no

Sockets Unique

yes

no

Used File Handles

yes

no

Memory Statistics

Counter

Linux

Windows

Active

yes

no

Buffers

yes

no

Cached

yes

yes

Free

yes

yes

High Free

yes

no

High Total

yes

no

High Used

yes

no

Inactive

yes

no

Low Free

yes

no

Low Total

yes

no

Low Used

yes

no

Swap Cached

yes

no

Swap Free

yes

no

Swap Pages IN

yes

no

Swap Pages OUT

yes

no

Swap Total

yes

no

Swap Used

yes

no

Total

yes

no

Used

yes

no

Scheduler

Counter

Linux

Windows

Context switches

yes

yes

Interrupts

yes

yes

Jobs for 1 min

yes

no

Jobs for 15 min

yes

no

Jobs for 5 min

yes

no

Pages IN

yes

yes

Pages OUT

yes

yes

Process startups

yes

no

Processes blocked

yes

yes

Processes running

yes

yes

CPU#X

Counter

Linux

Windows

CPU I/O Wait

yes

no

CPU Idle

yes

yes

CPU Irq

yes

yes

CPU Nice

yes

no

CPU Soft Irq

yes

yes

CPU System

yes

yes

CPU Total

yes

yes

CPU User

yes

no

Volume X

Counter

Linux

Windows

Bytes Read

yes

yes

Bytes Written

yes

yes

Disk Reads

yes

yes

Disk Sectors Read

yes

no

Disk Sectors Written

yes

no

Disk Writes

yes

yes

Free Files

yes

no

Free Space

yes

yes

Time Spent in Reads

yes

yes

Time Spent in Writes

yes

yes

Total Files

yes

no

Total Space

yes

no

Used Files

yes

no

Used Space

yes

no

Terminal X

Counter

Linux

Windows

Recvd bytes

yes

yes

Recvd packets

yes

yes

Sent bytes

yes

yes

Sent packets

yes

yes

Overview

Each appliance running the ccad (counter collection agent) daemon allows for custom counters to be defined and collected by 3rd party utilities. This ability is named extension interface and provides appliance creators with option to monitor appliance-specific counter data through the standard MON user interface.

Creating Custom Counters

To monitor custom counters you need to add the counters definitions to the ccad configuration and feed the actual counter values to ccad

Adding counter definitions

The custom counters have to be defined in the optional /etc/ccad.conf configuration file in UDL format. When you change the configuration, the ccad daemon must be restart for the changes to take effect.

Here is a simple example configuration:

counters Apache
   {
   pace = 1000
   pipe = /tmp/cca
   counter Total_Accesses
      {
      name        = "Total hits"
      desc        = "Total number of hits"
      units       = "#"
      type        = "MAX"
      }
   counter Total_kBytes
      {
      name        = "Total bytes"
      desc        = "Total number of bytes"
      units       = "bytes"
      type        = "MAX"
      }
   counter BusyWorkers
      {
      name        = "Active requests"
      desc        = "Number of active requests"
      units       = "#"
      type        = "MAX"
      }
   counter IdleWorkers
      {
      name        = "Idle servers"
      desc        = "Number of idle servers"
      units       = "#"
      type        = "MAX"
      }
   }

This example defines 4 counters. Each counter entity supports the following attributes:

The root-level counters entity's name is used for Entity name when the counters are later shown in MON. Additionally, the following attributes are meaningful for this entity:

In addition to counter definition method described above, ccad.conf allows counters to be grouped together. This is achieved by placing them one level deeper in group entities as in the following example:

counters Plants
   {
   pace = 2000
   pipe = /my-pipe
   counter tree: desc = "Any tree" , units = "#"
   group Fruits
      {
      desc = "Delicious Fruits!!!"
      counter pears : desc = "Number of pears"   , units = "pears"
      counter apples: desc = "Number of apples"  , units = "apples"
      }
   group Vegetables
      {
      counter potato: desc = "Number of potatoes", units = "potatoes"
      counter tomato: desc = "Number of tomatoes", units = "tomatoes"
      }
   }

This configuration would produce 3 custom counter entities in MON's GUI - Plants, Delicious Fruits!!! and Vegetables with the 5 defined counters distributed among them. Groups support a desc attribute (just like counter entities) that can be used to define a richer group name as opposed to the more constrained group entity name. Counter names should be unique across the configuration file otherwise the counter collection would be made impossible for the duplicate counter names.

Feeding counter data

Once you have the ccad running with the proper counter definitions, you need to feed the actual counter values. To do so, write the counter values to the named pipe create by ccad (specified by the pipe attribute in /etc/ccad.conf, default /tmp/cca).
The proper format is one of the following:

counter = value (name and value are separated with =)

counter : value (name and value are separated with :)
A counter set should be flushed (to MON) by printing . or form feed character (\f) in the named pipe on a line by itself. A counter collection script (in Bash) could do the following to feed counter to ccad:

echo "Total_Accesses = 31" > /tmp/cca
echo "Total_kBytes = 22241" > /tmp/cca
echo "BusyWorkers = 6" > /tmp/cca
echo "IdleWorkers = 34" > /tmp/cca
echo "." > /tmp/cca

This should be done every pace milliseconds as specified in /etc/ccad.conf

Here is a simple bash loop that would collect the needed data and feed it to ccad. We feed more data than we need as it faster to give all the collected data to ccad (which will ignore the lines that are not counter values) than to parse the data before feeding it to ccad:

while true; do
   curl -s http://in/server-status?auto | sed "s/^Total\ /Total_/g" > /tmp/cca # this parses the data so it matches out counter definitions
   sleep 1 || exit 4        
   echo "." > /tmp/cca
done
Examples

Windows Example

The following Windows custom counter example uses Perl.  To install the Perl Win32 package on a managed Windows appliance if it is not already present:

The following is the code example:

#!/bin/perl
use Win32::Pipe;

my $defaultPace=1000;
my $defaultPipe="\\\\.\\pipe\\cca";
my $ccadConf="/etc/ccad.conf";

sub get_value_from_config
   {
   open(F, $ccadConf) || die "can't open $ccadConf: $!\n";
   while(<F>)
      {
      #($name, $value) = split('=');
      my $row=$_;
      $row =~ m/^\s*(\w+)\s*=\s*(.*)\s*$/;
      if ($_[0] eq $1)
         {
         close F;
         return $2;
         }
      }
   close F;
   return "";
   }

my $cfgPace = &get_value_from_config("pace");
my $cfgPipe = &get_value_from_config("pipe");
if ($cfgPace eq "") { $cfgPace = $defaultPace; }
if ($cfgPipe eq "") { $cfgPipe = $defaultPipe; }
else { $cfgPipe = "\\\\.\\pipe\\".$cfgPipe; }

my $pipe;
$pipe = new Win32::Pipe($cfgPipe) || die "can't connect to pipe\n";
$pipe->ResizeBuffer(4096);

# this loop feeds a counter named Test with a value which increments on each iteration
my $val = 0;
while (1)
  {
   $val ++;
   my $str = "Test = $val\n.";
   $pipe->Write( $str );
   sleep( $cfgPace / 1000 );
   }

Mysql

#!/bin/bash

DEFAULT_PACE=1000
DEFAULT_PIPE=/tmp/cca
CCAD_CONF=/etc/ccad.conf
MYSQL='/usr/bin/mysql'
TR=/usr/bin/tr
SLEEP=/bin/sleep
function get_value_from_config {
   CONF_VALUE=`grep -oE "$1[[:space:]]*=[[:space:]]*[^[:space:]]+" $CCAD_CONF |cut -d"=" -f 2|tr -d " "`
}
get_value_from_config "pace"
PACE=${CONF_VALUE:-$DEFAULT_PACE}
PACE=$(( $PACE / 1000 ))
get_value_from_config "pipe"
PIPE=${CONF_VALUE:-$DEFAULT_PIPE}
test -p $PIPE || exit 3
while true; do
   $MYSQL -e 'show status'|$TR '[[:blank:]]' '=' > $PIPE
   $SLEEP $PACE || exit 4
   echo "." > $PIPE
done

Linux Examples

Apache

Note: The server must have 'extended status' enabled

#!/bin/bash

DEFAULT_PACE=1000
DEFAULT_PIPE=/tmp/cca
CCAD_CONF=/etc/ccad.conf
STATUS_URL='http://in/server-status?auto'
CURL=/usr/bin/curl
SED=/bin/sed
SLEEP=/bin/sleep
function get_value_from_config {
   CONF_VALUE=`grep -oE "$1[[:space:]]*=[[:space:]]*[^[:space:]]+" $CCAD_CONF |cut -d"=" -f 2|tr -d " "`
}
get_value_from_config "pace"
PACE=${CONF_VALUE:-$DEFAULT_PACE}
PACE=$(( $PACE / 1000 ))
get_value_from_config "pipe"
PIPE=${CONF_VALUE:-$DEFAULT_PIPE}
test -p $PIPE || exit 3
while true; do
   $CURL -s "$STATUS_URL" | $SED "s/^Total\ /Total_/g" > $PIPE
   sleep $PACE || exit 4
   echo "." > $PIPE
done