[[PageOutline]] = How to configure Plastic Slices monitoring on a MyPLC PlanetLab node = == Introduction == This page explains how to configure a MyPLC !PlanetLab node for the [wiki:PlasticSlices/MonitoringRecommendations Plastic Slices central monitoring configuration]. This page was written for {{{ plastic-slices-monitor-plnode-0.3 }}} which is the latest version of the monitoring utilities for a MyPLC !PlanetLab node running Fedora 8 or Fedora 12. == Variables == * ``: a one-word phrase describing your site, probably the name of your university or lab (e.g. `stanford`, `gpolab`). Use the same value for all hosts your site is monitoring. * ``: The fully-qualified domain name as which your MyPLC should report data. ''IF this is not the same as the output of `uname -n` on your node, pay attention to section IV below.'' The scripts must run as root on nodes, because they use `vserver-stat` to obtain node status. This page assumes you will also do your reporting as root. == Steps to configure MyPLC PlanetLab node monitoring == === I. Prepare to submit authenticated monitoring data to GMOC === You need to do these steps if you are installing monitoring for the first time, or if you are upgrading from version 0.2 or previous. 1. Register site credentials: IF you have not yet registered your site to submit data to GMOC, follow the instructions at [wiki:GENIMetaOps/SiteCredentials]. All site resources use the same credential; you only need to do this step once for your entire site. '''Note: the password you use for your site registration is a new password generated for the purpose of submitting monitoring data. Do not reuse any existing passwords from your site.''' 2. Store your site password in a file: create a file containing the {{{ sudo touch /usr/local/etc/monitoring_passwd sudo chmod 600 /usr/local/etc/monitoring_passwd sudo vi /usr/local/etc/monitoring_passwd }}} Add exactly one line to this file, containing the site monitoring password you registered with GMOC in step 1. === II. Install the monitoring software === 1. Download the `plastic-slices-monitor-plnode-0.3.tar.gz` tarball from [http://software.geni.net/local-sw/], and copy it onto your node, e.g. into `~/plastic-slices-monitor-plnode-0.3.tar.gz`. 2. Download the GMOC `measurement_sender.pl` script from [http://gmoc-db.grnoc.iu.edu/sources/measurement_api/measurement_sender.pl], and copy it onto your node, e.g. into `~/measurement_sender.pl` 3. Unpack the tarball in `~`, and copy the files into place: {{{ cd ~ tar xvzf ~/plastic-slices-monitor-plnode-0.3.tar.gz cd plastic-slices-monitor-plnode-0.3 sudo mkdir -p /usr/local/{bin,lib} sudo cp bin/{build_gmoc_conf,metric_plnode,report_data_to_gmoc} /usr/local/bin sudo cp lib/{metricscollector.py,rrd_metric.py} /usr/local/lib sudo chmod 555 /usr/local/bin/{build_gmoc_conf,metric_plnode,report_data_to_gmoc} sudo chmod 444 /usr/local/lib/{metricscollector.py,rrd_metric.py} }}} 4. Copy `measurement_sender` into place: {{{ sudo cp ~/measurement_sender.pl /usr/local/bin/measurement_sender sudo chmod 555 /usr/local/bin/measurement_sender }}} === III. Install software dependencies === When installing or upgrading, make sure you have all current software dependencies installed on the system: * IF your nodes can run yum, simply install the dependencies: {{{ sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl perl-Crypt-SSLeay }}} * IF this doesn't work for you, see [wiki:GpoLab/MyplcPackageInstallationTips#Debuggingmonitoringdependencies] for some other suggestions which might work. === IV. Create required directories and files === These steps only need to be done the first time you install the monitoring software. 1. Create required directories: {{{ sudo mkdir -p /var/spool/rrds/$(uname -n) sudo mkdir -p /var/spool/rrds/REPORT }}} 2. IF `uname -n` does not report your node's FQDN for whatever reason, create a symlink so that reporting and reading scripts can find your RRD files: {{{ cd /var/spool/rrds sudo ln -s $(uname -n) }}} === V. Test the script === Run the monitoring and submission scripts by hand to make sure they work. 1. Check the time on your node, and make sure it is accurate. The timeseries data reporting format relies on clock accuracy, so your nodes must be running ntpd (or ntpdate regularly out of cron) in order for monitoring to work. MyPLC !PlanetLab nodes should get a working NTP configuration automatically, but check to make sure it is working. 2. Run the metric-gathering script by hand to make sure it works: {{{ sudo /usr/local/bin/metric_plnode }}} * This should produce no output * After this runs, at least one RRD file should be created in `/var/spool/rrds/$(uname -n)` * If you run the script a second time, it should start creating additional per-sliver RRDs whose filenames begin with `pl_sliver_` 3. Run the data reporting script by hand to make sure it works: {{{ sudo /usr/local/bin/report_data_to_gmoc }}} * This should produce no output * You should be able to browse to [http://gmoc-dev.grnoc.iu.edu/api-demo/data/], view data by Location, select your site, and find an entry for ``. === VI. Install the scripts to run from cron === This only needs to be done the first time you install the monitoring software. Add the two scripts to cron: modify the root crontab: {{{ sudo crontab -e }}} and add the new lines: {{{ */1 * * * * /usr/local/bin/metric_plnode */5 * * * * /usr/local/bin/report_data_to_gmoc }}}