Work on the SLAC Bandwidth Tests (IEPM-BW) was started in September 2001. There have since been 3 versions. Version 1, the original was superceeded by version 2 in February 2003. Version 2 provided more flexibility in the graphing and analysis, and made it easier to add new tests. Both versions 1 and 2 were built upon a data base of flat files and perl configurations commands. Probe commands were run sequentially. In March 2004, development started on IEPM-BW V3. The main difference is that a MySQL data base is used to store the data and monitoring configuration information, and tests (pathchirp, traceroute, and ping) are run asynchronously rather than sequentially. Heavier weight probes such as thrulay, iperf, and pathload are still run sequentially so that they do not interfere with each other.
Version 3, which this PLM describes, uses a MySQL data base to store the test and node configuration information as well as the data and test logs. It also has a scheduling mechanism so that regularly scheduled "backgound" tests can be run as well as "on demand" tests. This allows the on demand tests to be integerated with the backgound test data, if desired. As of 1/6/06, the on demand tests have not been fully implemented.
The current source directory at SLAC is: /afs/slac/package/netmon/bandwidth-tests/v3src
This system provides facilities for performing tests (aka probes) between monitor hosts and target hosts.The target host does not need to be a dedicated machine, but it should not be a busy machine.
/proc/sys/net/core/wmem_max = 20971520 /proc/sys/net/core/rmem_max = 20971520 /proc/sys/net/core/rmem_default = 65536 /proc/sys/net/core/wmem_default = 65536 /proc/sys/net/ipv4/tcp_rmem = 4096 87380 20971520 /proc/sys/net/ipv4/tcp_wmem = 4096 65536 20971520
Test Name | Port# |
---|---|
iperf | 5000 |
owamp(2.0) | 4824 |
thrulay | 5003 |
abwe | 8176 |
pathchirp | 8365 udp |
pathload | 55001 udp |
pathload | 55002 tcp |
mysqld_safe&
mysqladmin -u root password "new password"
mysqladmin -u root -p shutdown
The commands in this document are color coded to help understand the environment in which
they are issued.
This is a unix command
This is a unix file or directory name
This is a command or variable for a configurtion file
This is a mysql command
This is a database table element
This is just a comment and not a command
This is a perl programming command
Other conventions:
$iepmSrcDir
is an environment variable (or in perl scripts a perl variable)
which holds the
v3src directory path. This is defined in /etc/iepm.cnf
,$dataBaseDir
is an environment variable (or in perl scripts a perl variable)
which holds
the database directory path. This is defined in /etc/iepm.cnf
. $aliasName
is an environment variable (or in perl scripts a perl variable)
which holds the
the monitoring host aliasname. This is defined in /etc/iepm.cnf
. Eventually we plan on having a automatic method for full configuration and
installation of the system. For now however, it is a manual
procedure. It is recommended that the installation be done in the order
indicated. As you go through the installation procedure in the order indicated,
you will be defining variables for the /etc/iepm.cnf
and
/etc/my.cnf
configuration files. You will need
to have root privileges to perform the installation. Alternatively, you may
download the installer, and follow the steps in README. This will complete steps 1-16 for you.
installAcct
,
updateAcct
and acctGroup
in the /etc/iepm.cnf
file. The acctGroup
in /etc/iepm.cnf
must be set to the unix group the accounts belong to.
These must also be configured as valid MySQL accounts with the appropriate privileges, as
described below.
/myspace
, the directory would be /myspace/v3src
.
This will be the variable iepmSrcDir
in the configuration file /etc/iepm.cnf
.
/scratch
partition and so the
variable dataBaseDir
in /etc/iepm.cnf
will be
/scratch/mysql
. In /etc/my.cnf
the configuration parameter datadir
will also be
/scratch/mysql
.
Allocate the directory with the command mkdir /scratch/mysql
.
groupadd -g 20000 mysql
useradd -u 20000 -g mysql mysql
mkdir /scratch/mysql
chown mysql:mysql /scratch/mysql
aliasName
for your monitoring host.
This will be called the
aliasName
in /etc/iepm.cnf
. We
usually use alias names of the form "node1.slac.stanford.edu".
dataBaseDir
. They should be
owned by the account the system is going to run under. In this example
the updateAcct
is "cal".
If the account "cal" is in account group "sf"
(acctGroup
in /etc/iepm.cnf)
, these directories
must be owned by "cal:sf". Note that in our example
dataBaseDir
is /scratch/mysql
mkdir /scratch/mysql/data
.
This is the directory where the data is temporarily logged
until it can be loaded into the data base via the appropriate daemon.
mkdir /scratch/mysql/keepalives
- The keepalive
system (for keeping daemons
running) stores its flags here. Create the following files with
touch to prime the daemon watch
script keep-em-alive
.
touch /scratch/mysql/keepalives/abwed.alive
touch /scratch/mysql/keepalives/traced.alive
touch /scratch/mysql/keepalives/pingd.alive
touch /scratch/mysql/keepalives/bw-synched.alive
touch /scratch/mysql/keepalives/pathchirpd.alive
touch /scratch/mysql/keepalives/load-datad.alive
touch /scratch/mysql/keepalives/load-scheduled.alive
mkdir /scratch/mysql/pids
creates the directory where the
daemon pids are stored.
mkdir /scratch/mysql/logs
creates the directory where the
various IEPM-BW logs are stored. Note that there is a script copylogs which maintains this
directory so that it does not grow out of control.
chown cal:sf /scratch/mysql/data
chown cal:sf /scratch/mysql/pids
chown cal:sf /scratch/mysql/logs
chown cal:sf /scratch/mysql/keepalives
chown cal:sf /scratch/mysql/keepalives/*
updateAcct
. With an
editor, type the password for the mysql
updateAcct
defined in
/etc/iepm.cnf
on one line and save it as
dataBaseDir/pws
. Set the owner to be the unix
updateAcct
user.
/etc/iepm.cnf
/etc/iepm.cnf"
# required iepm configuration parameters
# /etc/iepm.cnf
# the data base name - must be "iepm"
dataBase = "iepm"
# the data base host is the
"fully qualified machine name"
dataBaseHost = "nettest1.slac.stanford.edu"
# directory for the mysql database,
logs, and workspace
dataBaseDir = "/scratch/mysql"
# the iepm-bw source
iepmSrcDir = "/myspace/v3src"
# the master management account for Mysql
(does not have
to be a unix computer account)
# This is for granting privileges and
managing the Mysql user accounts
installAcct = "cal"
# The account for updating database
updateAcct = "cal"
# a readonly account for fetching data
readAcct = "readonly"
# the unix group for the account
acctGroup = "sf"
# the monitoring host name
monHost = "nettest.slac.stanford.edu"
# the aliasname for the monitoring host
aliasName = "node6.slac.stanford.edu"
# the IP address of the monitoring host
monHostip = "134.79.243.12"
mysqlport = "3306"
#Connie Logg 5/12/04 cal@slac.stanford.edu
<----YOUR NAME PLEASE!!
/etc/iepm.cnf
with the file name
iepm.cnf.aliasName
in the directory
$iepmSrcDir/config
. For example with the above example, a copy of
/etc/iepm.cnf
would be saved as
/myspace/v3src/config/iepm.cnf.node6.slac.stanford.edu
.
This file is passed to the CGI scripts to provide the necessary configuration information for the
CGI's to run.
/etc/my.cnf
.
This provides the information required
for the allocation of the data base and related control files.
[mysqld]
datadir=/scratch/mysql
socket=/scratch/mysql/mysql.sock
port=3306
[mysqld_safe]
datadir=/scratch/mysql
socket=/scratch/mysql/mysql.sock
port=3306
[mysql.server]
datadir=/scratch/mysql
socket=/scratch/mysql/mysql.sock
port=3306
[client]
socket=/scratch/mysql/mysql.sock
port=3306
datadir
is the same as
dataBaseDir
in /etc/iepm.cnf
.
datadir/mysql/mysql>
to mysql:mysql.
That is, in this example
chown mysql:mysql /scratch/mysql/mysql
.
mysql_install_db
to create the database directories (path picked from /etc/my.cnf). Change the permissions on the files within the mysql directory
chown mysql:mysql /scratch/mysql/mysql/*
.
If you installed the MySQL RPMs as suggested in MySQL Install,
a mysql server should already be running. You may confirm using
ps -ax | grep -i mysql
. If not, start the mysql server via
mysqld_safe &
. If this fails,
look at the file datadir/monHost.err
for
hints as to what the problem is.
Note the monHost
is from /etc/iepm.cnf
and
datadir
is from /etc/my.cnf
.
In the case of the example defined in this writeup,
the error file will be
/scratch/mysql/nettest.slac.stanford.edu.err
.
The most common reason
for failure is that the ownership on the mysql directories is not set
to mysql:mysql
.
mysqladmin -u root password "new password"
ls -l /scratch
cd /scratch/mysql
ls -l
drwxrwxr-x | 2 | cal | sf | 8192 | Sep 30 10:07 | data | |
-rw-rw---- | 1 | mysql | mysql | 25088 | Jun 7 12:04 | ib_arch_log_0000000000 | |
-rw-rw---- | 1 | mysql | mysql | 5242880 | Aug 22 16:34 | ib_logfile0 | |
-rw-rw---- | 1 | mysql | mysql | 5242880 | Jun 7 12:04 | ib_logfile1 | |
-rw-rw---- | 1 | mysql | mysql | 10485760 | Aug 20 17:15 | ibdata1 | |
drwx------ | 2 | mysql | mysql | 4096 | Jul 12 14:49 | iepm/ | |
drwxrwxr-x | 2 | cal | sf | 4096 | Jul 6 14:41 | keepalives/ | |
drwxrwxr-x | 2 | cal | sf | 16384 | Sep 29 23:58 | logs/ | |
drwx------ | 2 | mysql | mysql | 4096 | Jun 7 11:44 | mysql/ | |
srwxrwxrwx | 1 | mysql | mysql | 0 | Aug 22 16:34 | mysql.sock= | |
-rw-rw---- | 1 | mysql | mysql | 6193 | Aug 22 16:34 | nettest.err | |
-rw-rw---- | 1 | mysql | mysql | 5 | Aug 22 16:34 | nettest.pid | |
drwxr-xr-x | 2 | cal | sf | 4096 | Jul 6 15:45 | pids/ | |
-rw-r--r-- | 1 | cal | sf | 9 | Jun 7 13:37 | pws | |
drwx------ | 2 | root | root | 4096 | Jun 7 11:44 | test/ |
mysql -u root -p
(and enter the mysql root password when prompted)
mysql>
create database iepm;
See the MySQL Manual for information on granting access rights. The following sections have some examples.
installAcct
and updateAcct
; both found in /etc/iepm.cnf
. For this example the installAcct
is "cal". Note that the updateAcct
and installAcct
must be valid unix accounts. The following grant commands must be followed for each of your two administrative accounts.
grant all on mysql.* to cal@localhost
identified by 'password' with grant option;
grant all on mysql.* to cal@[dataBaseHost]
identified by 'password' with grant option;
grant all on iepm.* to cal@localhost
identified by 'password' with grant option;
grant all on iepm.* to cal@[dataBaseHost]
identified by 'password' with grant option;
grant all on iepm.* to cal@localhost
identified by 'password' with grant option;
grant all on iepm.* to cal@[dataBaseHost]
identified by 'password' with grant option;
grant file on *.* to cal@localhost;
grant file on *.* to cal@[dataBaseHost];
grant select on iepm.* to 'readonly'@'%';
grant select, insert, update on iepm.* to
'mysqlacctname'@'localhost' identified by "a_password";
or for another system:
grant select, insert, update on iepm.* to
'mysqlacctname'@'othersystemname' identified by "a_password";
show grants for 'mysqlacctname'@'othersystemname';
show grants for 'mysqlacctname'@'localhost';
grant select on iepm.* to apache;
grant select on iepm.* to nobody;
grant select on iepm.* to apache@hostname;
grant select on iepm.* to nobody@hostname;
**It is suggested that you also grant the above priviledges using the fully qualified machine names as well. For instance, if you want to grant readonly priviledges, on machinex, in addition to this command:
mysql>grant select on iepm.* to 'readonly'@'%';
The following should also be executed:
mysql>grant select on iepm.* to 'readonly'@'machinex.slac.stanford.edu';
mysql>grant select on iepm.* to 'readonly'@'machinex';
If you used the automatic installer above, IEPM-BW source code should
already be installed at the iepmSrcDir specified in /etc/iepm.cnf.
If not, download v3src
to /myspace/v3src
and unzip and untar it to install it.
$iepmSrcDir/mysql/createthetables "installAcct_Password"
.
createthetables
is installed with illegal comments so that it can not accidently be run.
You will need put a "#" sign in front of the comment lines in order to run it.
After you have run it please remove the "#" so that someone does not
accidently destroy your data base. Issue the command, for example:
/myspace/v3src/mysql/createthetables mypassword
It must be called with the installAcct
Mysql password.
Run the script $iepmSrcDir/report-table-structure
. This script creates a web page with the details of the Database structure. You will be allowed to verify that you have established the correct table structure.
$iepmSrcDir/mysql/[load|update|insert]--from-csv -f filename
***. A small sample of nodes is included in the file $iepmSrcDir/mysql/example1-NODES.csv
which can be substituted for 'filename' in the execution of 'load-table-from-csv'. NOTE: '##' in the first column will stop the loading of monhost data into the database. Any nodes that are being entered as monitoring hosts must be labeled iepm-bw.domain name.
You must load the data base tables in the following order.
installAcct
or updateAcct
as defined in
/etc/iepm.cnf
configuration file.
You must have granted priviliges to these accounts.
mysql -u updateAcct -p
enter password when prompted
mysql>
insert into NODES
(aliasv4,ipv4name,ipv4addr,active,mastertime2run,
->
domain,gnuplotpath, ploticuspath)
->
values (aliasName, monHost, monHostIp, 1, 20,
domain,
->
'/usr/bin/gnuplot','/usr/bin/ploticus');
aliasName
, monHost
, and
monHostip
are as they are defined in
/etc/iepm.cnf
. Domain is
like "slac.stanford.edu" for the example as derived from monHost
in /etc/iepm.cnf
.
nodeId
for use in loadingthe MONHOST table.
select * from NODES where aliasv4 = 'aliasName';
You will need this nodeId
for the next step.
/etc/iepm.cnf
.
To do this in MySQL,
log into MySQL with the installAcct
or
updateAcct
as defined in
/etc/iepm.cnf
configuration file.
You must have granted priviliges to these accounts.
mysql -u updateAcct -p
enter password when prompted
mysql>
insert into MONHOST (nodeId, srcDir, reportsDir,
->
webPath, siteName,
daysToAnalyze, dataToAnalyze, cgiPath, and cgiDir)
->
values (nodeId, '/myspace/v3src',
'/var/www/html',
->
'http://nettest.slac.stanford.edu',
'SLAC Monitoring site', 28,
->
'ping:avg=w i lt 1;ping:min=w i lt 0;
->
abwe:avdbcap=w p lt 5;abwe:avabw=w p lt 12;abwe:avxtr=w p lt 8',
->
'http://nettest.slac.stanford.edu/cgi-bin',
'/var/www/cgi-bin');
.
report-toolspecs
to see that the probe specs are correct.
$iepmSrcDir/mysql/[load|update|insert]--from-csv
include:
update-NODES-info-from-csv update-PLOTSPECS-info-from-csv load-MONHOST-from-csv insert-PLOTSPECS-info-from-csv
Most of the source will auto install when the source is extracted from the source tar file. However there are a few things which will need manual installation.
v3src
subdirectory iepmicons
.
The web directory path will be
reportsDir/aliasName/
, so in the case of our example, the command is
cp -pr /myspace/v3src/iepmicons /var/www/html/node6.slac.stanford.edu/
.
cd $iepmSrcDir/cgi-bin
make-add_node_html
$iepmSrcDir/cgi-bin/add_node.pl
file to cgi-bin directorycd $iepmSrcDir/cgi-bin
make-update_node_html
cd $iepmSrcDir/cgi-bin
make-toolspec_html
cp $iepmSrcDir/cgi-bin/v3graphem.cgi /var/www/cgi-bin/
When the data base and system have been configured, before you load the crontab and start it all up, run the following checks:
$iepmSrcDir/monhost-getcfg
- If this fails because of a DBI error, please
verify your /etc/iepm.cnf file is correct and that the appropriate grants have be setup in MySQL for
access by these accounts and the monitoring host node. Also verify the following manually by going into
MySQL:
select * from NODES where aliasv4='$aliasName';
- Note the nodeid number.
select * from MONHOST;
- Verify that the nodeid for the monhostid entry is
in fact the same as fetched in the previous statememt. See monhost-getcfg
for more information.
$iepmSrcDir/get-nodelist
- This should return a list of the target hosts and
what tools they are monitoring. See get-nodelist for more information.
$iepmSrcDir/utils/make-gnutest-plot
. This
will create a test plot of the gnuplot colors and characters for referencing when deciding what colors to plot the
data in. This will be accessible from the master IEPM-BW page.$iepmSrcDir/keep-em-alive
. This code starts the IEPM-BW test daemons for testing purposes
$iepmSrcDir/schedule-load
. This execution loads one pass into the schedule table. The daemons should begin working at this point and will store the acquired data in the mysql/data directory.
$iepmSrcDir/schedule-load
is working and data is going into the mysql/data
directory, test loading the collected data into the database by using the load The current load data scripts available are: load-iperf-data load-pathchirp-data load-pathload-data load-ping-data load-tlaytcp-data load-trace-dataBased on the tests that you are running, and the data seen in
mysql/data
, execute $iepmSrcDir/load-[type]-data
to simulate uploading the collected into the database. This also proves that the scripts will work when the system is automated.
NOTE: The above steps can also be simulated by running $iepmSrcDir/schedule-load -T [type]
, verifying that the data from this execution can be seen from mysql/data
, followed by executing the associated $iepmSrcDir/load-[type]-data
script to simulate the data upload to the database.
$iepmSrcDir/load-datad
daemon.
Table Name | Purpose | Notes |
---|---|---|
NODES | Contains node definitions | Each and every node used in the system must be in this table |
MONHOST | Contains the monitoring host specifications | All hosts logging data to the database, must be defined in this table. |
TOOLSPECS | Contains the specification for any tests to be run on a regular basis | |
SCHEDULE | Contains 1 entry for each test everytime it is run except for ABWE | |
ABWEDATA | Storage for the ABWE data | |
PINGDATA | Storage for the PING data | |
ROUTEDATA | Storage from the TRACEROUTE data | |
ROUTENO | Storage from the route number information | Each unique route is given a route number. They are stored in this table. |
BWDATA | Storage for bandwidth tests data | Not yet used |
COMMENTS | Storage for comments | |
GROUPS | Storage for names of grouped nodes | Not yet used |
NODEGROUP | Contains the list of nodes and the groups that they belong to | Not yet used |
Tests are scheduled by inserting the specification for a test into
the SCHEDULE table. The daemon $iepmSrcDir/load-scheduled
runs continually. It checks the TOOLSPEC table to see what probes are due for scheduling.
Probes should not be run more than every 10 minutes. Note that ABWE has its own daemon "abwed"
and runs as often as it can.
The currently available background tests are abwe, ping, and trace(route).
Ping and Traceroute each have a daemon ("pingd" and "traced") which
run continually and periodically inquire the SCHEDULE table for any
tests that they are to run. They write the data files from their probes into
the data directory $dataBaseDir/data
, the
data base directory (datadir in /etc/my.cnf and dataBaseDir in /etc/iepm.cnf).
The scripts $iepmSrcDir/load-ping-data
and
$iepmSrcDir/load-trace-data
are called from the
database loading daemon $iepmSrcDir/load-datad
and they load the data
into the mysql data base.
The abwe daemon "abwed" runs in the backgound
doing abwe tests as frequently as possible.
Abwe has its own directory where it stores the data. load-abwe-data
called from $iepmSrcDir/load-datad
loads the awbe data into the database.
A note here on why it is done this way...Originally I had separate data base loading daemons
for each type of data, and they loaded the data into the MySQL database concurrently. At high
probe rates, they got into lockup conditions where the data base was locked and no one could do
anything. Entering data into the data base is actually quite quick,
so I wrote $iepmSrcDir/load-datad
which calls the loading scripts
sequentially and thus avoids the lock up problem.
There are two other IEPM-BW related directories in datadir: logs and keepalives. Any messages (errors or otherwise) are written to the appropriate log file for each of the daemons. The logs are maintained by a script called "copylogs". It renames "yesterday's" logs and starts a new one for "today". Currently 30 days worth of logs are kept. Each daemon also has a file in datadir/keepalives which is updated after each pass. This is checked by a crontab entry "keep-em-alive" every 10 minutes to make sure that the daemons are alive and well. If they are not, they are killed and retarted.
There is a crontab file which contains the calls to load the scheduled tests,
maintain the log files and data base
backup files,
backup the data base, and generate reports on the system. This crontab should be set up under the
updateAcct
in /etc/iepm.cnf
## copy and date the logs for the day
58 23 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/copylogs /scratch/mysql/logs
## run keepalive check
5,15,25,35,45,55 * * * * /afs/slac/package/netmon/bandwidth-tests/v3src/keep-em-alive
## copy and date the backups
0 1 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/copylogs /nfs/slac/g/net/iepm-bw/bandwidth-tests/mysql-backup
## back up the data base
15 0 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/backup-iepm-mysql-database /nfs/slac/package/netmon/bandwidth-tests/mysql-backup
## generate data logging report
15 2 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/report-logging
## run the regular analysis
23 * * * * /afs/slac/package/netmon/bandwidth-tests/v3src/post-test-processing-script
Notes:
58 23 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/copylogs /scratch/mysql/logs
performs the log maintenance on the /scratch/mysql/logs directory. Note that the path "/scratch/mysql/" to "logs"
is the dataBaseDir
path in /etc/iepm.cnf
5,15,25,35,45,55 * * * * /afs/slac/package/netmon/bandwidth-tests/v3src/keep-em-alive
checks that all the daemons are running. If one is not, then it tries to kill it and restarts it. If the system has been
installed as indicated above, when the crontab is loaded, it will start the daemons automatically.
0 1 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/copylogs /nfs/slac/g/net/iepm-bw/bandwidth-tests/mysql-backup
performs the maintenance on the backup copies.
15 0 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/backup-iepm-mysql-database /nfs/slac/package/netmon/bandwidth-tests/mysql-backup
backs up the iepm mysql database
15 2 * * * /afs/slac/package/netmon/bandwidth-tests/v3src/report-logging
generates the report of
what was logg for the past 2 weeks
23 * * * * /afs/slac/package/netmon/bandwidth-tests/v3src/post-test-processing-script
analyzes the
data, graphs it, and generates the results page.
The database is backed up nightly to /nfs/slac/g/net/iepm-bw/bandwitch-tests/mysql-backup. If you need to restore it, try "/usr/bin/mysql iepm < full_name_of_backup". 'copylogs' is also used to maintain the backups. They are kept for 30 days at this point.
Note that the fields can be empty. For example:
TABLENAME=NODES #aliasv4,aliasv6,ipv4name,ipv4addr,ipv6name,ipv6addr,domain,contactName,contactEmail,contactphone,contactfax,contactaddr,hosttype,siteurl node6.slac.stanford.edu,,nettest4.slac.stanford.edu,134.79.240.28,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,, node1.slac.stanford.edu,,nettest5.slac.stanford.edu,134.79.240.50,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,,Note that these files can be created with a spreadsheet program like excel.
$iepmSrcDir/monhost-getcfg [-h monitoring host alias]
reads the monitoring host information out of the MONHOST and NODES mysql tables.
This is a particularly useful tool for validating that the data base and
configuration files are set up correctly. If
called from the unix command line, it prints its results on the terminal.
The '-h' is optional and defaults to aliasName
.
For example:
$iepmSrcDir/monhost-getcfg
will return a string of the
form:
("SRCDIR='/afs/slac/package/netmon/bandwidth-tests/v3src'",
"REPORTSDIR='/var/www/html'",
"PRIVATEDIR='/nfs/slac/g/net/iepm-bw/bandwidth-tests/litetest/slaconly'",
"WEBPATH='http://nettest2.slac.stanford.edu'",
"DAYSTOANALYZE='30'",
"DATATOANALYZE='ping:avg=w i lt 1;ping:min=w i lt 0;abwe:avdbcap=w p lt 5;abwe:avabw=w p lt 12;abwe:avxtr=w p lt 8'",
"MASTERTIME2RUN='10'",
"GNUPLOTPATH='/usr/local/bin/gnuplot'",
"PLOTICUSPATH='/afs/slac/package/netmon/bandwidth-tests/ploticus/pl'",
"PINGPATH='/bin/ping'",
"TRACEPATH='/usr/sbin/traceroute'",
"GREPPATH='/bin/grep'",
"CGIPATH='http://nettest2.slac.stanford.edu/cgi-bin'",
"CGIDIR='/var/www/cgi-bin'","SITENAME='SLAC IEPMLITE'")
It is primarily called from perl scripts by:
@ans= `$iepmSrcDir/monhost-getcfg `;
chop @ans;
#now define the parms
eval("\@parms = $ans[0];");
grep (eval("\$$_;"),@parms);
and the following perl variables are defined.
iepmSrcDir
)$DATATOANALYZE =
'ping:avg=w i lt 1;ping:min=w i lt 0;abwe:avdbcap=w p lt 5;abwe:avabw=w p lt 12;abwe:avxtr=w p lt 8'
indicates to the system that it is to analyze:
$iepmSrcDir/get-nodelist
returns a string which when evaluated, defines
an associative array %TESTLIST
. For example:@ans = $iepmSrcDir/get-nodelist
eval("$ans[0]";)
%TESTLIST=('node2.rhic.bnl.gov','abwe,ping,traceroute','node1.clrc.ac.uk','abwe,ping,traceroute')
@nodes = keys(%TESTLIST)
. This script is used heavily in the code for going through all the
nodes.
$iepmSrcDir/create-abw-list
creates the IEPMLITE configuration file for ABWE monitoring processes. It is saved as
$iepmSrcDir/config/IEPMLITE.conf
. There are 3 columns which are legacy, and can
be ignored although they must be provided for parsing purposes. They are "db", "poll",
and "shortname".
It must be manually stored into the
ABWE source directory at: $iepmSrcDir/abw/Conf/IEPMLITE.conf
. This is the table the abwed daemon will use to perform abwe measurements. When new nodes are added to this process, this manual store must be repeated, and the daemon must be restarted.
The ABWE daemon is started by
$iepmSrcDir/abwed IEPMLITE
. The abwe_rfl is started by executing $iepmSrcDir/keep-servers-alive
. However, the keepalive system generally starts both of these actions and keeps it running, so the issuance of this manual command should not be needed.
traceanal/makegifs -f [character or number] -t number -o output directory - generates a red, white and orange gif image icon for a number or character in the specified output directory. If -t is not provided, -t = -f.
These all have the same arguments, and defaults are provided.
"-t" is the testtype, and the default is "background"
"-o" is the directory where the output is written, and /tmp is thye default
"-n" is the aliasname of the desired node, but all are fetched if it is not provided.
"-s" is the starttime, either in epoch seconds or standard date format
"-e" is the endtime, either in epoch seconds or standard date format
"-h" is the monitoring host alias name and defaults to the host the code is executed on
"-t" is the testype. This is "background" for the normal data acquisition.
If "-e" and "-s" are not provided, the data for the last 24 hours is returned.
If the scripts are being run on the monitoring host, only -n, -s, and -e are required.
"fetch-ping-data -n node1.cacr.caltech.edu" will fetch the ping data for the last 24 hours for this node "fetch-abwe-data -n node1.cacr.caltech.edu" will fetch the awbe data for the last 24 hours for this node Note that ther name of the data files are returned from each statement. Lets call them "pingfile" and abwefile. The "-p" option for abwe (plotting xtr and abw) would be: "abwefile:xtr=w p lt 3,abwefile:abw=w p lt 1";Useful Code Snipits
utils/process-epoch.pl
converts dates to epoch and epoch times. To use it:
require "$iepmSrcDir/utils/process-epoch.pl"; $startime = toepoch("07/06/2004 09:52:59"); # sets $starttime to 1089132779 $endtime = fromepoch("1089132779"); # sets $endtime to "07/06/2004 09:52:59"utils/seeperlmods
displays the perl modules that are in located in the perl library on your machine. To use it:
10$iepmSrcdir/utils> seeperlmods ::afs::slac.stanford.edu::package::perl::lib::5.6.1::i386_linux22::.packlist AFS Apache::AuthCookie Apache::DBI Apache::Session ... libwww-perl libxml-perl mod_perl 11$iepmSrcdir/utils>Maintenance Scripts
copylogs directory
Copylogs shoule be run after midnight. This script examines the directory passed in for files of the form "somename.today". If it finds nay it saves then as "somename.yesterday" and "somename.yesterday's_date'. It is currently set up to remove files older than 30 days.backup-iepm-mysql-database directory
This script creates a backup copy of the iepm mysql database and saves it in the specified directory with the name of the name "aliasName.iepm.today". This directory can be maintained by "copylogs".Adding a New Probe
Adding a new probe to the Iepm-BW test is "complex" because one must understand all the aspects of the probe:
fetch-bw-data -n [aliasname] -T [datatype] -s [start-date] -e [end-date] -o [outputdir]
NOTE: setenv IEPM_CNF /afs/slac/package/netmon/bandwidth-tests/v3src/config/iepm.cnf.iepm-bw.slac.stanford.edu
/usr/local/bin/perl fetch-abwe-data -n iepm-bw.cacr.caltech.edu -s 2/1/05 -e today
ScriptName($iepmSrcDir) Description Options CalledFrom($iepmSrcDir) Contact General Scripts bw-cleanup
Cleans up hung bwtests processes.
This looks for processes which match
its list @procs and are running under
the MNUSER account. It is simplistic.
Ifthe current hour minus the hour is
the process is > 1, the the process is
killed.
N/A post-test-processing-script
Connie Logg keep-servers-alive
Restarts servers necessary to keep
testing to target sites up and run-
ning. This script depends on the
'$iepmSrcDir/config/servers.alive'
file to know which servers to "keep-alive".
N/A Crontab
Connie Logg kill-processes
Looks for processes running under the
logged in ID and kills them if they are
more than 'n' minutes old. This is intended
to clean up after run-bw-tests processes
that don't terminate normally. The default
for -t is 10
-p "typestr1,typesrt2" -t n -i [yes|no] Crontab
Connie Logg Pingloss Scripts plot-ping
Executes $iepmSrcDir/get-pingplot-data
to gather the necessary ping data
formatted to include pingloss info.
This script graphs that data showing
moments of packetloss, out of order
or duplicate packets. The graphs can
be found by clicking
here.
-n aliasname -X x-axis_label -Y y-axis_label overnight-processing-script
Jerrod D. Williams get-pingplot-data
Executes $iepmSrcDir/fetch-ping-data
to gather ping data for the past 28
days for each node. This data is
formatted to display the results of
tests for out-of-order packets as well
as duplicate packets in the final two
columns of the output. Results of its
execution can be found at /tmp/ping-data.
N/A plot-ping
Jerrod D. Williams
The following are a list of problems which we have run into, what the causes might be and how to possible fix them.
iepmSrcDir/mysql/mysql-errtst
which tests the code snipits
iepmSrcDir/mysql/mysqltext-readonly.pl
and
iepmSrcDir/mysql/mysqltext-create.pl
.
Error messages are of the form:
Testing bad write connection call - Sample error message:
DBIERR: mysql-errtst: all parameters are not defined
- dataBase=iepm, dataBaseHost=nettest2.slac.stanford.edu,updateAcct = ,
Testing sql write error - Sample error message:
DBIERR: mysql-errtst: sql = 'UPDAE NODES set active=0 where
aliasv4="node5.clrc.ac.uk"
': You have an error in your SQL syntax. Check the manual that corresponds
to your MySQL server version for the right syntax to use near 'UPDAE NODES set active=0 where
aliasv4="node5.clrc
Testing bad read connection - Sample error message:
DBIERR: mysql-errtst: Read connect failed (database=iepm,dataBaseHost=nettest2.slac.stanford.edu)
- Access denied for user: 'any@nettest2.slac.stanford.edu' (Using password: NO)Testing sql read error - Sample error message:
DBIERR: mysql-errtst: sql = 'SELECT * from nodes' - Read request failed: Table 'iepm.nodes' doesn't exist"
Note that the message "(Using password: NO)" or "(Using password: YES)" simply tells whether a password is passed to the connect statement. It is not saying what the password was.
rpm -qa | grep -i mysql
rpm -e rpm_name
rpm -i MySQL-server-4.1.7-0.i386.rpm
(this will restart the mysql daemon) rpm -i MySQL-client-4.1.7-0.i386.rpm
, and rpm -i MySQL-devel-4.1.7-0.i386.rpm
. unzip perl.mysql4.1.zip
. export PATH=/usr/bin:$PATH
If the node being entered into the table is just a "slave" node (i.e. it has the required daemons running and never needs to be logged into) only the "*" fields are required. If it is a "partner" node (i.e. the monitoring host logs into it to run code or start daemons, then the '+' fields are required.
CREATE TABLE NODES (nodeID integer not null auto_increment, *aliasv4 varchar(255) UNIQUE,the node's alias name
aliasv6 varchar(255),ipv6 aliasname
*ipv4Name varchar(255),ipv4 name
*ipv4Addr varchar(15),ipv4 address
ipv6Name varchar(255),ipv6 name
ipV6Addr varchar (40),ipv6 address
*masterTime2run integer,maximum time to allow a probe to run
The following fields are highly recommended
contactName varchar(255), contactEmail varchar(255), contactPhone varchar(255), contactFax varchar(255), contactAddr varchar(255), country varchar(255),for grouping nodes
latitude real,for map placement
longitude real,for map placement
hostType varchar(255),cpu type, OS, nic card settings
The following fields are required if the node is a partner node.
+homeDir varchar(255),home directory of the remUser
+remUser varchar(255),remote user login account
+perlPath varchar(255),path to perl
+sshOpts varchar(255),options for the ssh command
+psOpts varchar(255),options for the ps command
defStreams integer,for multistream probes
defWinSize varchar(255),for setting probe windowsizes
siteUrl varchar(255),for example: www.slac.stanford.edu
*domain varchar(255),for example: slac.stanford.edu
*active integer,1=yes, 0=no; if 0 node is ignored
+grepPath varchar(255),path to grep
gnuplotPath varchar(255),only if gnuplot scripts will be run on it
+pingPath varchar(255),path to ping command
mailPath varchar(255),path to mail client
ploticusPath varchar(255),only if ploticus scripts will be run on it
+tracePath varchar(255),path to traceroute
);
The MONHOST table is used to define any monitoring hosts which are logging data to the "iepm" database on "this" machine. Note that any fields preceeded with a "*" are absolutely required. Before a monitoring host can be entered into the MONHOST table, it must have been defined in the NODES table.
CREATE TABLE MONHOST (monhostID integer not null auto_increment,created automatically
*nodeID integer not null UNIQUE,The nodeId from the NODES table
*srcDir varchar(255) not null,The source code directory ala v3src
privateDir varchar(255),a directory for any files that need to be "hidden" fromthe public
*reportsDir varchar(255) not null,The top directory for web page output
testDataDir varchar(255),For file transfer probes, this is where the files are stored for use in the file transfer probes
remoteosDir varchar(255),source directory for any code which is needed for partner probes
security varchar(255),security mechanism used for partner probes
*webPath varchar(255),the full web path to reportsDir (http://..)
*siteName varchar(255),Site name for web page titles
*daysToAnalyze integer,Number of days of data to analyze for canned reports
*dataToAnalyze text,data analysis and plotting specification
*cgiPath varchar(255),the full wepath to CGI scripts (http://...)
*cgiDir varchar(255),the full directory path to the cgi-bin directory
);
The TOOLSPECS table contains the information defining the test(probe) that is to be run. Note that all nodes must be predefined in the NODES table and the source node for the test must be defined in the MONHOST table.
CREATE TABLE TOOLSPECS (toolspecsID integer not null auto_increment,Note that "daysToAnalyze" and "dataToAnalyze" are initially defined in the MONHOST table. This is to override the global definitions in MONHOST for a particular tool specification. "runInterval" is not yet implemented, but will be the time between when tool specification is scheduled to run.created automatically
srcNodeID integer not null,The nodeId from the NODES table if the monitoring host
destNodeID integer not null,The nodeId from the NODES table of the target host
toolName varchar(255),The tool "name" (e.g. ping, abwe, traceroute)
toolPath varchar(255),The full path to the "tool" ala '/bin/ping'
toolDo char,if 1, the toolspec is performed. If 0, it is inactive
testtype varchar(255),The type of test. Automated tests are "background"
toolOpts1 varchar(255),First set of tool options
toolOpts2 varchar(255),Second set of tool options
toolOpts3 varchar(255),Third set of tool options
toolStreams INTEGER,# streams if test is a multistream probe
toolWinSize varchar(255),TCP windowsize, if applicable
toolSrcDataFile varchar(255),data file for data transfer
toolDestDataFile varchar(255),path on the remote host where the transferred data is written
toolPort integer,TCP or UDP port, if applicable
time2run integer,Allowable duration time to run the probe
daysToAnalyze integer,Number of days of data to analyze for canned reports
dataToAnalyze text,data analysis and plotting specification
runInterval integer,not yet implemented
lastRunEpoch integer,Updated by system run the tool runs
);
The world map is created by using the Geoplot applet from CAIDA.
Each monitoring host has a directory 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.
Geoplot.jar
The Geoplot.jar file consists of six java code files.
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.
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
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=???>
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.
Adding nodes The NODES table must be loaded first. After loading
the NODES table, run $iepmSrcDir/report-nodes
to generate a web page to show you the nodes and the
nodeid. You will need the nodeid's at this point to
load the MONHOST and TOOLSPECS tables via csv files.
Next load the MONHOST table.
Now load the TOOLSPECS table. This is the table where the
tests to be done on a regular basis are defined.
There is one entry for each (source node,destination node,
testtool) triplet. The format of this csv file
is:
$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:
To modify the look (add more info, etc) to the main plot page, modify the geoplot.html file.
$iepmSrcDir/fetch-lat-long
$iepmSrcDir/map-updated
which is running as a
daemon on the monitoring host.
Geoplot
<
param name=????? value=?????>
:
:
:
<
/applet>
More notes to be editted
For loading from a csv file see the section on
from
The csv file format is:
TABLENAME=tablename
#field1,field2,field3,...,fieldn
data1,data2,data3,...,datan
Note that the fields can be empty. For example:
TABLENAME=NODES
#aliasv4,aliasv6,ipv4name,ipv4addr,ipv6name,ipv6addr,domain,contactName,contactEmail,contactphone,contactfax,contactaddr,hosttype,siteurl
node6.slac.stanford.edu,,nettest4.slac.stanford.edu,134.79.240.28,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,,
node1.slac.stanford.edu,,nettest5.slac.stanford.edu,134.79.240.50,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,,
Note that these files can be created with a spreadsheet
program like excel.
TABLENAME=MONHOST
#nodeid,srcdir,privatedir,reportsdir,testdatadir,remoteosdir,security,cgipath,cgidir,webpath,sitename,daystoanalyze,datatoanalyze
2,/afs/slac/package/netmon/v3src,/u1/mydir,/var/www/html,,,,http://nettest2.slac.stanford.edu/cgi-bin,/var/www/cgi-bin,http://www.stanford.edu,SLAC,28,ping:avg=w i lt 1;ping:min=w i lt 0;abwe:avdbcap=w p lt 5;abwe:avabw=w p lt 12;abwe:avxtr=w p lt 8
For MONHOST the required fields are nodeid,srcdir,reportsdir,cgipath,cgidir,webpath,sitename,daystoanalyze,datatoanalyze
TABLENAME=TOOLSPECS
#srcnodeid,destnodeid,toolname,toolpath,tooldo,testtype,toolopts1,toolopts2,toolopts3,toolstreams,toolwinsize,runinterval,lastrunepoch,toolsrcdatafile,tooldestdatafile,toolport,time2run,daystoanalyze,datatoanalyze
2,6,ping,/bin/ping,1,background,-s 1000 -c 10 -w 20,,,,,600,,,,15,,,
Note that the nodeid's for the monitoring host and target
node must be input. Valid 'toolname's at this
point are 'ping', 'abwe' and 'trace'. Also required are:
toolname, toolpath,
tooldo=1,testtype=background,any tool options (toolopts1),
runinterval (in seconds), and time2run.
runinterval is not yet used, but its deployment is under
implementation.
Troubleshooting