Background
gmaps is a demonstration frontend for perfSONAR. This page describes the modules and architecture for gmaps.
Access
Code is stored at the IEPM SVN repositry at
Code Block |
---|
file:///afs/slac.stanford.edu/g/scs/net/netmon/repo/svn/perfSONAR/gmaps |
Overview
The file structure of the code is as such:
Code Block |
---|
|-- cgi | `-- gmaps.pl |-- lib | |-- gmaps | | |-- KML.pm | | |-- LookupService.pm | | |-- MA | | | `-- RRDMA.pm | | |-- Topology | | | |-- DNSLoc.pm | | | `-- GeoIP.pm | | |-- Topology.pm | | |-- Transport.pm | | |-- gmap.pm | | `-- templates | | |-- gmaps-info_html.tt2 | | |-- gmaps-utilization_html.tt2 | | |-- gmaps_enterNodes_html.tt2 | | |-- gmaps_html-inline.tt2 | | |-- gmaps_html.tt2 | | |-- gmaps_xml-full.tt2 | | |-- gmaps_xml.tt2 | | |-- kml_placemarks.tt2 | | |-- ls_all-router-ip-addresses.tt2 | | |-- nodata.png | | |-- noma.png | | |-- out.png | | |-- rrdma_xml.tt2 | | |-- spinner.gif | | `-- throbber.gif | `-- utils | `-- rrd.pm `-- t |-- dns-loc_test.pl |-- dns_test.pl |-- geoip_test.pl |-- gmaps-map_test.pl |-- graphUtilization-ip_test.pl |-- http_server.pl |-- kml_create.pl |-- lookupService_test.pl `-- rrdma_test.pl |
Directory | Description |
---|---|
cgi | cgi scripts to include for deployment, also contains all the relevant path declarations |
lib | perl library files |
t | unit test scripts |
Module Descriptions
File | Module | Description |
---|---|---|
gmap.pm | gmaps::gmap | container for cgi access |
Topology.pm | gmaps::Topology | helper functions for ip descovery |
Topology/GeoIP.pm | gmaps::Topology::GeoIP | Wrapper around the geoiptools api for long lat discover of ip nodes |
Topology/DNSLoc.pm | gmaps::Topology::DNSLoc | Wrapper around the |
Transport.pm | gmaps::Transport | Uses the perfSONAR-PS libraries to send and receive and parse XML documents |
LookupService.pm | gmaps::LookupService | Provides access and communication to the lookup service |
MA/RRDMA.pm | gmaps::MA::RRDMA | provides communications accesss to the RRD MAs |
High level overview
The code relies heavily on the Template library to easily and quickly create valid XML for query generation to the relevant perfSONAr service.
gmaps::gmap provides access to the main functions and is a CGI::Application. The main methods are mapFromXML
which will draw a html google map, and then do a fetch for the XML file of some nodes. The xml is generatated from the function createXML
which determines the geographical lat/long location of the parsed list of nodes and then spits out a simple xml of the lat longs of the nodes.
The logic of the web presentation is stored in gmaps_html.tt2
which is a template containing all the html and javascript code to be returned to the user through the mapFromXML
call.
Graphing of the utilization of the requested node is conducted on the server end. It is done through gmaps::gmap::graphUtilization
which calls gmaps::MA::RRDMA
to fetch the relevant info from the relevant MA. The response from teh MA is parsed using XPath and the values are stored into a temporary RRD file which is then graphed as a PNG and spat back to the client.
Lookup of the relevant MA from the node address is conducted through a regexp of the dns name of the node. This is conducted in gmaps::LookupService
currently as a static datastructure of regexp match to MA info. the main function to do this is gmaps::LookupService::getMA
. future versions shoudl be able to query a multi-lookup service order to determine if the ip address is currently being monitored or not.
To-do
Frontend
- Add map stretching on browser window resize (current simple implementation is incorporated by doesn't quiet work as expected)
- Add dynamic list creation of nodes (simple button allows additions of nodes to the list ot be mapped). This should use the fact that the server can return the long lats for single ips or even groups.
- Add dynamic removal of nodes from teh list
- make better arrows, with arrows for both in and out; may need slight curvature of the arrows to allow visibility
- colouring of the arrows to represent the utilisation percentage
- integration to allow new GInfoWindow tabs for other metrics; such as OWAMP and BWCTL etc.
Backend
- implement MA fetching and processing for OWAMP and BWCTL
- implement MA fetching and processing of Traceroutes and pings
- allow flexible definition of time range of info to be fetched.