cucumber-nagios lets you describe how a system should work in natural language, and outputs whether it does in the Nagios plugin format:

Feature: google.com
  It should be up
  And I should be able to search for things

  Scenario: Searching for things
    When I visit "http://www.google.com"
    And I fill in "q" with "wikipedia"
    And I press "Google Search"
    Then I should see "www.wikipedia.org"
  

Then run it:

$ cucumber-nagios google.feature
Critical: 0, Warning: 0, 4 okay | passed=4, failed=0
  

cucumber-nagios uses Webrat with the Mechanize backend, so you can point it any site you can reach over HTTP (you don't have to have access to the site's code). 

cucumber-nagios can also interact with machines over SSH through Net::SSH, bringing you closer to Behaviour Driven Infrastructure Nirvana.

Installing

cucumber-nagios is distributed as a RubyGem.

$ gem install gemcutter
$ gem tumble
$ gem install cucumber-nagios
  

Then you just set up a project to contain all your descriptions.

$ cucumber-nagios-gen project ebay.com.au
$ cd ebay.com.au
$ gem bundle
  

gem bundle freezes in RubyGem dependencies with Bundler, so you can tar up your cucumber-nagios project and put it on another machine easily.

Please note, the RubyGems Bundler requires RubyGems 1.3.5 or greater.

Using

Your cucumber-nagios project includes a generator that can spit out features. From within your project directory:

$ bin/cucumber-nagios-gen feature ebay.com.au bidding
  

ebay.com.au being the site you want to test, and bidding the feature you want to test.

Write your features in your favourite editor (the above feature will live in features/ebay.com.au/bidding.feature), then test it with:

$ bin/cucumber-nagios features/ebay.com.au/bidding.feature
Critical: 0, Warning: 0, 4 okay | value=4.000000;;;;
  

Meta

Related

Friends