My favorites | Sign in
Project Logo
                
Show all Featured downloads:
opticon-0.0.4.gem
People details
Project owners:
  matt.zukowski

Opticon is a no-nonsense utility for monitoring HTTP-based services (i.e. websites).

When triggered, Opticon connects to a list of URIs and checks to make sure that they pass some arbitrary test, such as responding with a non-error HTTP response code, or returning content that matches a regular expression. In case of failure, Opticon generates emails that can be forwarded to your mailbox, blackberry, cellphone, etc.

To illustrate how Opticon works, here's a very simple test you might write:

"http://www.yahoo.com/".test do
  # check that the HTTP response code is in the 200 range
  test(:responds_with_code, :success)
  # check that the page includes the string "Privacy Policy"
  test(:response_body_contains, "Privacy Policy") 
end

An example of a full-fledged Opticon script (including an example showing how to set up an email notifier) can be found here: http://opticon.googlecode.com/svn/trunk/examples/sample.rb

QUICK INSTALL

This assumes that you are on a Linux-like system with RubyGems already installed. See CompleteInstallationInstructions if you need more detailed installation help.

  1. Install the gem:
  2. sudo gem install opticon
  3. To use opticon, you need a simple ruby script that configures it and runs your tests. Download the sample script from http://opticon.googlecode.com/svn/trunk/examples/sample.rb
  4. Rename this script file to something more meaningful (like my_intranet_tests.rb), put it in some directory where you can find it (like your home directory), and add a crontab entry to run this script every 15 minutes:
    1. Type crontab -e (this works for Linux, on Windows you'll have to set up a Scheduled Task)
    2. Add the following crontab entry:
    3. 0,15,30,45 * * * * ruby /home/johnny/my_intranet_tests.rb

You're done!

Provided that you configured everything correctly (see ConfiguringOpticon), you should now have monitoring set up. Note that you can have as many different test scripts as you want. Just make a copy of the original file to create a new one. You can also just keep your tests all in one big script file. It's up to you. Of course it is also possible to incorporate opticon into other applications, such as a Ruby on Rails controller giving a web-front end to the monitoring system.









Hosted by Google Code