Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu

by Illuminatus (Curate)
on Apr 03, 2011 at 00:32 UTC ( #897130=note: print w/ replies, xml ) Need Help??


in reply to Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu

I have not personally used Net::SSH2:Channel, and the cpan documentation does not make it clear what the flag means for blocking. I would assume that 1 means blocking, but are you sure? You are not checking the results of any of the methods after the connect. However, if the auth was failing, I'm pretty sure the channel would return undef, so your first use of it would fail in an obvious way.

Your example program is not displaying $len, so I'm assuming that in some previous incarnation, you printed it out. If you did not, and are going by the print statement for $output, then the read method could have failed.

Have you compared the ssh2 library versions for the 2 remote systems? I would make sure I was using the same lib version on both before I checked anything else.

fnord


Comment on Re: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu
Re^2: Net::SSH2::Channel with exec, reads 0 bytes on suse while works fine on ubuntu
by madhurikl (Novice) on Apr 03, 2011 at 11:58 UTC
    Hi fnord,

    I just didnt include the error handling stuff to make the question and the code simple to understand.

    a) The channel is successfully created.

    b) I tried with both blocking(0) and blocking(1). However, I need a blocking call, and as per my knowledge, blocking(1) sets the blocking.

    c) $len returns 0. I can see the number of bytes read because I have debug enabled.

    d) Yes. ssh2 library versions are same on both the ubuntu machine and the opensuse machine. I am also connecting to the same remote machine from both the systems.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2014-10-23 17:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (126 votes), past polls