I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-12-09 14:52:44-08 by noblem
net::telnet::cisco send_wakeup equivalent

I've got some weired cisco devices that don't generate a login prompt without first sending them a carrige return (Although the work fine using telnet from the command line). I've got a work around in my old net::telnet::cisco based code that uses the send_wakeup feature, which essentially sends a \n to the device which then magically comes to live.

Is there way to replicate this with net::appliance::session, I can't see any thing obvious buy I have been staring at the code all day :-)

Thanks
Matt
Direct Responses: 9519 | Write a response
Posted on 2008-12-09 15:04:22-08 by oliver in response to 9518
Re: net::telnet::cisco send_wakeup equivalent
Hi Matt,

At the moment there is no feature in Net::Appliance::Session to do the equivalent of send_wakeup.

If you are comfortable patching the code yourself, I'll tell you what (I think) needs to be done:

Take a look at the Serial transport (Serial.pm) and you'll see it does a wake-up (look for "wake the serial connection up"). Copy this code into the Telnet or SSH transport module after the fhopen and it'll do what you want.

Sadly of course this isn't something you can easily turn on and off. However I do see the value in this feature, so I'll add it to my TODO list for sure. I am planning to put a lot of work into improvements in the module in the next month.

I hope that helps,

regards,
oliver.
Direct Responses: 9538 | Write a response
Posted on 2008-12-10 15:05:40-08 by noblem in response to 9519
Re: net::telnet::cisco send_wakeup equivalent

Hi Oliver,

Your suggestion works fine, but obviously it's not going to do this for every connection which isn't ideal either. I've done some more investigation and I'm now not convinced that this is the correct solution, at least in this specific set of circumstances. The Solaris telnet client does not have this issue and running a packet trace I can see that when it connects it's negotiating quite a few telnet options with the remote server.

Net::Telnet::Options seems to allow this type of negotiation, although I've not had a chance test the theory yet. I'll be sure to post back if I managed to figure it out

Matt

Direct Responses: 9539 | 9622 | Write a response
Posted on 2008-12-11 18:50:53-08 by oliver in response to 9538
Re: net::telnet::cisco send_wakeup equivalent
Hi Matt,

Okay, many thanks for the update.

I'm hoping to work on Net::Appliance::Session over the vacation hols in a few weeks, and one of the things I wanted to to was make it much more "pluggable". It would be reasonable based on what you've said to allow something like Net::Telnet::Options to get a foot in on the Telnet session to assist, optionally.

I'll take a look at the options here - not really had a lot of time yet to think about this. If you hav any ideas or any other info which might help (e.g. a use case example for Net::Telnet::Options, or some other corner cases not handled by Net::Appliance::Session), please do let me know.

regards,
oliver.
Direct Responses: Write a response
Posted on 2008-12-30 21:14:47-08 by oliver in response to 9538
Re: net::telnet::cisco send_wakeup equivalent
Matt,

I was just looking at your Telnet Options issue again, and remembered that there are methods in Net::Telnet to negotiate Telnet Options.

As Net::Appliance::Session isa Net::Telnet, these methods will be available to you. However I assume you need to be actually using Telnet (i.e. it won't work for SSH or Serial connections).

For more info please see the Net::Telnet manual page.

Hope this helps,

regards,
oliver.
Direct Responses: Write a response