471,066 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Ping server

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

Mar 19 '06 #1
3 4083
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)
Mar 19 '06 #2
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\server s\" &
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

Mar 19 '06 #3
wrote on 19 mrt 2006 in microsoft.public.inetserver.asp.general:
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>

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.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 19 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Alexandre Plennevaux | last post: by
reply views Thread by Sleiman | last post: by
4 posts views Thread by Tim Marshall | last post: by
2 posts views Thread by David Lozzi | last post: by
3 posts views Thread by Jason Rodman | last post: by
14 posts views Thread by Egil Hansen | last post: by
13 posts views Thread by Adam | last post: by
2 posts views Thread by Devin | last post: by
1 post views Thread by John | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.