Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Server Status

Status
Not open for further replies.

mikecx

Technical User
Jul 9, 2002
215
US
Anyone help me think of a way to get wether s server is working or not for multiple servers? I can get
'
'Response.Status = "200 OK'" then
'Response.Write the picture i plan on using
'End If
'
But I can't do that for a remote server. Any ideas?
 
If you use xmlhttp you can attempt to load a page from a remote server, part of the header that cvomes back is the status, so what you can do is check for the status = 200 like you are above. Do a search in this forum on xmlhttp, you should get quite a few hits, including some examples of exactly what your trying to do.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Excuse my ignorancce, but I did a search and didn't come up with any relevant examples.
 
did you check the radio button "Keyword Search" ---------------------------------------
{ str = "sleep is good for you. sleep gives you the energy you need to function";
ptr = /sleep/gi;Nstr = str.replace(ptr,"coffee");alert(Nstr); }
---------------------------------------
for the best results to your questions: FAQ333-2924

 
Yea, i found the reuslts for it. They kinda dealt with it but none enough for me to figure out which code i need to use.
 
I'm going to post my huge code snippet. If I only use the top it works, if i use # 2 or #3 it times out after a few minutes. Help :(

<%
'Response.Expires = 0
'Set xmlHttp = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
' You can use a IP address here too
'xmlHttp.open &quot;GET&quot;, &quot; false
'xmlHttp.send()
'If(xmlHttp.status=200) then
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 2&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/live2.gif>&quot;
'Else
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 2&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/dead2.gif>&quot;
'End If
'GetCode = xmlHttp.ResponseText
'Set xmlHttp = Nothing
%>
<%
'Response.Expires = 1
Set xmlHttp = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
'You can use a IP address here too
'xmlHttp.open &quot;GET&quot;, &quot; false
'xmlHttp.send()
'If(xmlHttp.status=200) then
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 1&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/live2.gif>&quot;
'Else
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 1&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/dead2.gif>&quot;
'End If
'GetCode = xmlHttp.ResponseText
'Set xmlHttp = Nothing
%>
<%
'Response.Expires = 1
'Set xmlHttp = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
'You can use a IP address here too
'xmlHttp.open &quot;GET&quot;, &quot; false
'xmlHttp.send()
'If(xmlHttp.status=200) then
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 3&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/live2.gif>&quot;
'Else
'Response.Write &quot;<font size=4>&quot; & &quot;DesignPeak Webserver 3&quot; & &quot;        &quot; & &quot;<IMG SRC=../images/dead2.gif>&quot;
'End If
'GetCode = xmlHttp.ResponseText
'Set xmlHttp = Nothing
'%>
 
Here is an example with 2 servers:
thread333-362942

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
It's still timing out after following that example
 
Correction, it only times out if i use a name instead of an ip.
 
Sorry to have to keep this alive but I found out 2 things. First, it doesn't seem to do any name resolving so I have to use ips. second, since the webservers run on ports besides poprt 80 it's useless. :(
 
Ok, first, if the names arebn't resolving this is an issue with the way IIS is connecting to your DNS server. The script works fine for me. Second, to use another post can't you just do this as the URL:

Where yyyy is the port number.

Run a command prompt and do an ipconfig/all. make sure it is setting your DNS server correctly. It's od that this would have problems resolving names, but I assume your browser hasn't had this issue.

-Tarwn ________________________________________________________________________________
Want to get great answers to your Tek-Tips questions? Have a look at faq333-2924
 
Would it matter that the second host is outside my network and that I dont have a DNS server? All my settings are controlled by the SOHO router. Since i cannot just put what can I use? Browser works just fine :) Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top