-
1
- Moderator
- #1
I'd like to take credit for writing this, but I didn't... I just modified it to work on our web system.
Since we have several servers and remote sites, I incorporated this into our main web page for a simple "is the server up?" script.
Just my 2¢
"In order to start solving a problem, one must first identify its owner." --Me
--Greg
Since we have several servers and remote sites, I incorporated this into our main web page for a simple "is the server up?" script.
Code:
<% Response Buffer=True %>
<%
url = "1.2.3.4" ' IP Address of server.. .use the IP 'cause it's faster
Set objWShell = CreateObject("WScript.Shell")
Set objCmd = objWShell.Exec("ping -n 1 " & url)
strPResult = objCmd.StdOut.Readall()
set objCmd = nothing : Set objWShell = nothing
strStatus = "<font color=red>Offline!</font>"
if InStr(strPResult,"TTL=")>0 Then strStatus = "<font color=green>Online</font>"
response.Write "ServerName is " & strStatus
%>
Just my 2¢
"In order to start solving a problem, one must first identify its owner." --Me
--Greg