Way to check server status in code

Posted on 2003-03-18
Medium Priority
Last Modified: 2010-04-06
Is there a way to check the status of a remote server (whether it is running or not) using VBscript or Javascript? I want to make sure that a server is running when the user navaigates to a certain ASP page. If it is not, I plan to redirect.
Question by:kboone
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Accepted Solution

chisholmd earned 80 total points
ID: 8169158
You could use the internet transfer control in your server side script to first make a connection to the target server. It has the response code available (200, 404, etc) Then you can redirect as appropriate.

Set Inet = Server.CreateObject("InetCtls.Inet.1")
Inet.URL = "http://www.someserver.com/"
'Inet.UserName = "MyUserName"
'Inet.Password = "MyPassword"
Inet.AccessType = icDirect
Inet.Protocol = icHTTP
Inet.RemotePort  = 80
Inet.RequestTimeout = 60
strHTMLFile = Inet.OpenURL()
if Inet.ResponseCode <> 200 then
 response.write strHTMLFile
end if

Something like that.


Author Comment

ID: 8174790
Thanks for the info chisholmd!

Expert Comment

ID: 8175085

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question