Version 1 (modified by 13 years ago) (diff) | ,
---|
How to configure Plastic Slices monitoring on a MyPLC server
Introduction
This page explains how to configure a MyPLC server for the Plastic Slices central monitoring configuration. Before following these instructions, please ask GPO infra for a copy of the tarball
plastic-slices-monitor-myplc-0.1.tar.gz
which is the latest version of the monitoring utilities for a MyPLC server running Fedora 8 or Fedora 12.
Variables
<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 theganglia
user.)<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.<fqdn>
: The fully-qualified domain name as which your MyPLC should report data. IF this is not the same as the output ofuname -n
on your node, pay attention to step 6 below.
Steps
- Copy the tarball over to your myplc, e.g. into
~/plastic-slices-monitor-myplc-0.1.tar.gz
.
- Unpack the tarball in
/
:cd / sudo tar xvzf ~/plastic-slices-monitor-myplc-0.1.tar.gz
This should create the following files:/usr/local/bin/build_gmoc_conf /usr/local/bin/measurement_sender /usr/local/bin/metric_plc /usr/local/bin/report_data_to_gmoc /usr/local/lib/rrd_metric.py
- Optionally cache packages for later use on PlanetLab nodes: later, when you follow 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:sudo yum install yum-utils mkdir ~/rpms sudo yumdownloader --destdir ~/rpms --resolve rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
(You need to do this before you actually install the packages on your myplc, becauseyumdownloader
will only download dependencies if they aren't already installed.)
- Install required packages (whether or not you just downloaded the RPMs for use on your nodes, install them on the myplc itself now):
sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl
The monitoring scripts use these packages to:- Manage RRD files
- Write the XML-based API format for the GMOC database
- Send the formatted data to GMOC via HTTP
- Create required directories:
sudo mkdir -p /var/spool/rrds/$(uname -n) sudo mkdir -p /var/spool/rrds/REPORT sudo chown -R <cronuser> /var/spool/rrds
- 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) <fqdn>
- Run the metric-gathering script by hand to make sure it works:
sudo -u <cronuser> /usr/share/plc_api/plcsh /usr/local/bin/metric_plc
- This should produce no output
- After this runs, a number of RRD files should be created in
/var/spool/rrds/$(uname -n)
- Run the data reporting script by hand to make sure it works:
sudo -u <cronuser> /usr/local/bin/report_data_to_gmoc <site> <fqdn>
- 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 a new entry for
<fqdn>
.
- Add the two scripts to cron: modify the
<cronuser>
crontab:sudo -u <cronuser> crontab -e
and add the new lines:*/1 * * * * /usr/share/plc_api/plcsh /usr/local/bin/metric_plc */5 * * * * /usr/local/bin/report_data_to_gmoc <site> <fqdn>