Monitoring web application behaviour with cucumber-nagios

0 %
100 %
Information about Monitoring web application behaviour with cucumber-nagios
Technology

Published on March 20, 2009

Author: auxesis

Source: slideshare.net

Description

Setting up monitoring for web applications can be complicated - tests tend to lack expressiveness, or and quite often they don't even test the right problem in the first place.

cucumber-nagios lets a sysadmin write behavioural tests for their web apps in plain English, and outputs the test results in the Nagios plugin format, allowing a sysadmin to be notified by Nagios when their production apps aren't behaving.

Monitoring web application behaviour with cucumber-nagios Lindsay Holmwood <lindsay@holmwood.id.au>

http://flickr.com/photos/therefromhere/510612621/

# features/google.com.au/search.feature Feature: google.com.au It should be up And I should be able to search for things Scenario: Searching for things When I visit quot;http://www.google.comquot; And I fill in quot;qquot; with quot;wikipediaquot; And I press quot;Google Searchquot; Then I should see quot;www.wikipedia.orgquot;

--format pretty

$ bin/cucumber --require bin/common.rb --require features/ features/google.com.au/search.feature --format pretty

$ bin/cucumber --require bin/common.rb --require features/ features/google.com.au/search.feature Feature: google.com.au It should be up And I should be able to search for things Scenario: Searching for things When I visit quot;http://www.google.comquot; And I fill in quot;qquot; with quot;wikipediaquot; And I press quot;Google Searchquot; Then I should see quot;www.wikipedia.orgquot; 1 scenario 4 steps passed --format pretty

cucumber

cucumber webrat

cucumber webrat mechanize

cucumber webrat mechanize nagios =>

cucumber-nagios

$ bin/cucumber-nagios features/google.com.au/search.feature Critical: 0, Warning: 0, 4 okay | passed=4, failed=0, total=4 cucumber-nagios

how it works http://flickr.com/photos/sunbeer/931205335/

$ bin/cucumber-nagios features/google.com.au/search.feature

$ bin/cucumber-nagios features/google.com.au/search.feature $ bin/cucumber --require bin/common.rb --require features/ --format Nagios::NagiosFormatter features/google.com.au/search.feature

$ bin/cucumber-nagios features/google.com.au/search.feature $ bin/cucumber --require bin/common.rb --require features/ --format Nagios::NagiosFormatter features/google.com.au/search.feature

module Nagios class NagiosFormatter def initialize(*args) @failed = []; @passed = [] end def step_passed(step, name, params) @passed << step end def step_failed(step, name, params) @failed << step end def scenario_executed(scenario) @total = @failed.size + @passed.size message = quot;quot; message += quot;Critical: #{@failed.size}, quot; message += quot;Warning: 0, quot; message += quot;#{@passed.size} okayquot; message += quot; | passed=#{@passed.size))}quot; message += quot;, failed=#{@failed.size))}, total=#{@total}quot;quot; puts message end end end

#!/bin/sh dirname=$(dirname $0) feature=$1 $dirname/cucumber --require $dirname/common.rb --require features/ --format Nagios::NagiosFormatter $feature retval=$? if [ quot;$retvalquot; -eq quot;1quot; ]; then exit 2 else exit $retval fi

#!/bin/sh dirname=$(dirname $0) feature=$1 $dirname/cucumber --require $dirname/common.rb --require features/ --format Nagios::NagiosFormatter $feature retval=$? if [ quot;$retvalquot; -eq quot;1quot; ]; then exit 2 0 good else exit $retval 1 bad fi 2 ugly

http://flickr.com/photos/chrisindarwin/3082606450/

Setting up

$ gem sources -a http://gems.github.com/

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh!

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh! $ cd mysite.com

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh! $ cd mysite.com $ rake deps

$ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh! $ cd mysite.com $ rake deps brr!

$ bin/cucumber-nagios-gen feature search

$ bin/cucumber-nagios-gen feature search $ bin/cucumber-nagios features/search.feature

Quirks

Failure *IS* an option

begin # foo rescue # bar end

Multiple Scenarios per File

Critical: 1, Warning: 0, 2 okay | passed=2, failed=1, total=3 Critical: 1, Warning: 0, 4 okay | passed=4, failed=1, total=5

Instead of writing boring monitoring plugins from scratch, you can now do behavior driven ops!

Instead of writing boring monitoring plugins from scratch, you can now do behavior driven ops! Transform from a grumpy, misanthropic sysadmin to a hipster, agile developer instantly. — Bradley Taylor (http://bit.ly/lWWfE)

developers sysadmins http://flickr.com/photos/jshappell/1313699764/

building bridges http://flickr.com/photos/douaireg/2313764485/

http://github.com/auxesis/ cucumber-nagios http://dryicons.com/free-icons/preview/coquette-part-3-icons-set/

Add a comment

Related presentations

Related pages

Monitoring Web Apps with Cucumber | YMC

... how to monitor web applications: ... monitoring; It takes the result of a cucumber test ... monitoring server and add the cucumber-nagios ...
Read more

auxesis/cucumber-nagios · GitHub

cucumber-nagios - Systems testing ... for Nagios with Cucumber + Webrat + Mechanize + Net ... you to write high-level behavioural tests of web application, ...
Read more

Nagios | YMC

... thinking about how to monitor web applications: ... to your monitoring server and add the cucumber-nagios command ... expected behaviour and NO ...
Read more

Web Application Monitoring Software - Nagios - The ...

Web Application Monitoring Software With Nagios Capabilities. Nagios provides complete monitoring of websites, web applications, web transactions, ...
Read more

pnasrat/cucumber-nagios · GitHub

cucumber-nagios - Web app ... pnasrat / cucumber-nagios ... cucumber-nagios allows you to write high-level behavioural tests of web application, ...
Read more

Web app integration testing for sysadmins with cucumber-nagios

Web app integration ... Nagios is the industry standard for system/network/application monitoring. ... cucumber-nagios takes the results of a Cucumber ...
Read more

Application Monitoring With Nagios - Nagios - The Industry ...

Application Monitoring With Nagios Capabilities Nagios provides complete monitoring of ... Linux applications, UNIX applications, and Web ...
Read more

Devopsdays Day 1 (part two) - Intelligent Monitoring ...

... or Ruby-based web development, ... Cucumber. Behaviour driven design ... so next we create a monitoring project: $ cucumber-nagios-gen project atalanta ...
Read more