Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Re: Re: PING taking too long

by rchiav (Deacon)
on Sep 26, 2001 at 22:08 UTC ( #114887=note: print w/replies, xml ) Need Help??

in reply to Re: Re: PING taking too long
in thread PING taking too long

It's hard to tell if you're doing something wrong without seeing your code. Here's an example I just threw together that works. Note - this is on a windows 2000 box, so issues with being suid root aren't something I take into consideration.
use strict; use warnings; use Net::Ping; my $p = Net::Ping->new('icmp', 1); my $result = $p->ping(''); print "Result is $result\n";
If you're still having problems, post your code so we can figure out where things might be going wrong.


Replies are listed 'Best First'.
Re: Re: Re: Re: PING taking too long
by Hydro (Acolyte) on Sep 27, 2001 at 16:42 UTC
    Here is the situation. The PING works fine using the icmp protocol but not the tcp protocol in a perl script running directly from a linux bash console.

    When I use the same program as a cgi script running on the same server as when I executed the script on the console it does work. The icmp protocol makes it quit right away and the tcp protocol returns 0's for anything pinged.

    Jonathan Southwick Allegheny College
      1) what user is the CGI running as? As mentioned before by others, and I belive in the doc's fr Net::Ping, the script needs to be suid root.. which might not be the best thing for a CGI.

      2) Also mentioned before, there are issues running TCP pings. Google returned a lot of discussions about things not working quite right with TCP and UDP pings.

      3) Depending on what you're doing, there could be a issue of the environment not being the same.

      4) Again, posting your code is a good idea.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114887]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2021-09-23 00:10 GMT
Find Nodes?
    Voting Booth?

    No recent polls found