BroadView™ API Guide and Reference Manual
|
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.
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.
Create a directory <ganglia> This is the root directory which should contain Ganglia open source code, Ganglia web source code and Ganglia BST code.
# mkdir <ganglia>
Extract the ganglia source code from open source forum to <ganglia> directory
# cd <ganglia>
# tar -xzf ganglia-3.7.1.tar.gz
Extract the ganglia web source code from open source forum to <ganglia> directory
# tar -xzf ganglia-web-3.7.0.tar.gz
Copy the file 'ganglia-3.7.1-p1.patch' from BroadView source archive <broadview>/example/ganglia to <ganglia> directory and apply the patch on Ganglia source code.
# cd <ganglia>
# cp <local_dir>/<broadview>/example/ganglia/ganglia-3.7.1-p1.patch .
# patch -p1 < ganglia-3.7.1-p1.patch
Copy the file 'ganglia-web-3.7.0-p1.patch' from BroadView source archive <broadview>/example/ganglia to <ganglia> directory and apply the patch on Ganglia web source code.
# cd <ganglia>
# cp <local_dir>/<broadview>/example/ganglia/ganglia-3.7.0-p1.patch .
# patch -p1 < ganglia-web-3.7.0-p1.patch
Copy the directory 'bst_app' from BroadView source archive <broadview>/example/ganglia to <ganglia>/ganglia-3.7.1/gmond
# cd <ganglia>/ganglia-3.7.1/gmond
# cp -R <local_dir>/<broadview>/example/ganglia/bst_app .
Copy files 'cJSON.c' and 'cJSON.h' from BroadView source archive <broadview>/vendor/cjson/cJSON.c and <broadview>/vendor/cjson/cJSON.h respectively to <ganglia>/ganglia-3.7.1/gmond/bst_app
# cd <ganglia>/ganglia-3.7.1/gmond/bst_app
# cp -R <local_dir>/<broadview>/vendor/cjson/cJSON.* .
Copy the directory 'bst' from BroadView source archive <broadview>/example/ganglia/modules to <ganglia>/ganglia-3.7.1/gmond/modules
# cd <ganglia>/ganglia-3.7.1/gmond/modules
# cp -R <local_dir>/<broadview>/example/ganglia/modules/bst .
Copy various scripts, configurations and json files (compile_install.sh, gen_bst_metrics.sh, gen_gmond_primary.sh, gen_gmond_secondary.sh, change_metric_type.sh, gen_bst_metrics.pl, gen_gmond_primary.pl, gen_gmond_secondary.pl, gmond_src_primary.conf, gmond_src_secondary.conf, metric_input.json, switch_conf.json) from BroadView source archive '<broadview>/example/ganglia' to <ganglia> directory.
# cd <ganglia>
# cp <local_dir>/<broadview>/example/ganglia/*.sh .
# cp <local_dir>/<broadview>/example/ganglia/*.pl .
# cp <local_dir>/<broadview>/example/ganglia/*.conf .
# cp <local_dir>/<broadview>/example/ganglia/*.json .
"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.
The following conditions apply
Note: For the statistics, where one or both of the indices are not required, the string NONE should be used as the indices.
Run the script 'compile_install.sh'. The script performs building and installing ganglia. The script auto generates few files..
# cd <ganglia>
# ./compile_install.sh
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.
Run 'gmetad'
# gmetad
{ "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.
Run Primary gmond with the command mentioned in the output of following shell script
# sh gen_gmond_primary.sh switch_conf.json
# <Run gmond using the command mentioned in the output of above command>
Edit switch config JSON file (alternatively create another copy say switch_conf_2.json) for every secondary gmond and specify name, agent IP, port number and poling interval for second switch. Run Secondary gmond with the command mentioned in the output of following shell script
# cp switch_conf.json switch_conf_2.json
# <edit switch_conf_2.json>
# sh gen_gmond_secondary.sh switch_conf_2.json
# < Run gmond using the command mentioned in the output of above command >
Changing metrics, metric type and switch parameter and re-running
Follow below steps to change metric and re-running gmetad and gmond.
Killall gmond and gmetad
# killall gmetad gmond
Execute below command
# cd <ganglia>
# sh gen_bst_metrics.sh
# gmetad
Edit switch config json file for changing switch IP, port number etc. Run Primary gmond with the command mentioned in the output of following shell script
# sh gen_gmond_primary.sh switch_conf.json
# <Run gmond using the command mentioned in the output of gen_gmond_primary.sh>
Edit switch config JSON file (alternatively create another copy say switch_conf_2.json) for every secondary gmond and edit name, agent IP, port number and poling interval for second switch. Run Secondary gmond with the command mentioned in the output of following shell script
# cp switch_conf.json switch_conf_2.json
# <edit switch_conf_2.json>
# sh gen_gmond_secondary.sh switch_conf_2.json
# <Run gmond using the command mentioned in the output of above command>
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.