Saturday, November 17, 2007

ping a huge

I need to ping a huge list (.txt File) of IP-Addresses.
I wrote a perlscript (under windows) , but it is way too slow...

Basically it looks like this:
CODE
$file = "list_of_ips.txt";
for (`type $file`)
{
chomp $_;
$ping=`ping -n 1 $_`;
if ($ping =~ /timed out/i)
{print "$_ OFFLINE\n"}
else {print "$_ ONLINE\n"};
}