''WARNING: The flowvisor monitoring code is currently under construction. Make sure gpo-infra knows you want a copy, and we'll get you one as soon as it is working again.'' [[PageOutline]] = How to configure Plastic Slices monitoring on an OpenFlow !FlowVisor = == Introduction == This page explains how to configure an !OpenFlow !FlowVisor node for the [wiki:PlasticSlices/MonitoringRecommendations Plastic Slices central monitoring configuration]. Before following these instructions, please ask GPO infra for a copy of the tarball {{{ plastic-slices-monitor-flowvisor-0.1.tar.gz }}} which is the latest version of the monitoring utilities for a !FlowVisor. We have tested the !FlowVisor utilities on Ubuntu 10.04 only. If you are running a different OS and it is not obvious how to translate the instructions, please contact GPO infra. == Variables == * ``: The user as which to run the FV monitoring. The scripts can run as root, or as a non-root user of your choice. (At GPO, we use the `ganglia` user.) * ``: 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. * ``: The fully-qualified domain name as which your FV should report data. ''IF this is not the same as the output of `uname -n` on your node, pay attention to step 5 below.'' == Steps == 1. Copy the tarball over to your FV host, e.g. into `~/plastic-slices-monitor-flowvisor-0.1.tar.gz`. 2. Unpack the tarball in `/`: {{{ cd / sudo tar xvzf ~/plastic-slices-monitor-flowvisor-0.1.tar.gz }}} This should create the following files: {{{ /etc/init.d/metric_flowvisor /usr/local/bin/build_gmoc_conf /usr/local/bin/measurement_sender /usr/local/bin/metric_flowvisor /usr/local/bin/report_data_to_gmoc /usr/local/lib/rrd_metric.py }}} 3. Install required packages: {{{ sudo apt-get install python-rrdtool python-daemon librrds-perl libfile-find-rule-perl libwww-perl libxml-writer-perl }}} The monitoring scripts use these packages to: * Daemonize metric collection in order to retain packet counter state * Manage RRD files * Write the XML-based API format for the GMOC database * Send the formatted data to GMOC via HTTP 4. Create required directories: {{{ sudo mkdir /var/run/metrics sudo chown /var/run/metrics sudo mkdir -p /var/spool/rrds/$(uname -n) sudo mkdir -p /var/spool/rrds/REPORT sudo chown -R /var/spool/rrds }}} 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: {{{ cd /var/spool/rrds sudo ln -s $(uname -n) }}} 6. The `metric_flowvisor` daemon requires a flowvisor password file, which it expects to find in: {{{ FVPASSWD_FILE = '/etc/flowvisor/fvpasswd' }}} Either create a file in this location containing only the flowvisor root password, or create a file in a different location containing the password, and modify `/usr/local/bin/metric_flowvisor` to look in the new location. 7. The `metric_flowvisor` service init script contains a variable indicating which username to use when running the metric daemon. * Edit the file `/etc/init.d/metric_flowvisor` * Near the top of that file, correct the METRIC_USER setting for your environment: {{{ METRIC_USER= }}} 8. Start the metric-gathering service: {{{ sudo service metric_flowvisor start }}} * This should generate a PID file in: {{{ /var/run/metrics/flowvisor.pid }}} which should contain the PID of a running python-based process. * Within two minutes or so, a number of RRD files should be created in `/var/spool/rrds/$(uname -n)` 9. Run the data reporting script by hand to make sure it works: {{{ sudo -u /usr/local/bin/report_data_to_gmoc }}} * 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 ``. 10. Configure the metric-gathering service to start at boot: {{{ sudo update-rc.d metric_flowvisor defaults }}} 11. Add the reporting script to cron: modify the `` crontab: {{{ sudo -u crontab -e }}} and add the new line: {{{ */5 * * * * /usr/local/bin/report_data_to_gmoc }}}