 |
 |
pinging in terminal / how to?
|
 |
|
 |
|
Junior Member
Join Date: Jan 2002
Location: Geelong Australia
Status:
Offline
|
|
I have this command
/sbin/ping -nqc 1 "192.168.0.5" | sed -n 's|.*/\(.*\) .*|\1|p'
where the 192.168.0.5 part corresponds to an address on my network.
If the ip address is valid, the above returns a time in ms of the ping.....
if not it times out and returns 0 after 10 - 20 sec....
my question is can I speed up this timeout?
I want it to time out after abour 1 second.....
is this possible?
Thanks in advance
James
|
|
Windows: Been There Done That , Why go Back?
MAC
|
| |
|
|
|
 |
|
 |
|
Clinically Insane
Join Date: Apr 2000
Status:
Offline
|
|
IIRC, -w is maxwait... defaulted to 10... change that?
man ping
I can't remember, and I'm in OS9 right now.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Jan 2002
Location: Geelong Australia
Status:
Offline
|
|
Thanks Cipher,
No luck though...
I am not to familiar with the terminal...
Would you be able to help me next time your in X?
Thanks heaps
James
|
|
Windows: Been There Done That , Why go Back?
MAC
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
Originally posted by James Mullins:
I have this command
/sbin/ping -nqc 1 "192.168.0.5" | sed -n 's|.*/\(.*\) .*|\1|p'
where the 192.168.0.5 part corresponds to an address on my network.
If the ip address is valid, the above returns a time in ms of the ping.....
if not it times out and returns 0 after 10 - 20 sec....
my question is can I speed up this timeout?
I want it to time out after abour 1 second.....
is this possible?
To ping with a timeout of one second, sending a single ping:
ping -i 1 -c 1 192.168.0.5
man ping for more details:
Code:
-c count
Stop after sending (and receiving) count ECHO_RESPONSE packets.
-i wait
Wait wait seconds between sending each packet. The default is to
wait for one second between each packet. This option is incom-
patible with the -f option.
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Jan 2002
Location: Geelong Australia
Status:
Offline
|
|
Thanks for the reply gator,
but this command does not work if the ip address is not valid.
I want to time out if there is no computer at that ip address rather than waiting the full 10 sec (default timeout)
Cheers James
Any other ideas?
Greatly appreciated
|
|
Windows: Been There Done That , Why go Back?
MAC
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by Cipher13:
IIRC, -w is maxwait... defaulted to 10... change that?
yes and no...
-w is the correct switch, and is listed in the man page *but* the ping binary that ships with macosx doesn't support it...
|
|
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status:
Offline
|
|
fink has two alternatives to the OS X-provided ping binary. You may want to try one of those to accomplish you aims:
Code:
fping 2.4b2-1 Pings a number of hosts at one time
mtr 0.44-1 Combines 'traceroute' and 'ping' functionality
|
|
|
| |
|
|
|
 |
|
 |
|
Junior Member
Join Date: Jan 2002
Location: Geelong Australia
Status:
Offline
|
|
Thanks for your help guys!
fping looks great, I downloaded it but cannot get it working
any help would be greatly appreciated, I am just getting used to the terminal and I need a bit of help!
Thanks James
|
|
Windows: Been There Done That , Why go Back?
MAC
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Oct 2000
Status:
Offline
|
|
Originally posted by James Mullins:
fping looks great, I downloaded it but cannot get it working
fping works okay for me here... this is what i did:
% cd /tmp
% curl -O http://www.fping.com/download/fping-2.4b2_to.tar.gz
% gnutar -zxf fping-2.4b2_to.tar.gz
% cd fping-2.4b2_to
% ./configure
% make
% sudo make install
% sudo chmod 4555 /usr/local/sbin/fping
% rehash
% fping www.apple.com
let me know if you have any questions...
(Last edited by rkt; Apr 24, 2003 at 10:38 AM.
)
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|