print $chan2 "tail -f /var/adm/messages";
print "LINE : $_" while <$chan2>;
$chan2->close;
I'm guessing it thinks it's finished then closes the channel. I didn't realize you meant you needed it open say for hours (for example). My need for the module was to inventory (or change something ) across hundreds of Unix and Linux servers and report the results. It's quick. We can create user accounts and set the password across 500 servers in just a few minutes. Eventually they will get Vintella working and replace the user creation piece. Someday :-)
Have you tried running with Net::SSH2::Debug enabled? I'm curious if it might shed a clue there. Or even printing $! if there was an error somewhere. If it runs 50,000 lines then why not until we tell it to stop.
I haven't run into this myself. The code is still under a year old and not even 1.0 yet. So I'm sure there are surprises yet to be discovered :-)
I'll poke around and see if I can find something that might help us understand how to do this. Cross your fingers.
It might be a good idea to post this question on the net::ssh2 forum. David Robbins has popped on there to help answer questions about the module. It was mentioned to try using POLL(). Personally I never got it working properly (neither have several other developers). I'm feeling that piece of the code is still broken. Perhaps in the next libssh2 update it will be fixed.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.