I have a custom EXT that we use for a test called "web" that does this. It isn't efficient coding, but it is down and dirty and it works. (For Example, I didn't use variables in a lot of places where I should to make it portable, etc.)
It uses 4 components:
WebChk.bat - Run from BBNT client externals (script could be modified for BBWIN)WebChk.lst - Is a list of websites to be checkedWwwget.bat - Is run by WebChk.bat to test each server in WebChk.lstwget.exe - tool that does the actual testing
It produces output on the Hobbit monitor that looks like:
Wed 08/05/2009 11:53:26.39 . [cid:image002.gif at 01CA15C4.2CBB0DB0] Wed 08/05/2009 11:53:25.34 . --11:53:25-- http://www.google.com:80/ => `index.html' Connecting to www.google.com:80... connected! HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html]
0K -> ....
11:53:25 (4.73 MB/s) - `index.html' saved [4957]
. . [cid:image002.gif at 01CA15C4.2CBB0DB0] Wed 08/05/2009 11:53:25.85 . --11:53:25-- http://www.heritage-healthcare.com:80/ => `index.html.1' Connecting to www.heritage-healthcare.com:80... connected! HTTP request sent, awaiting response... 200 OK Length: 4,142 [text/html]
0K -> .... [100%]
11:53:26 (3.95 MB/s) - `index.html.1' saved [4142/4142]
. . [cid:image002.gif at 01CA15C4.2CBB0DB0] Wed 08/05/2009 11:53:26.39 . --11:53:26-- http://www.yahoo.com:80/ => `index.html.2' Connecting to www.yahoo.com:80... connected! HTTP request sent, awaiting response... 200 OK Length: 9,490 [text/html]
0K -> ......... [100%]
11:53:26 (9.05 MB/s) - `index.html.2' saved [9490/9490]
.
There is a WebChk.bat that has:
REM Cleanup md c:\webtemp c: cd \webtemp Del "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-lastrun.txt" del "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Results" del "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" del "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad"
REM Run Tests for /F %%i in (d:\scripts\ext\WebChk.lst) do call "d:\scripts\ext\wwwget.bat" %%i
REM Merge if exist "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad" goto bad
:good echo green %date% %time% > "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\logs\web" type "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-lastrun.txt" >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\logs\web" goto end
:bad type "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad" >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\logs\web" type "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-lastrun.txt" >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\logs\web"
:end del c:\webtemp\*.* /q
There is a wwwget.bat that has:
REM Run wget > WebChk-Results
d:\scripts\ext\wget %1 -o "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Results" echo . >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Results"
REM Check errorlevel for WebChk-Status if errorlevel 1 goto bad
:good echo GOOD echo . > "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" echo ^&green %date% %time% >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" echo . >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" goto merge
:bad if exist "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad" goto bigbad echo ^&yellow %date% %time% > "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad" goto wolf
:bigbad echo red %date% %time% > "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Bad"
:wolf set errorlevel 0 echo . > "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" echo ^&yellow %date% %time% >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" echo . >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status"
REM Merge WebChk-Status and WebChk-Results into WebChk-lastrun.txt :merge type "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Status" >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-lastrun.txt" type "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-Results" >> "C:\Program Files\Quest Software\Big Brother BTF\BBNT\1.08d\tmp\WebChk-lastrun.txt"
The WebChk.lst looks like:
www.google.com www.mydomain.com www.yahoo.com
The wget.exe was downloaded online and a version is available at http://users.ugent.be/~bpuype/wget/
If you would like, I could provide a ZIP of all components. I hadn't shared it yet because I know that it is dirty and would be hard to port since I had not used variables for the paths.
Harold Ballinger IT Manager Heritage Healthcare, Inc. (888) 335-2620 | helpdesk (864) 224-3626 | office (864) 224-3093 | fax
[cid:image001.jpg at 01CA15C3.06609780]
Visit our website: www.heritage-healthcare.com<http://www.heritage-healthcare.com/>
From: Josh Luthman [mailto:josh at imaginenetworksllc.com] Sent: Wednesday, August 05, 2009 10:21 AM To: hobbit at hswn.dk Subject: Re: [hobbit] Monitoring "internet"
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>