Project Description

  PingER SmokePing Integration aims at using Smokepings's rrd tool to visually display pingER's data  in the form of graphs.

Package Description

Modules

Function

SelectConvSrcDest1.pm

This program is to be setup as a cron job to run every 24 hours (after installing on a server with a PingER data source)
This script is to be run once the data for all sources have been brought to the server from various monitoring sites using getdata.pl.
This program finds unique SourceSite_DestinationSite_PacketsSize_NumberOfPings(maximum) combinations and creates a srcdest.txt file agaist each combination.
It calls the PingERtoSmokeping application to convert the data agaist each of the unique SourceSite_DestinationSite_PacketsSize_NumberOfPings(maximum) combinations found.

PingERtoSmokeping.pm

PingERtoSmokeping.pm is a tool to convert PingER data files into Smokeping data files.
The output of this program is an rrd file for a SourceSite_DestinationSite_PacketsSize_NumberOfPing combination present in a PingER data file.
This tool does not take any arguments from command line.

Configuration files

                                                                                                          Function

srcdest.txt

The file that stores unique SourceSite_DestinationSite_PacketsSize_NumberOfPings(maximum) combinations found in PingER data.

CGIs

Function

form.cgi

Displays the  SourceSite_DestinationSite_PacketsSize_NumberOfPings(maximum) RRDs(data) available for the monitoring site or node slected from pingtable.pl by user.

graph.cgi

Generates graphs from the rrd files on the fly and display them to the user and then deletes the graph from cache

saveimage.cgi

Displays the contents of the image to the user

Detailed description can be found at http://maggie.niit.edu.pk/newwebsite/federation_projectdesc2.html

Installation

SelectConvSrcDest1.pm

PingERtoSmokeping.pm

     

 

Performance Analysis

 In order to get  list of unique Source Destination pairs (links) SelectSrcDest1.pm used to traverses through all the raw pinger files for the last 120 days and generateded the list. This was extremely expensive in terms  of time consumed so we needed to reduce this. This was reduced to one day which made the code 120 times more faster.

I used the Benchmark library and applied it on create_File function. Here is the result of creating 10 RRDs on nfs space

CreateRRD took:38 wallclock secs (19.76 usr  3.99 sys \+  2.57 cusr  0.82 csys = 27.14 CPU)
CreateRRD took:38 wallclock secs (20.06 usr  3.39 sys \+  2.46 cusr  0.84 csys = 26.75 CPU)
CreateRRD took:67 wallclock secs (21.25 usr  9.75 sys \+  2.49 cusr  1.03 csys = 34.52 CPU)
CreateRRD took:66 wallclock secs (21.19 usr  9.06 sys \+  2.73 cusr  0.90 csys = 33.88 CPU)
CreateRRD took:68 wallclock secs (20.97 usr  9.47 sys \+  2.78 cusr  0.74 csys = 33.96 CPU)
CreateRRD took:68 wallclock secs (20.80 usr  9.40 sys \+  2.44 cusr  0.96 csys = 33.60 CPU)
CreateRRD took:23 wallclock secs (19.19 usr  0.86 sys \+  2.27 cusr  0.91 csys = 23.23 CPU)
CreateRRD took:23 wallclock secs (19.09 usr  1.13 sys \+  2.55 cusr  0.92 csys = 23.69 CPU)
CreateRRD took:66 wallclock secs (21.13 usr  8.45 sys \+  2.53 cusr  0.93 csys = 33.04 CPU)
CreateRRD took:67 wallclock secs (21.24 usr  9.61 sys \+  2.23 cusr  0.91 csys = 33.99 CPU)

  

    I created the same 10 RRD files on local disk, clearly its less expensive to write to local disk.

