Posted on 2009-08-14 22:12:59-07 by j2111877
Serial transport
Hello, I tried to use this module to connect to a Cisco device over serial connection but without any joy. I am wondering whether you can help me to troubleshoot where the problem is. I installed this module in Cygwin environment. I tested the same code for SSH connection and it was working fine. However, the following error message was returned if trnasport was set to Serial. Failed to get first prompt at xxx line xxx I can confirm that cu was installed and is working fine if it is invoked from the command line. One thing that I found is that the same error message was returned if I used a non-existed port or specifing wrong location of cu program. From my observation, it seems that Serial transport is not working correctly in my environment. I would appreciate your kind help on troubleshooting where the problem is. A copy of my test script is attached below for refernece. Thanks in advance.
use Net::Appliance::Session; my $s = Net::Appliance::Session->new(Host => '1.1.1.1', Transport => 'Serial'); eval { $s->connect(Name => 'xxxx', Password => '1111', Line => '/dev/com6', Parity => 'none', Speed => + 9600); $s->begin_privileged('yyyy'); print $s->cmd('show access-list'); $s->end_privileged; }; if ($@) { $e = Exception::Class->caught(); ref $e ? $e->rethrow : die $e; } $s->close;
Direct Responses: 11301 | 11314 | Write a response
Posted on 2009-08-14 22:24:03-07 by oliver in response to 11300
Re: Serial transport
Hi there,

As it happens I'm just working on the Serial module, as it seems there is definitely a bug in its processing of the arguments (Speed, Line, etc).

I'll be looking at it this weekend, so hope to have a new release to CPAN in a couple of days. I expect that will make a difference to your problem - the code you supply looks right to me.

regards,
oliver.
Direct Responses: Write a response
Posted on 2009-08-18 14:38:56-07 by oliver in response to 11300
Re: Serial transport
Unfortunately the Serial module of Net::Appliance::Session is proving very difficult to fix. I can't in all honesty say I'll be able to make it work :-(

I am working on a complete rewrite of Net::Appliance::Session and because it will work in a different way, I hope to work around all this.

Sorry about this, and please revisit the module in the future if you have time to try it again. I'm not sure there's much else like it around, and the new version will (I hope) kick ass.

regards,
oliver.
Direct Responses: 11330 | Write a response
Posted on 2009-08-19 21:12:05-07 by j2111877 in response to 11314
Re: Serial transport

Hello Oliver,

Thank you very much for your kind help. Your hard work on maintaining and improving this module is very much appreciated. I'm looking forward to the new release in the future.

Regards,

Joseph
Direct Responses: Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.