Hello, I'm doing a problem which test the host in a network. For that I do a ping of the ip which are in a file. But I couldn't find what are the ping commands return. It's return the number of ping succesfull?
In Macintosh there are Network utility programs which have an option to ping addresses. Type the address into one window, and another window tells whether successful or not, and displays a time measurement. I'm not sure which program is available in PC's for doing the same thing, but there probably is a control panel or other free network utility.
- - - Updated - - -
Example inputting 'www.google.com':
Ping has started ...
PING www.google.com (172.217.1.36): 56 data bytes
64 bytes from 172.217.1.36: icmp_seq=0 ttl=55 time=16.068 ms
64 bytes from 172.217.1.36: icmp_seq=1 ttl=55 time=15.881 ms
--- www.google.com ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max/stddev = 15.881/15.975/16.068/0.093 ms
is this the exit code? if so 0 normally means "success" as there is only one way to succeed and non zero means fail with the value being related to why the command failed.
Here you are usung a PC command "ping" ...and i is the response of the PC command (function).
It's very usual that afunction returns "0" when there is no error.
Not sure if the ping command generates a useful return code. You can route the ping response to a file or use an ICMP function of the IP Helper API to get the intended info.
I believe this is what the OP is looking for. I'm guessing 0 = good, 1 = able to transmit ping but no response, and 2+ = it is not clear if a ping was even sent.
I believe this is what the OP is looking for. I'm guessing 0 = good, 1 = able to transmit ping but no response, and 2+ = it is not clear if a ping was even sent.