Ping server

S

shaid

Hi all,

I want to ping or try to check the avability of a local server. Is
there any way to do it directly from an ASP page just by pressing a
buttun? I just want to do the "ping" command direcdry from an ASP page!

Thanks,

Shai
 
S

shaid

wrote on 19 mrt 2006 in microsoft.public.inetserver.asp.general:

I want to ping or try to check the avability of a local server. Is
there any way to do it directly from an ASP page just by pressing a
buttun? I just want to do the "ping" command direcdry from an ASP page!


<http://www.4guysfromrolla.com/webtech/102998-1.shtml>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Evertjan,

Thanks from your quick replay but it still doesn't work. my doping.bat
file:
ping -a %1 > D:\ccadmin\wwwroot\IT\servers%2.txt
My asp file:
<%

Set FileSys = Server.CreateObject("Scripting.FileSystemObject")
FileName = FileSys.GetTempName

Set WShShell = Server.CreateObject("WScript.Shell")

IP = "w2k-ccadmin" ' or whatever you want to ping
RetCode = WShShell.Run("D:\ccadmin\wwwroot\IT\servers\DoPing.bat " & IP
& " " & FileName, 1, True)

if RetCode = 0 Then

'There were no errors

else

Response.Redirect "PingErrors.htm"

end if


Set TextFile = FileSys.OpenTextFile("D:\ccadmin\wwwroot\IT\servers\" &
FileName & ".txt", 1)
TextBuffer = TextFile.ReadAll

For i = 1 to Len(TextBuffer)

If Mid(TextBuffer,i,1) = chr(13) Then

Response.Write("<BR>")

else

Response.Write(Mid(TextBuffer,i,1))

end if

Next

TextFile.Close

FileSys.DeleteFile "D:\ccadmin\wwwroot\IT\servers\" & FileName & ".txt"

%>

"D:\ccadmin\wwwroot\IT\servers\" is the location of the files at the
server i'm working with. I've also checked and the object "RetCode"
equels 1- the reason i'm reaching "PingErrors.htm" each time i'm trying
to activate the asp file .

Thanks,

Shai
 
E

Evertjan.

wrote on 19 mrt 2006 in microsoft.public.inetserver.asp.general:
wrote on 19 mrt 2006 in microsoft.public.inetserver.asp.general:



Thanks from your quick replay but it still doesn't work.

Not my piece of cake.

Usually it is a folder rights problem, like write access or run access.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top