Changes between Version 7 and Version 8 of PlasticSlices/MonitoringRecommendations/MyplcConfiguration
- Timestamp:
- 07/08/11 12:34:21 (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PlasticSlices/MonitoringRecommendations/MyplcConfiguration
v7 v8 5 5 == Introduction == 6 6 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 tarball7 This page explains how to configure a MyPLC server for the [ggw:PlasticSlices/MonitoringRecommendations Plastic Slices central monitoring configuration]. This page was written for 8 8 {{{ 9 plastic-slices-monitor-myplc-0. 1.tar.gz9 plastic-slices-monitor-myplc-0.2 10 10 }}} 11 which is the latest version of the monitoring utilities for a MyPLC server running Fedora 8 or Fedora 12. 11 which 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. 12 12 13 13 == Variables == … … 15 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 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 s tep 5below.''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.'' 18 18 19 == Steps ==19 == Steps to configure MyPLC monitoring == 20 20 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 === 22 22 23 2. Unpack the tarball in `/`: 23 You 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: 24 28 {{{ 25 cd / 26 sudo tar xvzf ~/plastic-slices-monitor-myplc-0.1.tar.gz 29 sudo touch /usr/local/etc/monitoring_passwd 30 sudo chown <cronuser> /usr/local/etc/monitoring_passwd 31 sudo chmod 600 /usr/local/etc/monitoring_passwd 32 sudo vi /usr/local/etc/monitoring_passwd 27 33 }}} 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 38 Do 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: 29 45 {{{ 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 46 cd ~ 47 tar xvzf ~/plastic-slices-monitor-myplc-0.2.tar.gz 48 cd plastic-slices-monitor-myplc-0.2 49 sudo mkdir -p /usr/local/{bin,lib} 50 sudo cp bin/{build_gmoc_conf,metric_plc,report_data_to_gmoc} /usr/local/bin 51 sudo cp lib/rrd_metric.py /usr/local/lib 52 sudo chmod 555 /usr/local/bin/{build_gmoc_conf,metric_plc,report_data_to_gmoc} 53 sudo chmod 444 /usr/local/lib/rrd_metric.py 35 54 }}} 36 55 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 {{{ 58 sudo cp ~/measurement_sender.pl /usr/local/bin/measurement_sender 59 sudo chmod 555 /usr/local/bin/measurement_sender 60 }}} 39 61 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 === 41 63 42 Regardless, you should be able to install the packages on the MyPLC itself using yum directly:64 When installing or upgrading, make sure you have all current software dependencies installed on the system: 43 65 {{{ 44 sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl 66 sudo yum install rrdtool-python rrdtool-perl perl-File-Find-Rule perl-XML-Writer perl-libwww-perl perl-Crypt-SSLeay 45 67 }}} 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 68 The 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 75 These steps only need to be done the first time you install the monitoring software. 50 76 51 4. Create required directories:77 1. Create required directories: 52 78 {{{ 53 79 sudo mkdir -p /var/spool/rrds/$(uname -n) … … 56 82 }}} 57 83 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: 59 85 {{{ 60 86 cd /var/spool/rrds … … 62 88 }}} 63 89 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 === 65 91 66 7. Run the metric-gathering script by hand to make sure it works: 92 Run 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: 67 97 {{{ 68 98 sudo -u <cronuser> /usr/share/plc_api/plcsh /usr/local/bin/metric_plc 69 99 }}} 70 * This should produce no output71 * 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)` 72 102 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: 74 104 {{{ 75 105 sudo -u <cronuser> /usr/local/bin/report_data_to_gmoc <site> <fqdn> 76 106 }}} 77 * This should produce no output78 * 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 newentry 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>`. 79 109 80 9. Add the two scripts to cron: modify the `<cronuser>` crontab: 110 === VI. Install the scripts to run from cron === 111 112 This only needs to be done the first time you install the monitoring software. 113 114 Add the two scripts to cron: modify the `<cronuser>` crontab: 81 115 {{{ 82 116 sudo -u <cronuser> crontab -e