Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options


by Wookie (Beadle)
on Jan 16, 2002 at 18:44 UTC ( #139208=perlquestion: print w/replies, xml ) Need Help??

Wookie has asked for the wisdom of the Perl Monks concerning the following question:

Quick question...

I was working on a program for quick testing of Network connectivity for a list of servers, so I wrote a forking monster that ran 20 chiildren at once, attempting connections with Net::Telnet and Net::FTP.

This was fine - until someone suggested adding Net::Traceroute to run a traceroute for each server. This was duly added, but unfortuantely once it was - the logging fron the job seemed to go nuts, and the only explanation that was offered was that Net::Traceroute somehow interferes with other versions of itself running if it's threaded?

Has anyone else experienced a problem like this - or could suggest what the problem is?

Sub used to run Traceroute:
# Subroutine check_tr # # Check Traceroute to host sub check_tr { my ($server,$timeout)=@_; die("Insufficent Arguments passed to check_tr\n") unless (defined $ +timeout); my ($conn,$log); $log="Server $server - Traceroute - "; $conn=Net::Traceroute->new(host => $server,timeout => $timeout); if ($conn->found) { # Managed to trace my $hops = $conn->hops; $log.="Hops $hops\n"; } else { $log.="*** FAILED TO TRACE ***\n"; } return($log); }

game(Wookie,opponent) eq 'Wookie' ? undef $problem : remove_limbs(arms,opponent);

Replies are listed 'Best First'.
Re: Net::Traceroute
by arhuman (Vicar) on Jan 16, 2002 at 19:02 UTC
    See eval with timeout, threaded perl.

    As you use a timeouts there must be a alarm+sighandler somewhere in the code...
    (Doesn't work fine with threads)

    Just my 0.333 Euros.

    "Only Bad Coders Code Badly In Perl" (OBC2BIP)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2022-07-03 02:16 GMT
Find Nodes?
    Voting Booth?
    My most frequent journeys are powered by:

    Results (103 votes). Check out past polls.