Monitoring web application behaviour with cucumber-nagios

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

1 comments

Comments 1 - 1 of 1 previous next Post a comment

Post a comment
Embed Video
Edit your comment Cancel

1 Favorite

Monitoring web application behaviour with cucumber-nagios - Presentation Transcript

  1. Monitoring web application behaviour with cucumber-nagios Lindsay Holmwood <lindsay@holmwood.id.au>
  2. http://flickr.com/photos/therefromhere/510612621/
  3. # 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 \"http://www.google.com\" And I fill in \"q\" with \"wikipedia\" And I press \"Google Search\" Then I should see \"www.wikipedia.org\"
  4. --format pretty
  5. $ bin/cucumber --require bin/common.rb \\ --require features/ \\ features/google.com.au/search.feature --format pretty
  6. $ 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 \"http://www.google.com\" And I fill in \"q\" with \"wikipedia\" And I press \"Google Search\" Then I should see \"www.wikipedia.org\" 1 scenario 4 steps passed --format pretty
  7. cucumber
  8. cucumber webrat
  9. cucumber webrat mechanize
  10. cucumber webrat mechanize nagios =>
  11. cucumber-nagios
  12. $ bin/cucumber-nagios features/google.com.au/search.feature Critical: 0, Warning: 0, 4 okay | passed=4, failed=0, total=4 cucumber-nagios
  13. how it works http://flickr.com/photos/sunbeer/931205335/
  14. $ bin/cucumber-nagios \\ features/google.com.au/search.feature
  15. $ 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
  16. $ 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
  17. 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 = \"\" message += \"Critical: #{@failed.size}, \" message += \"Warning: 0, \" message += \"#{@passed.size} okay\" message += \" | passed=#{@passed.size))}\" message += \", failed=#{@failed.size))}, total=#{@total}\"\" puts message end end end
  18. #!/bin/sh dirname=$(dirname $0) feature=$1 $dirname/cucumber --require $dirname/common.rb \\ --require features/ \\ --format Nagios::NagiosFormatter \\ $feature retval=$? if [ \"$retval\" -eq \"1\" ]; then exit 2 else exit $retval fi
  19. #!/bin/sh dirname=$(dirname $0) feature=$1 $dirname/cucumber --require $dirname/common.rb \\ --require features/ \\ --format Nagios::NagiosFormatter \\ $feature retval=$? if [ \"$retval\" -eq \"1\" ]; then exit 2 0 good else exit $retval 1 bad fi 2 ugly
  20. http://flickr.com/photos/chrisindarwin/3082606450/
  21. Setting up
  22. $ gem sources -a http://gems.github.com/
  23. $ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios
  24. $ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com
  25. $ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh!
  26. $ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh! $ cd mysite.com
  27. $ gem sources -a http://gems.github.com/ # gem install auxesis-cucumber-nagios $ cucumber-nagios-gen project mysite.com woosh! $ cd mysite.com $ rake deps
  28. $ 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!
  29. $ bin/cucumber-nagios-gen feature search
  30. $ bin/cucumber-nagios-gen feature search $ bin/cucumber-nagios features/search.feature
  31. Quirks
  32. Failure *IS* an option
  33. begin # foo rescue # bar end
  34. Multiple Scenarios per File
  35. Critical: 1, Warning: 0, 2 okay | passed=2, failed=1, total=3 Critical: 1, Warning: 0, 4 okay | passed=4, failed=1, total=5
  36. Instead of writing boring monitoring plugins from scratch, you can now do behavior driven ops!
  37. 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)
  38. developers sysadmins http://flickr.com/photos/jshappell/1313699764/
  39. building bridges http://flickr.com/photos/douaireg/2313764485/
  40. http://github.com/auxesis/ cucumber-nagios http://dryicons.com/free-icons/preview/coquette-part-3-icons-set/

+ Lindsay HolmwoodLindsay Holmwood, 8 months ago

custom

1420 views, 1 favs, 0 embeds more stats

Setting up monitoring for web applications can be c more

More info about this document

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Go to text version

  • Total Views 1420
    • 1420 on SlideShare
    • 0 from embeds
  • Comments 1
  • Favorites 1
  • Downloads 39
Most viewed embeds

more

All embeds

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories