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

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('192.168.2.1'); 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.

Rich

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 jsouthwi@allegheny.edu
      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.

      Rich

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://114887]
help
Chatterbox?
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
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?