Trying to ping a list of servers using ping, but I get a return on the unpingable servers. I want to get a list of unsuccessful pings only!!
here is a sample...
#!/usr/bin/perl
use Net::Ping;
my $p = Net::Ping->new(`tcp`);
open (TT, "box3");
while (<TT>) {
$i=$_;
chomp $i;
$host = $i;
$timeout = 3;
chomp $host;
print "$host is alive.\n" if $p->ping($host);
} ### END OF WHILE STATEMENT
any input,, greatly appreciated!!
here is a sample...
#!/usr/bin/perl
use Net::Ping;
my $p = Net::Ping->new(`tcp`);
open (TT, "box3");
while (<TT>) {
$i=$_;
chomp $i;
$host = $i;
$timeout = 3;
chomp $host;
print "$host is alive.\n" if $p->ping($host);
} ### END OF WHILE STATEMENT
any input,, greatly appreciated!!
Comment