[[PageOutline]] = How to configure tango-monitor-foam to implement GMOC reporting on a FOAM aggregate = == Introduction == This page explains how to configure an !OpenFlow FOAM server for [wiki:TangoGeniMonitoring shared GENI operational monitoring]. This page was written for {{{ tango-monitor-foam_0.5.1-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.5 of tango-monitor-foam no longer includes gmoc.py, the python client which submits monitoring data to GMOC. That file has been split into a separate package, tango-monitor-gmoc. If you are currently running a previous version of tango-monitor-foam, you need to do the following steps of this update: * [#I.Installtango-monitor-gmoc I. Install tango-monitor-gmoc] * [#II.Installthemonitoringsoftware II. Upgrade tango-monitor-foam itself] * [#III.Createrequireddirectoriesandfiles III. Create required directories and files (step 2: make sure you have a FOAM password file where tango-monitor-foam expects to find one)] * [#IV.Testthescript IV. Test the new script and make sure it still works] If you are installing `tango-monitor-foam` for the first time, 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.) == Steps to configure FOAM monitoring == === I. Install tango-monitor-gmoc === Follow the steps at [wiki:TangoGeniMonitoring/GmocConfiguration] to install and configure the generic GMOC monitoring client `tango-monitor-gmoc`. Before you move on to the next step, make sure tango-monitor-gmoc is installed, and is at version 1.2.12 or higher. Check this using: * Ubuntu: {{{ dpkg -l tango-monitor-gmoc }}} * CentOS: {{{ rpm -q tango-monitor-gmoc }}} If you don't have tango-monitor-gmoc, go to [wiki:TangoGeniMonitoring/GmocConfiguration] for the install instructions. === 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.5.1-1.deb` package file from [http://software.geni.net/local-sw/], and copy it onto your FOAM host, e.g. into `~/tango-monitor-foam_0.5.1-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.5.1-1_all.deb sudo apt-get -f install }}} ==== If you are installing on CentOS ==== 1. Download the `tango-monitor-foam-0.5.1-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.5.1-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.5.1-1.noarch.rpm }}} === III. Create required directories and files === These steps needs to be done only the first time you install tango-monitor-foam. 1. Create required directories for caching flowvisor state: {{{ sudo mkdir -p /var/cache/fvmetrics/monitoring sudo chown /var/cache/fvmetrics/monitoring }}} 2. The `metric_foam` script requires a FOAM password file, which it expects to find in: {{{ /etc/foam.passwd }}} This file should contain the admin password for FOAM. (This is the password you use with `foamctl` to run FOAM commands.) * ''If you wish to store your FOAM password in a different file'', edit the GMOC monitoring config file: {{{ /usr/local/etc/gmoc_monitoring.conf }}} and add a line: {{{ FOAM_PASSWD_FILE= }}} === IV. 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. === V. 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.''