Page 1 of 1 1
Topic Options
#51217 - 2000-08-29 07:59 PM Ping Server to see it its up!
Anonymous
Unregistered


Anybody know how I would go about pinging a server and then if its up map a drive on it, and if not then skip the mapping? I can get the if else stuff but I don't know how to get the ping reply into the script?
Top
#51218 - 2000-08-29 10:55 PM Re: Ping Server to see it its up!
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I have never tried this but shelling out to

ping ip > file.txt

might work. Then read the file. There are a number of DOS utilities you could use to parse this file or search it but a full kix version might also be possible.

But might not it be more direct to just attch then test if the attach was successful.

[This message has been edited by JackLothian (edited 29 August 2000).]

_________________________
Jack

Top
#51219 - 2000-08-30 06:18 PM Re: Ping Server to see it its up!
Anonymous
Unregistered


Well the bigest issue is time, I don't want to wait for 30sec while I try and connect to the server?
Top
#51220 - 2000-08-30 06:47 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
McChan,

i have the stuff together to do this ,
the only question is Your Environment , means
after what timeout do You decide a server to
be down ?
Please answer this and i'll 'toolbox' an example ... [if i can take the time ]

Jochen

P.S. : Do You have to loop Servers from an input file ?

[This message has been edited by jpols (edited 30 August 2000).]

_________________________



Top
#51221 - 2000-08-30 07:27 PM Re: Ping Server to see it its up!
Anonymous
Unregistered


Well I want the timeout to be short like 5 seconds, I can't have the users wait for 30seconds while the login script tries to map a drive! I am not sure what you mean about the loop thing??
Top
#51222 - 2000-08-30 08:12 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Mac,
10-4
seems to be only one Server ... ok !
will do it till tommorrow... [it's late here in middle-Europe]
StandBy

Jochen

_________________________



Top
#51223 - 2000-08-30 09:34 PM Re: Ping Server to see it its up!
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
"OUCH. I should not have touched."

Yo Jochen, got your e-mail

[This message has been edited by BoxKite (edited 30 August 2000).]

_________________________
Box
FACTA NON VERBA

Top
#51224 - 2000-08-30 10:32 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
10-4 James,
Mac,
here we go [posted this @home .. very rare]
this fits NT (9x isn't supported by me but should run too )
code:

BREAK ON
$timeout = 5000 ;in milliseconds
$Server = "ServerName"
$Share = "ShareName"

SHELL "%Comspec% /e:1024 /C ping " + $Server + " -n 1 -w " + $timeout + " | find /C " + CHR(34) + "TTL=" + CHR(34) +" > nul"
IF @error = 0
;USE K: '\\$Server\$Share' OR
USE K: "\\" + $Server + "\" + $Share
IF @error = 0
;do nothing
ELSE
? "Error - [" + @ERROR + "]" + " - " + @SERROR
ENDIF
ELSE
?"no reply from " + $Server
ENDIF
USE List ; for test purposes
get $x
Exit


for the loop[inputfile] thought you need it for administrative scripts or something ...

Please share yer experiences with us

Bye
Jochen

b.t.w.: Carpe Diem !

_________________________



Top
#51225 - 2000-08-31 06:06 PM Re: Ping Server to see it its up!
Anonymous
Unregistered


That worked great on both NT/2000 and 98. Thanks I have been working on this for days!
Top
#51226 - 2000-08-31 06:27 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Mac,
All in a Days work for 'Bicycle-Repair-Man'!!!

Glad i could help !

Jochen

_________________________



Top
#51227 - 2000-08-31 07:36 PM Re: Ping Server to see it its up!
BoxKite Offline
Da Box
*****

Registered: 2000-05-17
Posts: 282
Loc: Vacaville,CA,USA
I thought you were "LAWNMOWER MAN" (a.k.a. movie same name)

_________________________
Box
FACTA NON VERBA

Top
#51228 - 2000-08-31 07:46 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Box,

yap, i would have choose this one if i only saw the film before reading the Short Story
[S.King] ...
but BICYCLE-REPAIR-MAN is the more the nice
guy (a.k.a. : episode #(can't remember) of Monty Pythons Flying Circus)

J.

_________________________



Top
#51229 - 2000-09-05 04:44 PM Re: Ping Server to see it its up!
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
see my server status script.
http://kixtart.org/board/Forum2/HTML/000702.html

Bryce

Top
#51230 - 2000-09-18 06:50 PM Re: Ping Server to see it its up!
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
or http://kixtart.org/board/Forum1/HTML/000976.html
Post #7 the 2nd batch !
Hey i'm Back and alive ! missed y'all so much
Bryce? hope you didn't catched that flu up there in Washington ?!??

J.

_________________________



Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.075 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org