Hello everybody,
I want to ping a couple of Hosts and add some informations
like the answer-time of the packet and the ip-address.
The Module Docs of the Net::Ping Module looks like you
get the duration and the ip Address within the return_value
for $p->ping( $host, $timeout)
but using this gives me an empty value.
Any Ideas?
Here's my Code,
thank you in advance ..
##################################
use strict;
use Net::Ping;
my $p = Net::Ping->new('icmp',2);
my @servers = qw( HOST1 HOST2 HOST3 );
print "Content-type: text/html\n\n";
foreach(@servers){
if ( ( my $ret, my $duration, my $ip) = $p->ping($_, 2) ) {
print "$_ answered. $duration $ip <br>\n";
}else{
print "$_ timed out.<br>\n";
}
}
##################################
Mit freundlichen Gr��en / With best regards
Sascha Teifke
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs