[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] Monitoring "internet"
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] Monitoring "internet"
- From: Ralph Mitchell <ralphmitchell (at) gmail.com>
- Date: Wed, 5 Aug 2009 11:16:03 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=5h8nN9fUaAowgAgnwMiwjcqwAexIGrvKDwFdsYaZ67A=; b=ffZ4/CnSNlbiMs0ryyob5y5P917/YkCOyrVHvfYmQivsL3RWtO+j7Bz7oX97m/4LMk QEep8wZiw9dz4NAeRxvxJ4FwGcSKWa9MmkuyTrhHKXR/mS2dKaFNdCzdFLjU/c//7vRN YiMwCbuFJQAzf6g3fLsyxCWLsOvMf/lvI6QAQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=B7GvkjDKZ0c3KdkNeF+v8v+3JTLDFISTthTL8reQzq9mUOrSH+O6hK4vSKT6R3Um54 95B87C+O3owXrXhHXpQy1Ay/JT5yb6sWGPLA4NqBWT7EdhSfPVeqjkOva99BDYk65xEK GIqVLp/p6xYLFOOGCHLFBUGSn7rdav4BGRryg=
- References: <4A7992EA.2070101 (at) rider.edu> <961092e10908050720y4c398a82m9dcdf3c5fb099ea8 (at) mail.gmail.com> <4A799D45.3040901 (at) rider.edu>
This isn't particularly elegant, but something like it should do what you
want:
#!/bin/bash
TESTHOSTS="www.google.com www.yahoo.com www.microsoft.com"
for N in $TESTHOSTS
do
curl -s -S -L -m 10 -o /dev/null http://$N
if [ "$?" -eq "0" ]; then
# page fetched OK
break
fi
# Ran out of hosts, must be all broken
$BB $BBDISP "status internet.web `date`
Cannot reach any common web servers, panic now!!"
exit 0
done
# found at least one working offsite server
$BB $BBDISP "status internet.web `date`
Found at least one working offsite server. The world is still there."
exit 0
Ralph Mitchell
On Wed, Aug 5, 2009 at 9:55 AM, Ricardo Stella <stella (at) rider.edu> wrote:
> Can these be combined as well? Ie do multiple http checks and go red
> only if all fail?
>
> TIA...
>
> Josh Luthman wrote:
> > Might also want to do some HTTP checks. If your router's NAT table
> > has problems, connection limits are hit, etc. Pretty much anything
> > TCP based but doing an HTTP request to Google should satisfy and be easy.
> >
> > Josh Luthman
> > Office: 937-552-2340
> > Direct: 937-552-2343
> > 1100 Wayne St
> > Suite 1337
> > Troy, OH 45373
> >
> > "When you have eliminated the impossible, that which remains, however
> > improbable, must be the truth."
> > --- Sir Arthur Conan Doyle
> >
> >
> > On Wed, Aug 5, 2009 at 10:10 AM, Ricardo Stella <stella (at) rider.edu
> > <mailto:stella (at) rider.edu>> wrote:
> >
> >
> > Hello,
> >
> > We have a request to monitor 'internet' connectivity. (When it comes
> > from higherups...)
> >
> > Just pinging up the line might not be good enough as we've had issues
> > with our providers in the recent past. So I figured ping several
> well
> > known hosts out in the cloud and if all are out, then we have no
> > 'internet'.
> >
> > I came out with the following. Seems to work, but figure I run it
> > thru
> > the list in case someone else has done this already...
> >
> > page internet Internet Connectivity
> > 127.0.0.1 INTERNET # conn=ip1,ip2,ip3,ip4,ip5
> >
> >
> > TIA...
> >
> > To unsubscribe from the hobbit list, send an e-mail to
> > hobbit-unsubscribe (at) hswn.dk <mailto:hobbit-unsubscribe (at) hswn.dk>
> >
> >
> >
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe (at) hswn.dk
>
>
>