Detect if internal web site is available

Discussion in 'ASP .Net' started by DrShevek@gmail.com, Apr 4, 2006.

  1. Guest

    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
     
    , Apr 4, 2006
    #1
    1. Advertising

  2. Guest

    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
     
    , Apr 4, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Natty Gur
    Replies:
    0
    Views:
    2,584
    Natty Gur
    Jun 6, 2004
  2. =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Replies:
    0
    Views:
    2,396
    =?Utf-8?B?VHJldm9yIEJlbmVkaWN0IFI=?=
    Jun 7, 2004
  3. Joe Sorensen
    Replies:
    3
    Views:
    814
    Joe Sorensen
    Mar 18, 2009
  4. John
    Replies:
    3
    Views:
    148
    Aaron Bertrand - MVP
    May 18, 2004
  5. Srismiles
    Replies:
    6
    Views:
    1,248
    Dooza
    Jul 19, 2010
Loading...

Share This Page