IIS ASP - Ping server

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > March 2006 > Ping server





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Ping server
shaid@tti-telecom.com

2006-03-19, 12:02 pm

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

Evertjan.

2006-03-19, 12:02 pm

Xref: TK2MSFTNGP08.phx.gbl microsoft.public.inetserver.asp.general:303390

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)
shaid@tti-telecom.com

2006-03-19, 12:02 pm

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

Evertjan.

2006-03-19, 12:02 pm

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

> wrote on 19 mrt 2006 in microsoft.public.inetserver.asp.general:
>
>
>
>
> <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)
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com