On Thu, Jul 23, 2009 at 12:52 PM, Glen Holcomb<> wrote:
> I'm needing to monitor a web application for periodic outages and log the
> duration.
>
> I originally tried this with SafariWatir as the login is javascript so I
> can't use Mechanize. =C2=A0However Watir seems to give up if the page tak=
es
Other than using a monitoring package like Zenoss or Natgios like Kyle said=
?
Sure, you could use the ruby HTTP classes.
http://ruby-doc.org/stdlib/libdoc/ne.../Net/HTTP.html
Read the examples, they will prettymuch show you exactly what you need
to do to get a page. The read more to learn how to set your timeout,
etc.
Put it in a loop, catch the exceptions, toss it in a log file with
stuff like log4r, or just plain old file output.
Enjoy!
--Kyle