Net::Ping::External doesn't honor timeout or count

S

Stuart Kendrick

hi,

i'm using Net::ping::External to do my pings. i would like to fiddle
with its 'timeout' and 'count' parameters ... but i don't seem to be
able to. no matter how i set them, i get the same results: a timeout
of 10 seconds and a count of 1.

#!/usr/bin/perl
use strict;
use warnings;
use Net::ping::External qw(ping);

my @hosts = qw/140.107.200.250 140.107.200.251 140.107.200.252/;
for my $host (@hosts) {
if (ping ( hostname => $host,
timeout => '1',
count => '1'
)
) {
print "$host is alive\n";
}
else {
print "$host is dead\n";
}
}

i've replicated this issue in the following environments:
perl-5.8.5, Net-Ping-External-v0.11, SuSE 9.1
perl-5.8.3, Net-Ping-External-v0.11, SuSE 8.2

has anyone else seen this issue?

--sk

stuart kendrick
fhcrc
 
J

John W. Krahn

Stuart said:
i'm using Net::ping::External to do my pings. i would like to fiddle
with its 'timeout' and 'count' parameters ... but i don't seem to be
able to. no matter how i set them, i get the same results: a timeout
of 10 seconds and a count of 1.

Since Net::ping::External is just using your system's ping command have you
tried running ping with qx//? Have you read the man page for ping?

man ping



John
 
S

Stuart Kendrick

ahhh, RTFM ... or RTFC ...

i've modified my copy of Net::ping::External to accept the "-W"
argument ... thanx bill,

--sk

Bill said:
Stuart said:
hi,

i'm using Net::ping::External to do my pings. i would like to fiddle
[...]


Yes, with Mandrake. But:

From the docs:
-----------------------
Linux

Tested OK on Debian 2.2 and Redhat 6.2. It appears that different
versions of Linux use different versions of ping, which support
different options. Not sure how I'm going to resolve this yet; for now,
all the options but count are disabled.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top