geektron has asked for the wisdom of the Perl Monks concerning the following question:
I thought it might be some kind of permissions issue, but the test script runs with my UID (i've watched it in the process list), and i've been able to ping the boxes (both with backticks and from ping in the shell - same thing, i know - so it's not a question of permissions.
or is it? here's the code (straight outta the documentation):
and when i run it:use Net::Ping; my @host_array = qw( www.slashdot.org www.deja.com www.perlmonks.org +); my $proto = 'tcp'; my $def_timeout = '40'; my $bytes = '52'; my $p = Net::Ping->new($proto, $def_timeout , $bytes); foreach my $host (@host_array) { print "$host is "; print "NOT " unless $p->ping($host, 2); print "reachable.\n"; } $p->close();
bclarkso-sun:/users/bclarkso/snips --> perl -w ping.pl www.slashdot.org is NOT reachable. www.deja.com is NOT reachable. www.perlmonks.org is NOT reachable.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::Ping not working
by tye (Sage) on Sep 12, 2000 at 02:35 UTC | |
by geektron (Curate) on Sep 12, 2000 at 02:57 UTC | |
by tye (Sage) on Sep 12, 2000 at 03:39 UTC | |
by Adam (Vicar) on Sep 12, 2000 at 03:53 UTC | |
by geektron (Curate) on Sep 12, 2000 at 07:14 UTC | |
|
RE: Net::Ping not working
by Shendal (Hermit) on Sep 12, 2000 at 18:32 UTC | |
by merlyn (Sage) on Sep 12, 2000 at 18:35 UTC | |
by jcwren (Prior) on Sep 12, 2000 at 19:12 UTC | |
by merlyn (Sage) on Sep 12, 2000 at 19:15 UTC | |
|
Re: Net::Ping not working
by BastardOperator (Monk) on Sep 12, 2000 at 04:44 UTC |