public
Description: a web (interface | service) for viewing collectd statistics
Homepage: http://auxesis.github.com/visage
Clone URL: git://github.com/auxesis/visage.git
visage /
name age message
file .gitignore Fri Sep 11 16:02:34 -0700 2009 ignore profiles [auxesis]
file README.md Fri Oct 16 06:30:14 -0700 2009 marked off todo, added another [auxesis]
file Rakefile Mon Sep 07 14:55:44 -0700 2009 added haml dependency [auxesis]
directory bin/ Sun Aug 30 10:30:55 -0700 2009 added cucumber runner [auxesis]
file config.ru Fri Sep 11 03:34:51 -0700 2009 use non-deprecated rackup syntax for sinatra [auxesis]
directory config/ Tue Oct 06 23:34:42 -0700 2009 provide a default config option for shading [auxesis]
directory features/ Thu Oct 29 05:04:12 -0700 2009 filled in steps for verifying json works as exp... [auxesis]
directory gems/ Thu Oct 29 04:23:17 -0700 2009 bumped version of bundled yajl [auxesis]
directory lib/ Thu Oct 29 04:34:10 -0700 2009 added comments explaining intention of the clas... [auxesis]
directory public/ Thu Oct 29 04:23:29 -0700 2009 make comment clearer [auxesis]
directory views/ Tue Oct 06 23:34:24 -0700 2009 pass through whether shading is enabled from co... [auxesis]
file visage.rb Fri Sep 11 16:54:54 -0700 2009 added handler for building a combined javascrip... [auxesis]
README.md

Visage

Visage is a web interface for viewing collectd statistics.

It also provides a JSON interface onto collectd's RRD data, giving you an easy way to mash up the data.

Features

  • renders graphs in the browser, and retrieves data asynchronously
  • interactive graph keys, to highlight lines and toggle line visibility
  • drop-down or mouse selection of timeframes (also rendered asynchronously)
  • JSON interface onto collectd RRDs

Check out a demo at http://visage.unstated.net/.

Installing

Freeze in dependencies:

$ rake deps

Amongst other things, this will pull in RubyRRDtool, which requires the rrdtool headers to build a C extension. On Ubuntu these are in the librrd2-dev package.

Configuring

Config lives in several files under config/.

  • profiles.yaml - groups of graphs Visage is to display
  • plugin-colors.yaml - colors for specific plugins/plugin instances
  • fallback-colors.yaml - ordered list of fallback colors
  • init.rd - bootstrapping code, specifies collectd's RRD directory

profiles.yaml isn't setup by default, but you can copy profiles.yaml.sample across and edit to taste. The plugins are in the format of plugin/plugin-instance, with plugins-instance being optional.

If you don't specify a plugin-instance Visage will attempt to graph all plugin instances under the specified plugin, e.g. cpu-0 will display cpu-idle, cpu-interrupt, cpu-nice, etc, whereas cpu-0/cpu-wait will only show cpu-wait.

It should be pretty easy to deduce the config format from the existing file (it's simple nested key-value data).

Make sure collectd's RRD directory is readable by whatever user the web server is running as. You can specify where collectd's rrd directory is in init.rb, with the c['rrddir'] key.

Developing

For development:

$ gem install shotgun
$ shotgun sinatra-collectd.rb

Deploying

With Passenger, create an Apache vhost with the DocumentRoot set to the public/ directory of where you have deployed the checked out code, e.g.

<VirtualHost *>
  ServerName visage.example.org
  ServerAdmin contact@visage.example.org

  DocumentRoot /srv/www/visage.example.org/root/public/

  <Directory "/srv/www/visage.example.org/root/public/">
     Options FollowSymLinks Indexes
     AllowOverride None
     Order allow,deny
     Allow from all 
   </Directory>

   ErrorLog /srv/www/visage.example.org/log/apache_errors_log
   CustomLog /srv/www/visage.example.org/log/apache_app_log combined

</VirtualHost>

This assumes you have a checkout of the code at /srv/www/visage.example.org/root.

If you don't want to use Apache + Passenger, you can install the thin or mongrel gems and run up a web server yourself.

Ubuntu users looking for Passenger packages should add John Ferlito's mod-passenger PPA to their apt sources.

Testing

Run all cucumber features:

$ rake cucumber 

Specific features:

$ bin/cucumber --require features/ features/something.feature

TODO

  • create proper mootools class - DONE
  • switch to g.raphael - DONE
  • config file - DONE
  • data profiles - DONE
  • handle single plugin instance in graphing code - DONE
  • specify data url in graphing code - DONE
  • generate holders for graph/labels/time selector - DONE
  • clean up routes - DONE
  • smart colour selection (CPU-1 = CPU) - DONE
  • title attributes - DONE
  • split profiles + colors => plugins into separate files - DONE
  • fix key labels - DONE
  • axis labels (with human readable times) - DONE
  • detailed point-in-time data on hover
  • embedded html generator - DONE
  • zoom + dynamic resize - DONE
  • combine graphs from different hosts
  • comment on time periods
  • view list of comments
  • provide option to shade under graphs - DONE
  • interface to build custom graph profiles