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

Hello,

I am sorry for the offtopic question, but I know a lot of wise monks hang out here so I would really appreciate your advice.

I am looking for a service that will monitor our websites and let me know when the sites are down by SMS. Can anyone recommend a good/cheap and reliable solution?

Thanks, Tom

Replies are listed 'Best First'.
Re: Server Uptime Monitoring
by themage (Friar) on Nov 27, 2006 at 11:14 UTC
    Hi,

    Do you want to outsource this service, or install you own solution?

    I use Nagios sucessfully for a large webfarm. It is easy to configure, flexible and easy to expand when needed, and you can configure it to performe active actions on certain triggers, like restart your apache or mysql on specific high load events.

    Update: Corrected Nagios link.

      I'll third the Nagios suggestion.

      We do SMS alerting from our Nagios server using a rather Heath Robinson setup, that works fine >:o]

      There is a Nokia 7110 mobile phone plugged into the back of the server using a serial cable and then use GNokii to send the SMS messages from Nagios.

      Hope that information is useful to you.

        Too bad you aren't using any of the CPAN solutions for sending SMSes, like Device::Gsm.
        But beware, I am the author of that mess... ;-)

      Thanks I will take a look at that site.

      I guess I was really thinking of an outsourced service that would just send us an SMS. We could then just get a web enabled mobile phone and be able to restart the server whereever we can find a hotspot.

        I've no good experience with an outsourced service monitor, but I heartily second the recommendation of Nagios. I use it to monitor servers both here in the office and at remote locations, and after much configuration and some customization I've got a system that I cannot imagine being without. The only additional cost of adding more machines is that of my time to add it, usually by copying an existing configuration and editing it just a bit. No monthly bump, no repeated conversations trying to get proof that the voice on the other end of the phone is connected to a brain, no waiting for simple changes such as adding another recipient to the notification list.
Re: Server Uptime Monitoring
by zentara (Cardinal) on Nov 27, 2006 at 13:26 UTC
    Rolling your own shouldn't be too hard. You can get uptime various ways, usually thru ssh.
    #!/usr/bin/perl use strict; use warnings; use Net::SSH::Perl; # Net::SSH2 is even easier than this my %hostdata = ( 'localhost' => { user => "z", password => "qumquat", cmdtorun => "ls -la", misc_data => [], }, 'zentara.zentara.net' => { user => "z", password => "aardvark", cmdtorun => "/usr/bin/uptime", misc_data => [], }, ); foreach my $host (keys %hostdata) { my $ssh = Net::SSH::Perl->new($host, port => 22, debug => 1, protocol => 2,1 ); $ssh->login($hostdata{$host}{user},$hostdata{$host}{password} ); my ($out) = $ssh->cmd($hostdata{$host}{cmdtorun}); print "$out\n"; }
    You can search the SearchBox for 'SMS' to find various discussions on using SMS from Perl. And SMS on cpan has alot of modules.

    This snippet was posted awhile back, I can't find the original node now so I post it


    I'm not really a human, but I play one on earth. Cogito ergo sum a bum