资 源 简 介
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<