Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I will be providing a service to small businesses via web app via mod_perl pages. I would like another machine on the net somewhere else to watch the web server to ensure it is operating.

I am envisioning a "watcher" cron job on the other machine checking in with the web server (via a http call to a perl script via w/arguments, either LWP or WWW::Mechanize) every few minutes.

If the watcher can't get the right response to its request from the server, the watcher emails or pages me and alert.

Similarly, if the server doesn't hear from the watcher for too long, the server sends an alert that the watcher is down.

Couple of questions:

Any recommendations on reliable perl hosting companies? I would need cron, perl, LWP, mechanize, shell access on the watcher. Low bandwidth. Watcher would not serve web pages, just make requests and send email when something goes wrong.

Any suggestions on how to improve this monitoring idea?

Thank you very much

Phillip

Replies are listed 'Best First'.
Re: perl monitoring and hosting
by barrd (Canon) on Nov 05, 2003 at 11:22 UTC
    Hi AM,
    Rather than reinvent the wheel with your "watcher" script/s try out Nagios - formerly known as NetSaint. I believe you'll be suitably impressed.

    As for hosting companies what you are looking for may cost quite a bit - for example one of the hosting companys I use only allows FTP access which is pretty radically useless ;(

    However if you can get a DSL connection you could run your servers from home which is what I do (well, I will once my firewall gets fixed).

      I cant monitor it over DSL from an office box as the office DSL comes from the same ISP as the site being watched. I need an independent place and independent place from which to send email. Otherwise if the ISP fails my watcher fails too. Thanks for the nagios tip -- I will check it out.
Re: perl monitoring and hosting
by valdez (Monsignor) on Nov 05, 2003 at 11:40 UTC

    There is a list of mod_perl friendly ISPs at http://perl.apache.org/help/isps.html; other possible solutions are dedicated servers or virtual servers (User Mode Linux for example).

    Ciao, Valerio

Re: perl monitoring and hosting
by batkins (Chaplain) on Nov 05, 2003 at 11:45 UTC
    merlyn wrote an article about doing this recently in some magazine or other. I don't remember which, but the basic gist was to use Test::More and then use WWW::Mechanize or LWP to check the content. That might be helpful to you. It might have been Linux Journal, if you're interested.

    As far as hosts, I highly recommend Bytemark. They provide all kinds of crazy features, including a watchdog that will send you e-mail or SMS messages if your server goes down or a page can no longer be retrieved. It's fairly customizable, too. The tricky part is that you have to set everything up yourself - Apache, mail, etc. But you get root access to your own server. You should at least check it out. Oh, by the way, if they ask for a referrer, use "milkbone". :D

    Are you sure it was a book? Are you sure it wasn't.....nothing?
      HardHat is another Perl friendly ISP - you get your own instance of Perl so you can install whatever modules you need via ssh. You also get your own instance of Apache(1.3.26) + mod_perl(1.26). Their cheapest plan is $10.63 per month.
      (cron and Postgresql also included)
Re: perl monitoring and hosting
by Jaap (Curate) on Nov 05, 2003 at 10:57 UTC
    There are probably services that already provide this. Search the internet or ask your hosting company.