I have a list of 500 IP address and need to ping all the IP address. I had written a script to do this and its working if the IP is valid one. If any invalid IP present, the process got hang up.
Also I have tried with -c , -I and -w options, its not working.
I think that you are being impatient and/or not limiting the number of attempts to make.
Assuming that you fire off ping with a count (else it keeps trying forever) then a valid address will show you the responses and exit. Similarly, an unresponsive address will keep trying forever, however only responses cause a display, so it may appear that your ping is just hanging, but in actual fact it is still trying each second. You don't get a "timed out" type message each failure like on Windows.
Depending on your operating system the flags change slightly, so read the man page to confirm exactly what you need, but if you try:-
... you will have a simple yes/no test. An unresponsive attempt will timeout in 10 seconds. It may be a bit painful if you have many addresses that don't respond, but you could batch them up and send out multiple queries at a time. Be careful though else you might swamp your server and/or network and annoy people a little.
If you have a file of addresses, you could try (in ksh):-
This will create two output files.
I hope that this helps, but feel free to ask more if I haven't been clear.
Hi,
I have a shell script, that has to run in putty for days together. So , I need to keep the network server connection alive and running. The execution of shell script shouldn't be interrupted as it produces undesirable results.
Can anyone provide me with a script ? (3 Replies)
Hi All,
I'm testing ping command on two servers.
A,B,C,D are servers
From A-->B:
ping -c 3 -p ff -s30720 <B IP-Addres>
This works fine.
From C-->D:
ping -c 3 -p ff -s30720 <D IP-Addres>
This is NOT working and 100% packe loss :(
But if I use 8700 instead of 30720 for packet size... (6 Replies)
i cannot find a usefull ping and traceroute command from TCP to another TCP server with port.
I usually do only traceroute IP and ping IP..is that enough? I wanted to check its connectivity to an IP address with port..
example:
from ip 1.1.1.1 (TCP port 1234)
destination 2.2.2.2 (TCP... (1 Reply)
for i in $var; do
for j in $var; do
if
then
ssh -x -a "$host_login_name"@${i} ping -c 3 -s 3 ${j}
if
then
printf "Success\n"
else
printf "Failed\n"
fi
fi
done
done
Enter your box login... (2 Replies)
Hello Everybody:
Im the root of the system, I need to grant some limited priviliges user an acess to the ping command so he can ping some IPs with his script.
should I add the command to his path??
or what??
Thanks a lot (3 Replies)
HI,
I am new to unix. I have used some basic commands and written some simple shell scripts in teh past. Currently, I am supposed to write a script to continuosly check if a couple of machines are up and if not to start a script. I am using a bash - 2.03. I have tryying to use the ping command... (3 Replies)
Hi!
I have small problem. I want to ping a server and the result shouldn't be printed in the browser window, just become a value.
Here you can see the script that I have:
$command="ping linux.com -t ttl -c1 | tail -1 | awk '{print $4 \" \" $5}'";
$output = system($command); ... (2 Replies)
Hi!
I have small problem. I want to ping a server and the result shouldn't be printed in the browser window, just become a value.
Here you can see the script that I have:
<?
$command="ping linux.com -t ttl -c1 | tail -1 | awk '{print $4 \" \" $5}'";
$output = system($command);... (1 Reply)