Computing at SLAC
Search SLAC      

About

Installation

Documentation

Database API's

Tools Page

The World Map
Geoplot
Updates
Adding a New Probe

Moving IEPM-BW

Troubleshooting Hints

Results

Original PLM

Tools Page

The World Map

The world map is created by using the Geoplot applet from CAIDA. Each monitoring host has a directory $REPORTSDIR/$aliasName/geoplot where the html, jar, and configuration files are stored. For example: for the monitoring host IEPM-BW, the directory is /nfs/slac/g/net/iepm-bw/iepm-bw.slac.stanford.edu/geoplot. The $REPORTSDIR is "/nfs/slac/g/net/iepm-bw/", $aliasName is "iepm-bw.slac.stanford.edu", and the geoplot directory is "geoplot". The relevant files in this directory are:

  • GeoPlot.Jar - the jar file
  • geoplot.html - The HTML file
  • World100.gif - the backgound world map file
  • iepmlocations.txt - the locations of the nodes - created by $iepmSrcDir/fetch-lat-long
  • update-geoplot.txt - the file specified in the field of the applet where the plotting instructions are stored. This file is updated by the $iepmSrcDir/map-updated which is running as a daemon on the monitoring host.
To modify the look (add more info, etc) to the main plot page, modify the geoplot.html file.

Geoplot

GeoPlot is a light-weight java applet which allows users to create a geographical image of a data set. The applet provides the user with many options to represent the data set. Basically, GeoPlot plots a set of nodes and a set of lines that connect these nodes on an image specified by the user. To deploy Geoplot on any web-server, we need three files.

  1. GeoPlot.jar
  2. HTML to display the GeoPlot applet.
  3. The image file to display on the applet.

geoplot.jar

The Geoplot.jar file consists of six java code files.

  1. Geoplot.java
  2. Key.java
  3. Line.java
  4. Node.java
  5. NodLin.java
  6. StatusBar.java

Geoplot.java file get nodes and lines data to display from a URL specified in applet parameters in the HTML page. In our case when GeoPlot.java was trying to get information from that specified URL it sometime comes up with blank-lines. This problem was crashing the whole application. So we decided to modify the GeoPlot.java code.

In Geoplot.java code there is a method parseData. This method is used to parse the data creating a node and line object for node/line definition. If the data is specified as a URL, then the functions reads the file and then does the parsing.

  1. str = tokenizer.nextToken();
  2. str = str.trim();
  3. ch = Character.toLowerCase(str.charAt(0));

The above mentioned code in the parseData method is responsible to get one line of that data file and get the first character to check what its value is. Line 1 gets the next token. Line 2 trims the token to remove spaces. Line 3 gets the character at location 0 and covert it to lowercase. Now it is quite possible that the token which we are trying to get in line 1 has null value. So we modified the code to following

  1. str = tokenizer.nextToken();
  2. str = str.trim();
  3. if(str.length() == 0)continue;
  4. ch = Character.toLowerCase(str.charAt(0));

The only addition which we made to the code was to add Line 4. Line 4 actually say that if the length of the line is 0 don't process that line and continue with the next one.

HTML to Display Applet

Place the following applet tag in your html file. GeoPlot.class is the main class file that should be placed in your applet tag. The basic outline is shown below:

< applet code="GeoPlot.class" archive="GeoPlot.jar" width=??? height=???>
< param name=????? value=?????>
:
:
:
< /applet>

The width and height attributes of the applet tag refer to the width and height of the applet in the browser window. All the param tags follow the opening applet tag.

Image File

Image file will be displayed as a background on the applet. This image will contain all the nodes and lines on it.

geoplot.html Requirements

The web page 'geoplot.html' must be modified for each monitoring host to point to the links for that host. This includes the data file URL.
ex.
param name=data value="http://www.slac.stanford.edu/comp/net/iepm-bw.slac.stanford.edu/geoplot/update-geoplot.txt
This points to the data used for geoplots.

Adding Nodes

There is a script fetch-lat-long that can be run manually if needed for immediate results. However it does run as part of the over night processing. Fetch-lat-long fetches the active node information from the NODES table, and creates a configuration file for the locations of the nodes on the geoplot map ($REPORTSDIR/$aliasName/geoplot/iepmlocations.txt). Once the configuration file is created, it kills the map-updated daemon which then gets automatically restarted in a few minutes by the keep alive system. If an active node is to have a character string associated with it, it must be put in the 'abbreviation' field. If the abbreviation field is null, only a point is placed on the map.

Note that the data for the geoplot display comes from the script copy-geoplot-data which is called by load-datad after it has made a pass through loading all the data into the data base.

The map-updated daemon creates the text file update-geoplot.txt every few seconds, and this file is what geoplot uses to display the nodes and tests on the map.

Monhost Updates

The directory $iepmSrcDir/mysql-updates contains scripts to update the monitoring host databases.

'mysql-update [sqlfilename]' takes the name of a mysql sql file and executes that sql on the database of the machine on which it is called. 'mysql-update' maintains a log in the logs directory on each machine for all update attempts called 'update-mysql'. Note that the log file for the current date is called 'update-mysql.today'.

'update-all-databases [sqlfilename]' copies the [sqlfilename] to the $iepmSrcDir/mysql-updates directory on the remote monitoring host and then calls mysql-update on the specified host to update its' database.

Script Details

  • update-monhosts
    • Updates the VERSION_DATE file
    • Creates a 'newtar' file
    • Copies the 'newtar' file to the remote hosts
    • Via ssh, calls 'update-code'
  • update-code
    • Kills all the running servers and daemons associated with iepm-bw
    • This does NOT kill httpd or mysql or other system daemons
    • Detars the 'newtar' file in the source code directory
    • Restarts all servers and daemons
Note:
  • These scripts MUST NOT BE CALLED FROM A CRONTAB.
  • The sqlfilename must be resident on iepm-bw@slac, and preferably in the '$iepmSrcDir/mysql-updates' directory.
  • Always try the sql on iepm-bw@slac with the 'mysql-update' script to make sure it works, before trying to install it with 'update-all-databases'.

  Send Us Feedback  
  SLAC