[rochester-pm-list] Net::Ping

Brian Mathis bmathis at directedge.com
Mon Feb 15 22:14:46 CST 1999


I finally tracked down the problem with this.  Using "tcp" as your ping
type requires that the remote host be running the "echo" service (port
7).  If it is not running, it cannot make the connection to that port. 
The host might still be up and pingable via command line ping, but that
uses icmp to test availability.

I'll bet that using a "udp" style ping, might also have this problem,
but you'll have to check on that..

Brian


Shawn Porter wrote:
> 
> Has anybody else ever used Net::Ping.  I was using it the other day and it
> wasn't working according to its documentation.
> 
> Here's a snippet:
> 
>         use Net::Ping;
>         my $p = Net::Ping->new(tcp, 50);
>         my $resp = $p->ping($hostname);
> 
> When I do this, I get a '0' in $resp if I can contact the host and a ''
> (null) if I can't contact the host.  (Changing the timeout doesn't affect
> it.)  According to the docs, I should get a '1' if it is reachable, a '0'
> if it is not, and '' (null) if "the hostname cannot be found or there is a
> problem with the IP number."  No matter what I do, it never returns a '1'.
> 
> (Perl 5.004_04 tested on Linux 2.0.36 and Digital OSF1 V4.0.)
> 
> Any ideas?
> 
> --
> Shawn Porter
> http://www.rit.net/sporter
> sporter at rit.net



More information about the Rochester-pm mailing list