Xane has asked for the wisdom of the Perl Monks concerning the following question:
Prompt for Cisco XR:#!/usr/bin/perl use strict; use warnings; use Net::SSH2::Cisco; my $host = Net::SSH2::Cisco->new( Host => 'device', Always_waitfor_prompt => 1, Prompt => '/(?m:^\\s?(?:[\\w.\/]+\:)?(?:[\\w.-]+\@)?[\\w.-]+\\s?(? +:\(config[^\)]*\))?\\s?(?:\(admin-config[^\)]*\))?\\s?[\$#>]\\s?(?:\( +enable\))?\\s*$)/', Input_log => "log/device.log", Output_log => "log/output_device.log", Dump_Log => "log/dump_device", Waitfor_clear => '0', ); $host->login( name => 'user', password => 'pass', ); #$host->cmd("term leng 0"); my @abc = $host->cmd( String => 'sh ver', Prompt => '/(?m:^\\s?(?:[\\w.\/]+\:)?(?:[\\w.-]+\@)?[\\w.-]+\\ +s?(?:\(config[^\)]*\))?\\s?(?:\(admin-config[^\)]*\))?\\s?[\$#>]\\s?( +?:\(enable\))?\\s*$)/', Timeout => '20' ); print @abc; $host->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Net::SSH2::Cisco not working on Cisco XR
by VinsWorldcom (Prior) on Mar 02, 2016 at 15:13 UTC | |
by Xane (Initiate) on Mar 02, 2016 at 16:26 UTC | |
by VinsWorldcom (Prior) on Mar 02, 2016 at 16:56 UTC | |
by Xane (Initiate) on Mar 04, 2016 at 09:30 UTC | |
by VinsWorldcom (Prior) on Mar 04, 2016 at 12:38 UTC | |
by Xane (Initiate) on Mar 16, 2016 at 14:41 UTC | |
by VinsWorldcom (Prior) on Mar 16, 2016 at 15:39 UTC |