If have a file with 93 ip address that i want to ping in first place (later i want to use this file for snmp output of those ip addresses).
First i want to do is to ping all those ip addresses. I know i can put for every ip address "ping" with the vi. But i want the keep this file clean and only ip addresses in it.
I now tried a several thing to ping all those ip addresses but nothing works, somebody any idea?
Underneath some things i've tried, i think they make no sense and are complete wrong:o
bash-2.03$ cat all_hosts_ip | while read
> do ping $line
>done
bash-2.03$ while $line ; do echo all_hosts_ip ; ping all_host_ip ; done
Assuming you are running bash, here is the script:
for ipaddr in `cat ip_list`;
do
ping $ipaddr >> pingout &
done;
And then you can do 'tail -f pingout' to see the outputs of pings simultaneously. If you want outputs to be one after the other, you can remove the '&' at the end of the ping statement.