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;