|
Project Information
Featured
Downloads
Links
|
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 INSTALLThis assumes that you are on a Linux-like system with RubyGems already installed. See CompleteInstallationInstructions if you need more detailed installation help.
sudo gem install opticon 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. |