public
Description: Admin interface for the Flapjack monitoring system
Homepage: http://flapjack-project.com/
Clone URL: git://github.com/auxesis/flapjack-admin.git
commit  b0fb67fb789c3cdc9b964d3e9e2cdd8b1b35156b
tree    bb1c679ccd8b2b1c8cf62ea4bc5bc852aba89bb8
parent  094b36444ccff3758a90f1b5b25b5bd99fb3fb27
name age message
file .gitignore Sun Mar 22 19:43:15 -0700 2009 include thor [auxesis]
file README.md Fri Aug 07 07:47:41 -0700 2009 added doco on restarting beanstalkd from the we... [auxesis]
file Rakefile Sat Mar 21 23:33:20 -0700 2009 init app [Lindsay Holmwood]
file TODO.md Fri Aug 07 07:35:17 -0700 2009 added todo [auxesis]
directory app/ Fri Aug 07 07:00:42 -0700 2009 added class for shelling out to the populator n... [auxesis]
directory autotest/ Sun Mar 22 00:22:42 -0700 2009 set up cucumber [Lindsay Holmwood]
directory bin/ Thu Jul 16 09:44:56 -0700 2009 removed debugging messages [auxesis]
file config.ru Tue Jul 14 04:06:26 -0700 2009 added environment hack to make rubyinline work ... [auxesis]
directory config/ Fri Aug 07 07:30:06 -0700 2009 added same block for restarting beanstalkd in t... [auxesis]
file cucumber.yml Sun Mar 22 00:22:42 -0700 2009 set up cucumber [Lindsay Holmwood]
directory doc/ Sat Mar 21 23:33:20 -0700 2009 init app [Lindsay Holmwood]
directory features/ Thu Aug 06 03:39:33 -0700 2009 fill in step to check that beanstalkd jobs == c... [auxesis]
directory gems/ Tue May 26 02:40:08 -0700 2009 added beanstalk-client gem [auxesis]
directory lib/ Fri Aug 07 07:36:00 -0700 2009 added simple rake task for invoking the restart... [auxesis]
directory log/ Wed May 27 17:37:05 -0700 2009 added stub file so log directory is in the repo [auxesis]
directory merb/ Sat Mar 21 23:33:20 -0700 2009 init app [Lindsay Holmwood]
directory public/ Tue Jul 14 04:07:04 -0700 2009 added styling for parameters [auxesis]
directory spec/ Fri Aug 07 07:03:02 -0700 2009 added comment on how to make this test non-pending [auxesis]
directory tasks/ Sun May 24 16:45:06 -0700 2009 added thor file for running cucumber tasks [auxesis]
README.md

flapjack-admin

An admin interface for the Flapjack monitoring system.

You administer checks through flapjack-admin, then run flapjack-populator to place the checks on beanstalkd. A flapjack-worker will then pull the check off queue, and flapjack-notifier will notify if the check reports and bad result.

Dependencies (Ubuntu Hardy)

Install the following dependencies:

sudo apt-get install rubygems build-essential \
                     ruby-dev libxml2-dev \
                     libsqlite3-dev libxslt1-dev libopenssl-ruby

Setup

  1. clone the repo
  2. cd into cloned repo
  3. bin/thor merb:gem:redeploy
  4. MERB_ENV=production bin/rake db:automigrate (this will create a sqlite database for you to use)
  5. bin/merb -e production
  6. Go to http://localhost:4000/ in your browser

Now create some checks, and then see the next section about populating jobs.

Populating jobs

FIXME: this is deprecated, now the web interface handles this

Once you've created jobs in the admin interface, you want to pop them onto the worker queue. flapjack-admin provides a simple tool to do this for you.

To flush out the previous jobs, you need to restart the beanstalkd.

sudo /etc/init.d/beanstalkd stop
sudo /etc/init.d/beanstalkd start

Then, to populate jobs:

bin/flapjack-populator sqlite3://$(pwd)/production.db

Restarting beanstalkd from flapjack-admin

Once you've set up a bunch of checks in flapjack-admin, you'll want to push them onto your beanstalkd. flapjack-admin will attempt to do this for you when you create a batch of checks through the interface.

As there are many ways to deploy Flapjack (different distributions, security models, Passenger vs. Thin/Mongrel), it's up to the user to tell flapjack-admin how to restart the beanstalkd.

Don't fret, this is really easy. You need to specify the restart logic to Merb.config.restart_beanstalkd in config/environments/production.rb. There's example block in config/environments/development.rb, which is what I use to restart beanstalkd on my development machine.

Put simply, it looks something like this:

Merb::Config.use do |c|
  c[:restart_beanstalkd] = Proc.new do 
    # magic restart logic here!
  end
end

You can test this by running a rake task:

$ MERB_ENV='development' bin/rake test_beanstalkd_restart

Sub out development with test/production to test those environments.

This approach is a bit of a cop out, but you can't please all the people all the time. As flapjack-admin matures, a prefered way of restarting beanstalkd will emerge.

Testing

To run Cucumber features:

$ bin/cucumber features

The Cucumber features live under features/