Fast ICMP scanner (Perl oneliner)
Jan 08
2008
2008
Comments Off
[localhost]$
time perl -MNet::Ping -e '$p = Net::Ping->new(); @hosts = qw( 127.0.0.1 172.16.0.1 172.16.0.2 172.16.0.5 172.16.0.254); #the significant detail $p->{"timeout"} = 0.005; for (@hosts) { print "$_ is ".($p->ping($_) ? "up" : "down").$/ }'
127.0.0.1 is up
172.16.0.1 is up
172.16.0.2 is down
172.16.0.5 is up
172.16.0.254 is down
real 0m0.062s
user 0m0.040s
sys 0m0.000s