Changes between Initial Version and Version 1 of PlasticSlices/MonitoringRecommendations/MyplcConfiguration


Ignore:
Timestamp:
05/04/11 23:05:37 (13 years ago)
Author:
chaos@bbn.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PlasticSlices/MonitoringRecommendations/MyplcConfiguration

    v1 v1  
     1[[PageOutline]]
     2
     3= How to configure Plastic Slices monitoring on a MyPLC server =
     4
     5== Introduction ==
     6
     7This 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
     8{{{
     9plastic-slices-monitor-myplc-0.1.tar.gz
     10}}}
     11which is the latest version of the monitoring utilities for a MyPLC server running Fedora 8 or Fedora 12.
     12
     13== Variables ==
     14
     15 * `<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.)
     16 * `<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 6 below.''
     18
     19== Steps ==
     20
     21 1. Copy the tarball over to your myplc, e.g. into `~/plastic-slices-monitor-myplc-0.1.tar.gz`.
     22
     23 2. Unpack the tarball in `/`:
     24{{{
     25cd /
     26sudo tar xvzf ~/plastic-slices-monitor-myplc-0.1.tar.gz
     27}}}
     28 This should create the following files:
     29{{{
     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
     35}}}
     36
     37 3. Optionally cache packages for later use on !PlanetLab nodes: later, when you follow [wiki:PlasticSlices/MonitoringRecommendations/PlnodeConfiguration], you will install the same packages on your MyPLC !PlanetLab nodes, which you are now installing on the myplc server.  IF your nodes cannot run yum, you'll have to install these packages by hand using RPM.  In that case, try downloading these packages on your myplc server now, using a program called `yumdownloader`.  It may save you from having to resolve dependencies by hand on your nodes later.  The steps to download the packages are:
     38{{{
     39sudo yum install yum-utils
     40mkdir ~/rpms
     41sudo yumdownloader --destdir ~/rpms --resolve rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
     42}}}
     43 (You need to do this before you actually install the packages on your myplc, because `yumdownloader` will only download dependencies if they aren't already installed.)
     44
     45 4. Install required packages (whether or not you just downloaded the RPMs for use on your nodes, install them on the myplc itself now):
     46{{{
     47sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
     48}}}
     49 The monitoring scripts use these packages to:
     50   * Manage RRD files
     51   * Write the XML-based API format for the GMOC database
     52   * Send the formatted data to GMOC via HTTP
     53 
     54 5. Create required directories:
     55{{{
     56sudo mkdir -p /var/spool/rrds/$(uname -n)
     57sudo mkdir -p /var/spool/rrds/REPORT
     58sudo chown -R <cronuser> /var/spool/rrds
     59}}}
     60
     61 6. 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:
     62{{{
     63cd /var/spool/rrds
     64sudo ln -s $(uname -n) <fqdn>
     65}}}
     66
     67 7. Run the metric-gathering script by hand to make sure it works:
     68{{{
     69sudo -u <cronuser> /usr/share/plc_api/plcsh /usr/local/bin/metric_plc
     70}}}
     71 * This should produce no output
     72 * After this runs, a number of RRD files should be created in `/var/spool/rrds/$(uname -n)`
     73
     74 8. Run the data reporting script by hand to make sure it works:
     75{{{
     76sudo -u <cronuser> /usr/local/bin/report_data_to_gmoc <site> <fqdn>
     77}}}
     78 * This should produce no output
     79 * 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>`.
     80
     81 9. Add the two scripts to cron: modify the `<cronuser>` crontab:
     82{{{
     83sudo -u <cronuser> crontab -e
     84}}}
     85 and add the new lines:
     86{{{
     87*/1 * * * * /usr/share/plc_api/plcsh /usr/local/bin/metric_plc
     88*/5 * * * * /usr/local/bin/report_data_to_gmoc <site> <fqdn>
     89}}}
     90