Any node (target or monitoring host) must be entered into the NODES table before anything can be done with it. There is a 'AddNode' CGI script in development to facilitate this, however, the monitoring host must be set up before the CGI script can be used, so the monitoring host information must be manually added to the NODES table. This can be done by manually entering MySQL with a write enabled MySQL account, and using the 'INSERT into NODES...' command, or by creating a CSV file with the information in it for the node or nodes to be entered into the NODES table. Use of a spreadsheet program like EXCEL can be used to create the csv file, however the file must be saved as a UNIX file, and not as a DOS file. This is very important as a DOS file has many special characters in it.

The CSV file must have the table name on the first line as in the example below. The next line must be the names of the TABLE fields, all on one line and prefaced by a '#'. The following lines (note that there must be only one line per node, but the example wraps due to the formatting of this text) contains the field contents each separated by a comma (','). Note that the alias name for monitoring hosts must begin with the string 'iepm-bw'.

For example:

TABLENAME=NODES## Note the following 4 lines must be on one line
#aliasv4,ipv4Name,ipv4Addr,contactName,contactEmail,hostType,
homeDir,remUser,perlPath,sshOpts,psOpts,masterTime2run,siteUrl,
domain,active,grepPath,gnuplotpath,pingpath,mailpath,country,
latitude,longitude,locallink,tracepath,contactphone

## Double ## lines are ignored - Sample Monitoring host - node that the following 4 lines must be on one line
iepm-bw.myname.mydomain,iepmbw.mydomain,134.79.240.36,ConnieLogg,cal@slac.stanford.edu,linux nic=1G,
/home/iepm,iepm,/usr/local/bin/perl,,,60,http://www.slac.stanford.edu,
slac.stanford.edu,1,/bin/grep,/usr/local/bin/gnuplot,/bin/ping,/bin/mail,USA,
37.45,-122.18,/home/iepm/v3src/bin,/usr/sbin/traceroute,650-926-2879

## Sample Target host - note that the following 4 lines must be on one line
node11.usatlas.bnl.gov,atlasprod3.usatlas.bnl.gov,130.199.5.26,Xin Zhao,xzhao@bnl.gov,linux nic=1G,
/home/iepm,iepm,/usr/bin/perl,,,,,
usatlas.bnl.gov,1,,,,,USA,
40.77,-72.91,,,000-000-0000

For target hosts which will only have ping and traceroute performed to them,  only the following fields are required: aliasv4,ipv4Name,ipv4Addr,domain,active,country,latitude,longitude

For target hosts which will have other probes performed to them, the following fields are required since they need to have the target kit installed on them: aliasv4, ipv4Name, ipv4Addr, contactName, contactEmail, hostType, homeDir, remUser, perlPath, sshOpts, psOpts, domain, active, country, latitude, longitude

If sshOpts and special psOpts are not required, these can be left out. There are defined defaults for the 'path' elements, and these can be left out if the defaults are ok. Check the NODEStable to see the defaults.

Once the csv file is created as a UNIX flat file, it can be loaded with the following command

$bandsrc/mysql/load-table-from-csv -f filename

The NODES table can also be loaded by sql commands. As an example:

insert into NODES (aliasv4, ipv4Name, ipv4Addr, contactName, contactEmail, 
hostType, homeDir, remUser, active, country, latitude, longitude) 
values (node11.usatlas.bnl.gov,atlasprod3.usatlas.bnl.gov, 
130.199.5.26,Xin Zhao,xzhao@bnl.gov,linux nic=1G,/home/iepm,iepm,1,USA,40.77,-72.91);
  • No labels