Detect if internal web site is available

D

DrShevek

Hi,

Apologies if this has been discussed before but I have tried to search
and found nothing really helpful as I am not entirely sure exactly what
to search for..!

Is it possible to detect via ASP.Net if a web site on a remote
(internal) IIS server is available?

Background: We have 4 sites in star layout WAN with site A in the
center and B, C & D on the spurs. For various reasons our Intranet / DB
server (IIS 6 / SQL 2000) is located at spur site B so if the link
between A and B goes down then A, C & D all lose the Intranet.

Our users (being users!) then assume that because the Intranet is down
the whole Internet is down and promptly decide to not do any work at
all... ;-) (This also happens at all 4 sites when we down the Intranet
for maintenance)

It has been requested that we run a local IIS in all 4 sites (We
already have IIS 6 running webmail on Exchange 2003 at all 4 sites)
which will be all users first point of call. This will check if the
Intranet is available and redirect to it and if not display a friendly
warning page with links to our Internet site, Google etc.

TIA for any help you can give.

Regards,

Shevek
 
D

DrShevek

OK, discovered that the google magic word was "scraping" and found
this:

http://aspalliance.com/articleViewer.aspx?aId=237&pId=

I have amended the code slightly to this:


Private Function CheckServer(ByVal Server As String) As String
Try
Dim req As System.Net.HttpWebRequest
Dim res As System.Net.HttpWebResponse
req = req.Create(Server)
res = req.GetResponse()
res.Close()
Return res.ResponseUri.AbsoluteUri = Server
Catch ex As Exception
Return ex.Message
End Try
End Function

but this keeps returning "The remote server returned an error: (401)
Unauthorized."

After a bit of google work I discovered 2 possible fixes (Win2K3
loppback fix which we already have and <httpWebRequest
useUnsafeHeaderParsing="true" /> in machine.config) but neither have
resolved the issue.

Can anyone shed any further light on this...?

Regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top