CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site?

Author Message
faulkkev

  • Total Posts : 593
  • Scores: 13
  • Reward points : 0
  • Joined: 11/1/2005
  • Location: Kansas City, MO
  • Status: offline
CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 5:06 AM (permalink)
0
Anyone know of a way to connnect and test if a site is up that is using host headers?  They are behind a load balancer and I can't do a backdoor since there is a header?  I'm thinking there has to be a way?
 
 
Code I usually use for web farms for a site:
 
on error resume next
arraystrcomputer = array("server1","server2")
for each objcomputer in arraystrcomputer
Set objHTTP = CreateObject("MSXML2.XMLHTTP")
strurl = "http://" & objcomputer & "/qa/status/index.html"
objHTTP.Open "GET", strURL, FALSE
objHTTP.Send
  if objHTTP.statusText = "OK" then
    wscript.echo now & " Url Status " & objHTTP.statusText & " For " & strUrl
   else
     wscript.echo now & " Error Connecting to " & strurl
  end if
next
 
#1
    59cobalt

    • Total Posts : 969
    • Scores: 91
    • Reward points : 0
    • Joined: 7/17/2011
    • Status: offline
    Re:CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 5:40 AM (permalink)
    0
    Please describe the problem you're trying to solve instead of what you perceive as the solution.
     
    #2
      faulkkev

      • Total Posts : 593
      • Scores: 13
      • Reward points : 0
      • Joined: 11/1/2005
      • Location: Kansas City, MO
      • Status: offline
      Re:CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 5:54 AM (permalink)
      0
      I am trying to connect to a web url on a specific server instead of using the load balancer.  There are multiple servers responding to the same website and the IIS site uses a host header so connecting by an individual server name or IP does not work.  I am looking for a way to test site up or down to each server even though they use host headers.  The code above works fine on non host headers IIS sites.  Even in IE I can't substitute the server name and get to the site. 
       
      #3
        59cobalt

        • Total Posts : 969
        • Scores: 91
        • Reward points : 0
        • Joined: 7/17/2011
        • Status: offline
        Re:CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 6:14 AM (permalink)
        0
        Unless you can bypass the load-balancer and connect directly to each individual server, I'd say you're out of luck. Load-balancers have the exact purpose of hiding the individual servers from the network.
         
        #4
          faulkkev

          • Total Posts : 593
          • Scores: 13
          • Reward points : 0
          • Joined: 11/1/2005
          • Location: Kansas City, MO
          • Status: offline
          Re:CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 6:28 AM (permalink)
          0
          I would be able to if the IIS sites weren't using host headers that is what is messing me up. 
           
          #5
            TNO

            • Total Posts : 2094
            • Scores: 36
            • Reward points : 0
            • Joined: 12/18/2004
            • Location: Earth
            • Status: offline
            Re:CreateObject("MSXML2.XMLHTTP") to monitor servers using host header for site? Wednesday, January 11, 2012 12:47 PM (permalink)
            0
            Perhaps try to set the header?
            .setRequestHeader "host", header
             
            According to the W3C, this is not editable due to security issues but perhaps WSH/ASP doesn't comply...
            To iterate is human, to recurse divine. -- L. Peter Deutsch
             
            #6

              Online Bookmarks Sharing: Share/Bookmark

              Jump to:

              Current active users

              There are 0 members and 1 guests.

              Icon Legend and Permission

              • New Messages
              • No New Messages
              • Hot Topic w/ New Messages
              • Hot Topic w/o New Messages
              • Locked w/ New Messages
              • Locked w/o New Messages
              • Read Message
              • Post New Thread
              • Reply to message
              • Post New Poll
              • Submit Vote
              • Post reward post
              • Delete my own posts
              • Delete my own threads
              • Rate post

              2000-2012 ASPPlayground.NET Forum Version 3.9