-
Proxy ping tool
I am writing a script to test external network reachability of all
machines in our LAN. I have a list of IPs of the machines attached to
the router. I want to traverse the list and make each of them ping a
well known URL - say [url]www.yahoo.com[/url]
The list is like:
192.168.1.23
192.168.1.97
192.168.1.112
Is there a tool that can achieve this? I want to instruct a set of
machines to ping [url]www.yahoo.com[/url] to make sure they can access external
network.
Thanks
-
Re: Proxy ping tool
On Thu, 03 Jul 2008 23:38:03 -0700, simpleton007 wrote:
[color=blue]
> I am writing a script to test external network reachability of all
> machines in our LAN. I have a list of IPs of the machines attached to
> the router. I want to traverse the list and make each of them ping a
> well known URL - say [url]www.yahoo.com[/url]
>
> The list is like:
> 192.168.1.23
> 192.168.1.97
> 192.168.1.112
>
> Is there a tool that can achieve this? I want to instruct a set of
> machines to ping [url]www.yahoo.com[/url] to make sure they can access external
> network.[/color]
Have a look at rancid, especially the clogin (or more generally and
<letter>login) utility.
HTH,
M4
-
Re: Proxy ping tool
On Thu, 3 Jul 2008 23:38:03 -0700 (PDT), [email]simpleton007@gmail.com[/email] <simpleton007@gmail.com> wrote:[color=blue]
> I am writing a script to test external network reachability of all
> machines in our LAN. I have a list of IPs of the machines attached to
> the router. I want to traverse the list and make each of them ping a
> well known URL - say [url]www.yahoo.com[/url]
>
> The list is like:
> 192.168.1.23
> 192.168.1.97
> 192.168.1.112
>
> Is there a tool that can achieve this?[/color]
Yes, Unix and ssh:
for host in 192.168.1.23 192.168.1.97 192.168.1.112 ; do
ssh $host ping -c1 -w5 -q [url]www.yahoo.com[/url] \
|| complain_about_connectivity $host
done
It assumes you have configured ssh, for this user, to accept a
password-less public key, or used ssh-agent(1) to unlock the key.
But note that it is impolite to ping [url]www.yahoo.com[/url] frequently from a
script. Do you really need to test more than one host in your LAN? Do
you really have situations where both host A and B are on the LAN, but
only host A can reach the internet? If so, can't you just wait until
it causes problems, and detect those problems?
/Jorgen
--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!