From: Damphyr Date: 2005-11-21T20:20:11+09:00 Subject: Re: url-monitoring script question Torsten Schmidt wrote: > Thanks for the input so far. > > another possible solution come to my (ruby-beginner) mind instead of > writing the status-code to a seperate file and parse it: > > some kind of deamon-process: what about to put something like 'sleep > 300' in the script to make an indefinetly loop. so it's easier to > store the exit-code of the http-requests and compare them. > > with this it would be possible to send 5 error-emails (25 min) and > after that, send another email when the url 'recovers'. > > What are your opinions for that solution? What you can also do is hold the state in a simple class: class SiteState def initialize @errors=Array.new @notified=false ... end ... end and just use Marshal to dump the class in a file between calls to the script. It's the easiest way to persist information and you don't need to come up with a file structure and parse code (even if it is trivial) Cheers, V.- -- http://www.braveworld.net/riva ____________________________________________________________________ http://www.freemail.gr - ������ �������� ������������ ������������. http://www.freemail.gr - free email service for the Greek-speaking.