Changes between Version 7 and Version 8 of PlasticSlices/MonitoringRecommendations/MyplcConfiguration


Ignore:
Timestamp:
07/08/11 12:34:21 (13 years ago)
Author:
chaos@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PlasticSlices/MonitoringRecommendations/MyplcConfiguration

    v7 v8  
    55== Introduction ==
    66
    7 This page explains how to configure a MyPLC server for the [wiki:PlasticSlices/MonitoringRecommendations Plastic Slices central monitoring configuration].  Before following these instructions, please ask GPO infra for a copy of the tarball
     7This page explains how to configure a MyPLC server for the [ggw:PlasticSlices/MonitoringRecommendations Plastic Slices central monitoring configuration].  This page was written for
    88{{{
    9 plastic-slices-monitor-myplc-0.1.tar.gz
     9plastic-slices-monitor-myplc-0.2
    1010}}}
    11 which is the latest version of the monitoring utilities for a MyPLC server running Fedora 8 or Fedora 12.
     11which is the latest version of the monitoring utilities for a MyPLC server running Fedora 8 or Fedora 12.  It may not work well with older versions.
    1212
    1313== Variables ==
     
    1515 * `<cronuser>`: The user as which to run the monitoring on MyPLC.  The scripts can run as root, or as a non-root user of your choice.  (At GPO, we use the `ganglia` user.)
    1616 * `<site>`: 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.
    17  * `<fqdn>`: 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 step 5 below.''
     17 * `<fqdn>`: 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.''
    1818
    19 == Steps ==
     19== Steps to configure MyPLC monitoring ==
    2020
    21  1. Copy the tarball over to your myplc, e.g. into `~/plastic-slices-monitor-myplc-0.1.tar.gz`.
     21=== I. Prepare to submit authenticated monitoring data to GMOC ===
    2222
    23  2. Unpack the tarball in `/`:
     23You need to do these steps if you are installing monitoring for the first time, or if you are upgrading from version 0.1.
     24
     25 1. Register site credentials: IF you have not yet registered your site to submit data to GMOC, follow the instructions at [ggw: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.'''
     26
     27 2. Store your site password in a file which MyPLC monitoring can use:
    2428{{{
    25 cd /
    26 sudo tar xvzf ~/plastic-slices-monitor-myplc-0.1.tar.gz
     29sudo touch /usr/local/etc/monitoring_passwd
     30sudo chown <cronuser> /usr/local/etc/monitoring_passwd
     31sudo chmod 600 /usr/local/etc/monitoring_passwd
     32sudo vi /usr/local/etc/monitoring_passwd
    2733}}}
    28  This should create the following files:
     34 Add exactly one line to this file, containing the site monitoring password you registered with GMOC.
     35
     36=== II. Install the monitoring software ===
     37
     38Do all of these steps every time you install or upgrade the monitoring software.
     39
     40 1. Download the `plastic-slices-monitor-myplc-0.2.tar.gz` tarball from [http://software.geni.net/local-sw/], and copy it onto your MyPLC host, e.g. into `~/plastic-slices-monitor-myplc-0.2.tar.gz`.
     41
     42 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 MyPLC host, e.g. into `~/measurement_sender.pl`
     43
     44 3. Unpack the tarball in `~`, and copy the files into place:
    2945{{{
    30 /usr/local/bin/build_gmoc_conf
    31 /usr/local/bin/measurement_sender
    32 /usr/local/bin/metric_plc
    33 /usr/local/bin/report_data_to_gmoc
    34 /usr/local/lib/rrd_metric.py
     46cd ~
     47tar xvzf ~/plastic-slices-monitor-myplc-0.2.tar.gz
     48cd plastic-slices-monitor-myplc-0.2
     49sudo mkdir -p /usr/local/{bin,lib}
     50sudo cp bin/{build_gmoc_conf,metric_plc,report_data_to_gmoc} /usr/local/bin
     51sudo cp lib/rrd_metric.py /usr/local/lib
     52sudo chmod 555 /usr/local/bin/{build_gmoc_conf,metric_plc,report_data_to_gmoc}
     53sudo chmod 444 /usr/local/lib/rrd_metric.py
    3554}}}
    3655
    37  3. Install required packages:
    38  '''Note:''' Later, when you follow [wiki:PlasticSlices/MonitoringRecommendations/PlnodeConfiguration], you will install these same packages on each of your MyPLC !PlanetLab nodes.  IF your plnodes cannot run yum, you'll have to install the RPMs by hand during that step.  In that case, we recommend saving time by caching the RPMs and their dependencies on your MyPLC using [wiki:GpoLab/MyplcPackageInstallationTips#UseyumdownloadertodownloadpackagesanddependenciesontheMyPLC yumdownloader to download packages and dependencies] before you install them on the MyPLC.
     56 4. Copy `measurement_sender` into place:
     57{{{
     58sudo cp ~/measurement_sender.pl /usr/local/bin/measurement_sender
     59sudo chmod 555 /usr/local/bin/measurement_sender
     60}}}
    3961
    40  '''If you are in this situation, you should try out yumdownloader right now, before doing the rest of step 3.  If you wait until after you install the packages on the MyPLC, you can still use `yumdownloader` to get the packages, but it won't download resolved dependencies for you (so you'll have to download them by hand).'''
     62=== III. Install software dependencies ===
    4163
    42  Regardless, you should be able to install the packages on the MyPLC itself using yum directly:
     64When installing or upgrading, make sure you have all current software dependencies installed on the system:
    4365{{{
    44 sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
     66sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl perl-Crypt-SSLeay
    4567}}}
    46  The monitoring scripts use these packages to:
    47    * Manage RRD files
    48    * Write the XML-based API format for the GMOC database
    49    * Send the formatted data to GMOC via HTTP
     68The monitoring scripts use these packages to:
     69 * Manage RRD files
     70 * Write the XML-based API format for the GMOC database
     71 * Send the formatted data to GMOC via HTTPS
     72
     73=== IV. Create required directories and files ===
     74
     75These steps only need to be done the first time you install the monitoring software.
    5076 
    51  4. Create required directories:
     77 1. Create required directories:
    5278{{{
    5379sudo mkdir -p /var/spool/rrds/$(uname -n)
     
    5682}}}
    5783
    58  5. 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:
     84 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:
    5985{{{
    6086cd /var/spool/rrds
     
    6288}}}
    6389
    64  6. Check the time on your MyPLC server, 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.
     90=== V. Test the script ===
    6591
    66  7. Run the metric-gathering script by hand to make sure it works:
     92Run the monitoring and submission scripts by hand to make sure they work.
     93
     94 1. Check the time on your MyPLC server, 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.
     95
     96 2. Run the metric-gathering script by hand to make sure it works:
    6797{{{
    6898sudo -u <cronuser> /usr/share/plc_api/plcsh /usr/local/bin/metric_plc
    6999}}}
    70  * This should produce no output
    71  * After this runs, a number of RRD files should be created in `/var/spool/rrds/$(uname -n)`
     100   * This should produce no output
     101   * After this runs, a number of RRD files should be created in `/var/spool/rrds/$(uname -n)`
    72102
    73  8. Run the data reporting script by hand to make sure it works:
     103 3. Run the data reporting script by hand to make sure it works:
    74104{{{
    75105sudo -u <cronuser> /usr/local/bin/report_data_to_gmoc <site> <fqdn>
    76106}}}
    77  * This should produce no output
    78  * 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 a new entry for `<fqdn>`.
     107   * This should produce no output
     108   * 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 `<fqdn>`.
    79109
    80  9. Add the two scripts to cron: modify the `<cronuser>` crontab:
     110=== VI. Install the scripts to run from cron ===
     111
     112This only needs to be done the first time you install the monitoring software.
     113
     114Add the two scripts to cron: modify the `<cronuser>` crontab:
    81115{{{
    82116sudo -u <cronuser> crontab -e