Ping

ICMP echo request alias ping:
perl -MNet::Ping -lne 'print "$_: ", scalar Net::Ping->new( "icmp" )->ping( $_ )' hosts.txt
TCP based ping using port 80:
perl -MNet::Ping -lne '$p = Net::Ping->new; $p->port_number( 80 );
                       print "$_: ", scalar $p->ping( $_ )' hosts.txt

No comments:

Post a Comment