Page 1 of 1 1
Topic Options
#73195 - 2003-02-18 04:55 PM Determine if servers are present
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
I wonderring where if any would a simple script be to do a simple ping and tell if the computer can see that system.

For exmaple:
ping 1.1.100.229

If ping results in a false display unable to connect to the ip.

or results in a you are connected to the ip.
_________________________
www.microcyb.com

Top
#73196 - 2003-02-18 06:04 PM Re: Determine if servers are present
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
o.k. I cannot seems to find a single script that does this in the UDF library.
_________________________
www.microcyb.com

Top
#73197 - 2003-02-18 06:07 PM Re: Determine if servers are present
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
When I search the UDFs, I find at least three with the word "ping".

http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000012
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000247
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=12;t=000219
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#73198 - 2003-02-19 08:41 PM Re: Determine if servers are present
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
Thank you LLigetfa.
I knew you would be the man who can answer all.
_________________________
www.microcyb.com

Top
#73199 - 2003-02-19 09:00 PM Re: Determine if servers are present
Microcyb Offline
Getting the hang of it

Registered: 2002-12-30
Posts: 95
Loc: Hell
This one was perfect!! Waltz did a great job.
;Function Revping()
;
;Author Waltz
;
;Contributors jpols - Jochen Polster (jochen.polster@gmx.net)
; http://81.17.37.55/board/ultimatebb.php?ubb=get_topic;f=12;t=000012#000000
;
;Action Reverse ping an IP Address to resolve a Host Name
;
;Syntax REVPING("IPADDRESS")
;
;Version 2.0
;
;Parameters ipaddress
; - must be in the format "###.###.###.###"
; - do NOT pad ### with leading 0's (zero's)
;
;Remarks - cribbed from jpols Ping()
;
;Returns - if resolved, the Host Name associated with the IP Address
; - if resolved, sets @ERROR exit code to 0
; - if not resolved, "UNRESOLVED"
; - if not resolved, sets @ERROR exit code to 1
;
;Dependencies None
;
;KiXtart Ver 4.10a
;
;Examples
; $hostname = REVPING("81.17.37.55")
;
; $ipnum = "1.2.3.4"
; $hostname = REVPING($ipnum)
;
FUNCTION REVPING($ipnum)
DIM $nameip, $tempfile
$tempfile = "%temp%\nameip.txt"
SHELL '%Comspec% /Q /E:1024 /C FOR /F "TOKENS=2* DELIMS= " %%i IN ('+ CHR(39)
+ '"PING -a -n 1 $ipnum | FIND "]""' + CHR(39) + ') DO ECHO %%i >' + $tempfile
IF OPEN(10,$tempfile,2) = 0 $nameip = READLINE(10) ELSE $nameip = "" ENDIF
IF CLOSE(10) = 0 DEL $tempfile ENDIF
IF $nameip <> "" $revping = TRIM($nameip) EXIT (0) ELSE $revping = "UNRESOLVED" EXIT (1) ENDIF
ENDFUNCTION
_________________________
www.microcyb.com

Top
#73200 - 2003-02-19 10:51 PM Re: Determine if servers are present
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ummm .... sorry to bug in that hard but revping() is an adaption of ping() that was enhanced to get the machine names back from a ping ... so ping() would be it unless you play pong [Big Grin]

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
0 registered and 696 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.055 seconds in which 0.026 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