CreateRRD took:22 wallclock secs (19.75 usr  0.79 sys \+  2.60 cusr  0.75 csys = 23.89 CPU)
CreateRRD took:21 wallclock secs (19.66 usr  0.85 sys \+  2.70 cusr  0.76 csys = 23.97 CPU)
CreateRRD took:24 wallclock secs (20.49 usr  1.44 sys \+  2.49 cusr  0.83 csys = 25.25 CPU)
CreateRRD took:23 wallclock secs (20.77 usr  1.11 sys \+  2.53 cusr  0.88 csys = 25.29 CPU)
CreateRRD took:23 wallclock secs (20.88 usr  1.26 sys \+  2.40 cusr  0.90 csys = 25.44 CPU)
CreateRRD took:24 wallclock secs (20.91 usr  1.06 sys \+  2.39 cusr  0.96 csys = 25.32 CPU)
CreateRRD took:21 wallclock secs (19.11 usr  0.50 sys \+  2.42 cusr  0.97 csys = 23.00 CPU)
CreateRRD took:21 wallclock secs (19.13 usr  0.62 sys \+  2.58 cusr  1.02 csys = 23.35 CPU)
CreateRRD took:23 wallclock secs (20.77 usr  1.12 sys \+  2.56 cusr  0.82 csys = 25.27 CPU)
CreateRRD took:23 wallclock secs (20.79 usr  1.12 sys \+  2.36 cusr  0.87 csys = 25.14 CPU) 

 The update function takes very little time as compared to create function.  Here is the data for the update function for the same three RRDs

CreateRRD took: 4 wallclock secs ( 3.56 usr  0.05 sys \+  0.43 cusr  0.05 csys =  4.09 CPU)
CreateRRD took: 3 wallclock secs ( 3.55 usr  0.04 sys \+  0.44 cusr  0.01 csys =  4.04 CPU)
CreateRRD took: 4 wallclock secs ( 3.57 usr  0.07 sys \+  0.54 cusr  0.09 csys =  4.27 CPU)

The code created new RRD files based on unique source, destination and number of packets sent. Since the number of packets sent is variable for each day, it created a new RRD file each day which is very expensive. An average of 100 additional RRDs were created every day which costs 10 hours time to run. I have set the value of the number of packets sent to 10, so now  only the previous RRDs will be updated and no new RRD will be created. So this will cause the script to run much faster( will takes on average 10 hours less to run daily).

Deployment of PingertoSmokePing

Prerequisite:

Depends on rrdtool version 1.2.12 or newer version of it. Therefore it must be installed. The RRD tool is already installed on PingER machine.

Security Checks

 The perl taint option -T is used in order to taint the input which the cgi will get from the user also "strict" is used.

CGI Scripts

Graph.cgi

Configuration Steps:

use lib "/afs/slac.stanford.edu/package/netmon/rrdtool/lib/perl/5.8.8";
use lib "/afs/slac.stanford.edu/package/netmon/rrdtool/lib/perl/5.8.8/i386_linux24";

The problem I faced with this is that it was unable to link the dynamic library (.so) file at the run time which I ran it from Flora but when I ran it from 

PingER it worked fine. The problem was due to the fact that Flora is a 64 bit machine.

my $imgsrc="$HOME/pinger_smokeping/html/GraphCache where $HOME is my home directory where the project is placed.

SaveImage.cgi

* *I have written saveimage.cgi which is called from graph.cgi and it prints the image data to the browser. The image is created temporarily and is deleted after it is show to the user.

The image is created in /tmp/ directory

Form.cgi

Displays the SourceSite_DestinationSite_PacketsSize_NumberOfPings(maximum) RRDs(data) available for the monitoring site or node slected from pingtable.pl by user.

Configuration Steps:

where $HOME is  home directory where the project is placed.

1. src_regexp (Monitoring Site)
2. by site | node

Pingtable.pl

$config
{URLCOLUMN0}

= "SMOKE [http://www-dev.slac.stanford.edu/cgi-wrap/smokeping_form.cgi?src_regexp=]";
require "$base_dir/pinger.new.cf";

where

$base_dir="/afs/slac/u/sg/shahryar/pinger_smokeping";

These three scripts are deployed at Test server (/afs/slac.stanford.edu/g/www/cgi-wrap-bin/net/shahryar)

which I guess is not accessable from outside world. These scripts are deployed at:

http://www-dev.slac.stanford.edu/cgi-wrap/pingtable_test.pl

http://www-dev.slac.stanford.edu/cgi-wrap/smokeping_form.cgi

http://www-dev.slac.stanford.edu/cgi-wrap/smokeping_graph.cgi( The perl taint option -t was removed in order to make it work otherwise it gave Internal server Error)

Cron Jobs

I have run SelectSrcDest1.pm as a cron job which is supposed to run every 24 hours to generate the rrd files for unique source destination pairs. The cron job is set as a TrsCron tab and is supposed to run at 12:00 am midnight on tersk08 machine.