Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

How to debug a perl module

by rich_d_thomas (Sexton)
on Nov 16, 2010 at 14:52 UTC ( #871752=perlquestion: print w/replies, xml ) Need Help??
rich_d_thomas has asked for the wisdom of the Perl Monks concerning the following question:


I am having difficulty with perl module Net::Appliance::Session.

I have tried to contact the author and I am not getting any reply from him.

The problem I have is that when I use this module to make an SSH connect to Cisco ASA firewalls, some of the commands timeout. This module SSHing to Cisco routers and switches does not experience the same problems.

If I manually SSH to the ASA firewalls, from the same machine and using the same commands, they do not timeout.

Does anybody know what I can do to debug the module to try and figure out why this happening?



Replies are listed 'Best First'.
Re: How to debug a perl module
by marto (Archbishop) on Nov 16, 2010 at 15:19 UTC
Re: How to debug a perl module
by zentara (Archbishop) on Nov 16, 2010 at 16:33 UTC
    Does ssh timeout prevention help? What happens when you use Net::SSH2 to connect to the cisco unit?

    I was just looking into something similar yesterday, in trying to figure out how to allow Net::SSH2's channel to start a background process on the target machine, without it dying when the ssh connection is dropped. See Re^7: A little demo for Net::SSH2.

    What I noticed is that the c version of ssh2 has the ability to automatically put itself into the background and run commands as no_tty ( or something like that).

    In other words, the c version detachs itself automatically, but a perl connection may need it done manually with

    nohup &
    then close the console

    I'm just trying to point out the detachment process, as a possible reason for the difference between the c ssh and the Perl version, and that maybe it is the cause of your problem.

    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku ................... flash japh
Re: How to debug a perl module
by rich_d_thomas (Sexton) on Nov 17, 2010 at 10:37 UTC

    Hi marto and zentara,

    Thanks both for your advice.

    I have got some results from bit of what each of you have said.

    I have used tcpdump and I can see that the perl script sends the command and the Cisco ASA replies to the command, but for some reason, the script behaves as if the device did not reply

    I have not looked into SSH timeout prevention, as the timeout that I'm talking about isn't the type that the SSH timeout prevention addresses. What I mean by timeout is the script not appearing to receive the data from the sevice and the call to cmd() funtion hangs, until the timeout value of seconds is reached and it continues once this happens.

    I'll have a look at the other suggestions you have both made soon, but I wanted to report back on things I have found so far.



Re: How to debug a perl module
by rich_d_thomas (Sexton) on Nov 18, 2010 at 09:17 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://871752]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-05-21 10:05 GMT
Find Nodes?
    Voting Booth?