Content-type: text/html Connectivity help

connectivity Version 1.3, 6/16/2011, Les Cottrell & Sadia Rehman

Purpose

Writes html to display a summary of the latest offsite node connectivity data of selected node. It uses getdata.pl to get the data from the remote monitor.

Syntax

To display a summary of the latest offsite node connectivity data use the appropriate URL with:

connectivity[?format=(csv|tsv)&|?column=$n&|?help&|[monitor=($monitor|names|aliases)]&|rawdata[=$target]&|days=$m]

Description

The connectivity perl cgi-script writes html code to standard output to present the latest offsite node connectivity data. Input comes from QUERY_STRING, i.e. the text following the question mark (?) in the URL.

By default, connectivity displays the data sorted alphabetically by node name. Within the default display, the data may be resorted by clicking the relevant column header. By following appropriate links, the user may see raw data, the user may view a graph showing trends over time, and the user may ping a site.

The URL column=column_number& # produces alternative sortings, where the column_number is a number from [0 .. 11].

The URL help& #produces this help text.

The URL rawdata=pinger.ictp.it #specifies the target host (www.kek.jp) for which we get the raw data. If a value is not specified then the html connectivty.pl form and data is displayed, and parameters format, target and days are not used even if specified in the URL.

The URL monitor=pinger.ictp.it #specifies the monitoring host, default=www.slac.stanford.edu

The URL days=6& #specifies the number of days to go back and get data from. the default is 0 days, i.e. just today.

Examples

1. To get this help file:
connectivity.pl?help&

2. To sort by column 4:
connectivity.pl?column=4&

3. To get comma separated values for use in Excel:
connectivity.pl?from=pinger.slac.stanford.edu&format=csv&

4. To view the raw input data
connectivity.pl?rawdata&from=pinger.slac.stanford.edu

5. To get the raw input data for a single remote host (in this case www.cern.ch)
connectivity.pl?rawdata=www.cern.ch&format=csv" #the default format is CSV (tsv is also supported)

6. To specify the monitoring host (in this case pinger.ictp.it) remote host pair (in this case www.kek.jp).
connectivity.pl?rawdata=www.kek.jp&monitor=pinger.ictp.it #the default monitor host is www.slac.stanford.edu

7. To use the default monitoring host (pinger.slac.stanford.edu).
connectivity.pl?rawdata=www.kek.jp&format=csv #takes about 12 secs

8. To specify the number of days to go back (0=just today=default)
connectivity.pl?rawdata=www.kek.jp&format=csv&monitor=pinger.ictp.it&days=6 #takes about 12 secs, the default days=0 (the time is pretty linear with the number of days, 0 days takes about 2 secs for this example).

9. To get a list of monitors that monitor a target
connectivity.pl?rawdata=www.kek.jp&format=csv&monitor=names.

http://www-wanmon.slac.stanford.edu/cgi-wrap/connectivity.pl?from=icfamon.dl.ac.uk&rawdata&
http://www-wanmon.slac.stanford.edu/cgi-wrap/-d+connectivity.pl?monitor=pinger.slac.stanford.edu&rawdata=www.cern.ch&format=tsv&

To run from the command line:
raw data = remote node
monitor = monitor node
target = same as monitor node
from = monitor node selected from dropdown menu on webpage
setenv QUERY_STRING 'rawdata=argus.stanford.edu&format=csv'; connectivity.pl
setenv QUERY_STRING 'rawdata=ping.slac.stanford.edu&format=tsv&monitor=access.sprace.org.br'; connectivity.pl
setenv QUERY_STRING 'rawdata=ping.slac.stanford.edu&format=csv&monitor=names'; connectivity.pl
setenv QUERY_STRING 'rawdata=ping.slac.stanford.edu&format=csv&monitor=aliases'; connectivity.pl
setenv QUERY_STRING 'from=argus.stanford.edu&format=csv'; 
setenv QUERY_STRING 'rawdata&from=pinger.slac.stanford.edu';

Note: monitor = names or aliases can only be used if rawdata is define (which means remote node is defined)

time wget 'http://www-wanmon.slac.stanford.edu/cgi-wrap/connectivity.pl?rawdata=pinger.slac.stanford.edu&format=csv&target=access.sprace.org.br'#Takes 7 secs

Files

connectivity.pl     main perl script
connectivity.head   html header displayed before data
connectivity.foot   html footer displayed after data
connectivity.cf     configuration file
mon-lib.pl          library of subroutines
getsite.cf          configuration file for GetSite subroutine

Examples of output if rawdata and format are specified

Normal output (format=csv):
pinger.slac.stanford.edu,134.79.104.80,access.sprace.org.br,200.136.80.18,100,1307145981,10,10,247.550,247.638,247.969,0,1,2,3,4,5,6,7,8,9,247,247,247,247,247,247,247,247,247,247,Fri,Jun,3,17:06:21,2011,EDU.SLAC.STANFORD.N3,BR.ORG.SPRACE.N3,
Target not reachable (100% loss):
pinger.slac.stanford.edu,134.79.104.80,207.148.158.82,207.148.158.82,100,1307146130,31,0,.,.,.,.,Fri,Jun,3,17:08:50,2011,EDU.SLAC.STANFORD.N3,COM.CADVISION.N1,
Errors:
getdata.pl: unable to gather any data for monitor=junk.com to sites=121.52.144.65& for date=2011-05-30!
getdata.pl: unable to match junk.com, hostname not in list of known monitors in /afs/slac/package/pinger/nodes.cf
connectivity.pl: unknown format=junk, csv & tsv are the only formats accepted
connectivity.pl: invalid days=-2, must be 0 or positive integer
connectivity.pl: can't find alias in NODE_DETAILS{$target}[2]
connectivity.pl: nobody monitors rawdata target=$target($FORM{'rawdata'})
connectivity.pl: $cmd is tainted
connectivity.pl: monitor $mon_host requested but there is no target
connectivity.pl: unknown format=$FORM{'format'}, csv & tsv are the only formats accepted 

Raw format of internally stored data

Raw Data Format:
Monitor_Host_Name       Monitor_Addr   Remote__Name  Remote_Addr   Bytes Time      Xmt Rcv Min Avg Max
minos.slac.stanford.ed 134.79.196.100 www.lbl.gov   128.3.7.14    100   870393602 10  10  6   18  125
minos.slac.stanford.edu 134.79.196.100 ns1.cebaf.gov 129.57.32.100 100   870393602 10  10  74  93  125

Where the columns are separated by a single space.
The Bytes can be 100 or 1000 (sometimes it will be less than 100, in which case treat as 100), it is
the number of bytes in each ping packet.
Time is the Unix Epochal time.
Xmt is the number of ping packets sent.
Rcv is the number of ping packets received.
Min is the minimum response time for the packets sent (in milliseconds).
Avg is the average response time for the packets sent.
Max is the maximum response time for the packets sent.

There should always be > 7 tokens in the line.  If no response to the
pings were received then there will only be 8 tokens in the line
and Rcv (the 8th token) will be 0.

Early versions of the data collection program lost the Remote_Addr
when the remote site was not reachable.  In this case the data only
contains 6 tokens.  It should either be ignored or treated as
remote site unreachable.


n