in reply to Re^2: Multi-threading ping of a list of hosts.....Again!
in thread Multi-threading ping of a list of hosts.....Again!
To get the "verbose" output, run it like this:
>ping_sweep2.pl -v
Re:Do I have to convert the hostnames to IP address first?Any
From the Net::Ping FM:
$host can be either the hostname or the IP number of the remote host
You should also be able to collapse some of the code like so (untested):
##Replace THIS code while (<DATA>) { chomp; print "$_ : "; my $ip_address = Win32::AdminMisc::gethostbyname($_); print "$ip_address\n"; push (@targets, $ip_address); } # Generate list of hosts to ping foreach my $target (@targets) { $RequestQ->enqueue ($target); } ## Replace with THIS code #### while (<DATA>) { chomp; print "Queuing ping for $_ : "; $RequestQ->enqueue $_ ; # Feed the NAME directly in }
Earth first! (We'll rob the other planets later)
|
|---|