[[PageOutline]] = How to configure Plastic Slices monitoring on an OpenFlow FOAM AM = == Introduction == This page explains how to configure an !OpenFlow FOAM server for [wiki:PlasticSlices/MonitoringRecommendations central GENI operational monitoring]. This page was written for {{{ tango-monitor-foam_0.4-1 }}} and may not work well with earlier versions. We have tested the FOAM utilities on Ubuntu 10.04 only, but expect they will also work on CentOS. If you are running a different OS and it is not obvious how to translate the instructions, please contact GPO infra. == Upgrading from previous versions == Version 0.4 of tango-monitor-foam introduces a script for reporting metadata about your site to the GMOC database. In addition, version 0.3 introduced a config file. If you are currently running a previous version of `tango-monitor-foam`, you need to do the following steps of this update: * [#II.Installthemonitoringsoftware II. Upgrade the monitoring software itself] * [#III.Createrequireddirectoriesandfiles III. Create required directories and files: Step 1 (add a config file for monitoring)] * [#IV.Reportsitemetadata IV. Report site metadata] * [#V.Testthescript V. Test the new script and make sure it still works] If you are installing `tango-monitor-foam` for the first time or upgrading from a version earlier than 0.2, read all sections to see which steps you need to take. == Variables == * ``: The user as which to run the FOAM monitoring. The scripts can run as root, or as a non-root user of your choice. (At GPO, we use the `ganglia` user.) * You need several pieces of identifying information for your site: * ``: a one-word phrase describing your site, which is your username for data submission to GMOC (see step I) (e.g. `ExoGENI-BBN`) * ``: a one-word name for the organization which runs your FOAM (e.g. `ExoGENI`) * ``: a one-word name for the physical location where your FOAM sits (e.g. `gpolab`) When you setup your config file in step III, you will also need a few pieces of metadata about your organization and POP. == Steps to configure FOAM 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. 1. IF you have not yet registered your site to submit data to GMOC, generate a password for automated monitoring data submission to use. All resources managed by a given set of people 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 which FOAM monitoring can use: {{{ sudo touch /usr/local/etc/monitoring_passwd sudo chown /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 monitoring password you want to use for the user ``. 3. Register site credentials: IF you have not yet registered your site to submit data to GMOC, follow the instructions at [wiki:GENIMetaOps/SiteCredentials]. === II. Install the monitoring software === Do these steps every time you install or upgrade the monitoring software. ==== If you are installing on Ubuntu ==== 1. Download the `tango-monitor-foam_0.4-1_all.deb` package file from [http://software.geni.net/local-sw/], and copy it onto your FOAM host, e.g. into `~/tango-monitor-foam_0.4-1_all.deb`. 2. Use dpkg to install the local package. This may fail due to dependencies and say it is leaving the package "unconfigured". Therefore, invoke apt-get to fix any missing dependencies: {{{ sudo dpkg -i ~/tango-monitor-foam_0.4-1_all.deb sudo apt-get -f install }}} ==== If you are installing on CentOS ==== 1. Download the `tango-monitor-foam-0.4-1.noarch.rpm` package file from [http://software.geni.net/local-sw/], and copy it onto your FOAM host, e.g. into `~/tango-monitor-foam-0.4-1.noarch.rpm`. 2. Use yum localinstall to install the local package. This will install the provided file, using your standard yum repositories to find any dependencies: {{{ sudo yum --nogpgcheck localinstall ~/tango-monitor-foam-0.4-1.noarch.rpm }}} === III. Create required directories and files === * ``: a one-word phrase describing your site, which is your username for data submission to GMOC (see step I) (e.g. `ExoGENI-BBN`) * ``: a one-word name for the organization which runs your FOAM (e.g. `ExoGENI`) * ``: a one-word name for the physical location where your FOAM sits (e.g. `gpolab`) Step 1 needs to be done the first time you upgrade from `tango-monitor-foam-0.2` or earlier. All three steps need to be done the first time you install tango-monitor-foam. 1. Populate the gmoc_monitoring configuration file: * Create the config file (the file does not contain sensitive information, and may safely be left world-readable): {{{ /usr/local/etc/gmoc_monitoring.conf }}} * Edit the file and make sure to populate all variables (N.B. use single quotes to surround any value containing whitespace): {{{ $ cat /usr/local/etc/gmoc_monitoring.conf # GMOC short name which is your username for authenticated monitoring data submission SITENAME= # GMOC short name of organization which manages your aggregate (may be the same as SITENAME if appropriate) ORGNAME= # GMOC short name of "POP"/lab where your aggregate is located (may be the same as SITENAME if appropriate) POPNAME= # Primary contact for the organization ORG_PRIMARY_CONTACT_EMAIL= ORG_PRIMARY_CONTACT_FIRSTNAME= ORG_PRIMARY_CONTACT_LASTNAME= # The street address of your POP POPORG_ADDR_STREET='' POPORG_ADDR_CITY= POPORG_ADDR_STATE= POPORG_ADDR_POSTCODE= # Some arbitrary name for the street address of your POP POPORG_LOCATION_NAME= # Relational data submission URL GMOC_REL_URL=https://gmoc-db.grnoc.iu.edu/xchange/webservice.pl # Measurement data submission URL GMOC_MEAS_URL=https://gmoc-db.grnoc.iu.edu/measurement_drop/recv_api.pl }}} 2. Create required directories: {{{ sudo mkdir -p /var/cache/fvmetrics/monitoring sudo chown /var/cache/fvmetrics/monitoring sudo mkdir -p /var/spool/rrds/REPORT sudo chown -R /var/spool/rrds }}} 3. The `metric_foam` script requires a FOAM password file, which it expects to find in: {{{ /opt/foam/etc/foampasswd }}} This file should contain the admin password for FOAM. (This is the password you use with `foamctl` to run FOAM commands.) === IV. Report site metadata === Use a reporting script to add your site metadata to GMOC's database: {{{ sudo -u /usr/bin/report_site_metadata }}} This should exit successfully with no output. If any output is reported, contact GMOC or GPO for debugging. === V. Test the script === Run the monitoring and submission scripts by hand to make sure they work. 1. Check the time on your FOAM host, and make sure it is accurate. The 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. 2. Run the metric gathering script by hand to make sure it works: {{{ sudo -u /usr/bin/metric_foam }}} * This should produce no output * After this runs, a number of RRD files should be created in `/var/spool/rrds/metrics` 3. Run the data reporting script by hand to make sure it works: {{{ sudo -u /usr/bin/report_data_to_gmoc }}} * This should produce no output * You should be able to browse to [http://gmoc-db.grnoc.iu.edu/api-demo/], view data by Location, select your site, and find an entry for your node. === 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 `` crontab: {{{ sudo -u crontab -e }}} and add the new lines: {{{ */1 * * * * /usr/bin/metric_foam */5 * * * * /usr/bin/report_data_to_gmoc }}} ''N.B. If you have cron jobs already installed which contain parameters after these commands, you can update them or leave them as is. The CLI parameters are now ignored.''