BroadView™ API Guide and Reference Manual
Ganglia Plugin

BroadView™ Instrumentation Agent source code provides Ganglia Plugin for Ganglia monitoring tool to get BST statistics. The Ganglia monitoring tool runs on separate PC/Server and it gets the data from BroadViewAgent in the REST format. The BroadView Ganglia plugin configures periodic interval and enables BST in the BroadViewAgent via REST mechanism. The BroadViewAgent sends the BST statistics to Ganglia monitoring tool(gmond). The Ganglia web plots the data that can be viewed by user by connecting to Ganglia server over HTTP.

The gmond is installed on ganglia server. There can be multiple gmond running on ganglia server each interacting with one BroadView Agent running at specific target hardware (switch). The diagram below illustrates execution of multiple gmond.

ganglia_multiple.jpg

There is one Primary (P) gmond and multiple secondary (S) gmond. Each of the gmond (primary or secondary) gets the data from a switch. Each of the secondary gmond sends the data to primary gmond. The gmetad receives the data only from primary gmond.

The Ganglia plugin source code is available in the BroadView source code archive at '<broadview>/example/ganglia/.' The source code contains 'gmond' and 'module' code, sample configuration file and scripts to build and install ganglia for collecting BST statistics from BroadViewAgent.

Prerequisites

Ganglia source code 3.7.1 and Ganglia Web source code 3.7.0 is needed.

Ganglia requires several packages including Apache web server for building, installation and execution. These packages may or may not exist in the build server. So, it is required that the environment should be setup first.

Typically, setup the environment by executing './configure' script on ganglia source code. The script may require several additional packages depending on available packages on the build server and platform. Use Ganglia installation steps which is typically 'make', 'make install' etc and make sure that the graphs are seen.

  ./configure --with-gmetad

Typically below mentioned packages would be needed; any additional packages may also be needed depending on the build server environment.

apt-get install libjson-perl
apt-get install apt-file
apt-get install build-essential automake autoconf pkg-config
apt-get install gperf libtool
apt-get install rrdtool librrd-dev libconfuse-dev  libpcre3-dev
apt-get install libapr1 libapr1-dev libaprutil1-dev
apt-get install php-pear
apt-get install apache2
apt-get install php5 php5-gd

Running BroadViewAgent

Running BroadViewAgent is explained in another section.So, the configuration file for Agent should be as mentioned below. The parameter 'bview_client_port' is the port number where gmond listen

bview_client_ip=<ganglia IP address>
bview_client_port=9808
agent_port=8080

Installing Additional Packages:

Ganglia compilation process requires additional packages be installed on ganglia server. These are

Running Apache

Ganglia requires Apache web server be running so make sure Apache is already running.

Plugin BST with Ganglia

Plugging in BST with Ganglia requires a number of steps. The steps include copying the ganglia BST plugin code to Ganglia source tree, configuration, building the source code, installation and execution. These are mentioned below.

   "metricinfo" : [
   "metric_type": "absolute",
      { "metric": "bst_device_data_NONE_NONE", "shortname": "DeviceStat", "color": "33cccc"},
      { "metric": "bst_ingress-port-priority-group_um-share-buffer-count_37_7", "shortname": "ippg_umhb_37_7", "color": "335555"},
      { "metric": "bst_ingress-service-pool_um-share-buffer-count_0_NONE", "shortname": "ipsp_umsb_0", "color": "cc5555"},
      { "metric": "bst_ingress-port-priority-group_um-share-buffer-count_38_7", "shortname": "ippg_umhb_38_7", "color": "775555"}
     ]

metricinfo attribute This attribute is used to collect and display specific statistics on Ganglia web. The 'metric_type' holds value as 'absolute' or 'percentage' with a default as 'percentage'. The string for 'metric' field has to be in a specific format. The string encoding format is

bst_<realm>_<name>_<index1>_<index2>

The following table provides the list of realms and the associated indices for each of the realm. It also lists all the available statistics for each realm.

ganglia_table_1.jpg

The following conditions apply

  1. The <realm> can be any of the supported realms from above tables for the statistics.
  2. The <name> should be the name of the corresponding stat parameter from the tables above.
  3. The <index1>, <index2> must contain the values for the appropriate indices (as required by the corresponding statistics).

Note: For the statistics, where one or both of the indices are not required, the string NONE should be used as the indices.

Make sure these files are generated successfully by above script.

<ganglia>/ganglia-web-3.7.0/conf/default.json
<ganglia>/ganglia-web-3.7.0/graph.d/bst_report.json

The location where libganglia.so.0 is installed must be included along with other library paths.

{
"name" : "switch-1",
   "configparams" : [
      { "param": "agent_ip", "value": "10.130.86.31"},
      { "param": "agent_port", "value": "8080"},
      { "param": "bstapp_local_port", "value": "9808"},
      { "param": "polling_interval", "value": "2"}
   ]
}

name attribute: This attribute is name of the switch. The name should be unique for each switch. The name should always be in small letters.

configparams attribute This attribute is used to communicate with Agent/switch. The attribute contains IP address and port number of the agent. It also contains the port number where gmond listen (bstapp_local_port) and polling interval for getting data from the switch.

Changing metrics, metric type and switch parameter and re-running

Follow below steps to change metric and re-running gmetad and gmond.

Viewing web page

To View web page, connect to Ganglia Server via web (http://<IP>/ganglia/). This shows BST graph. A sample BST graph is shown below.

ganglia_graph.jpg