Xymon Mailing List Archive search

Monitoring "internet"

list Ralph Mitchell
Wed, 5 Aug 2009 11:16:03 -0500
Message-Id: <user-a7ca4b5abbde@xymon.invalid>

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 <user-a9f2fdfdbc44@xymon.invalid> 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: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX

"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 <user-a9f2fdfdbc44@xymon.invalid
<mailto:user-a9f2fdfdbc44@xymon.invalid>> 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...