Support enable password in ASA sshcollector (M. Sheinberg)
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2.031010 - 2015-02-25
|
||||||
|
|
||||||
|
[ENHANCEMENTS]
|
||||||
|
|
||||||
|
* Support enable password in ASA sshcollector (M. Sheinberg)
|
||||||
|
|
||||||
2.031009 - 2015-02-25
|
2.031009 - 2015-02-25
|
||||||
|
|
||||||
[ENHANCEMENTS]
|
[ENHANCEMENTS]
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub arpnip{
|
sub arpnip{
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,16 @@ C<enable> status after login:
|
|||||||
|
|
||||||
aaa authorization exec LOCAL auto-enable
|
aaa authorization exec LOCAL auto-enable
|
||||||
|
|
||||||
|
To use an C<enable> password seaparate from the login password, add an
|
||||||
|
C<enable_password> under C<sshcollector> in your configuration file:
|
||||||
|
|
||||||
|
sshcollector:
|
||||||
|
- ip: '192.0.2.1'
|
||||||
|
user: oliver
|
||||||
|
password: letmein
|
||||||
|
enable_password: myenablepass
|
||||||
|
platform: IOS
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@@ -37,7 +47,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub arpnip {
|
sub arpnip {
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
|
|
||||||
@@ -45,8 +55,21 @@ sub arpnip {
|
|||||||
my $expect = Expect->init($pty);
|
my $expect = Expect->init($pty);
|
||||||
|
|
||||||
my ($pos, $error, $match, $before, $after);
|
my ($pos, $error, $match, $before, $after);
|
||||||
my $prompt = qr/#/;
|
my $prompt;
|
||||||
|
|
||||||
|
if ($args->{enable_password}) {
|
||||||
|
$prompt = qr/>/;
|
||||||
|
($pos, $error, $match, $before, $after) = $expect->expect(10, -re, $prompt);
|
||||||
|
|
||||||
|
$expect->send("enable\n");
|
||||||
|
|
||||||
|
$prompt = qr/Password:/;
|
||||||
|
($pos, $error, $match, $before, $after) = $expect->expect(10, -re, $prompt);
|
||||||
|
|
||||||
|
$expect->send( $args->{enable_password} ."\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
$prompt = qr/#/;
|
||||||
($pos, $error, $match, $before, $after) = $expect->expect(10, -re, $prompt);
|
($pos, $error, $match, $before, $after) = $expect->expect(10, -re, $prompt);
|
||||||
|
|
||||||
$expect->send("terminal pager 2147483647\n");
|
$expect->send("terminal pager 2147483647\n");
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
|
|
||||||
=cut
|
=cut
|
||||||
sub arpnip {
|
sub arpnip {
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub arpnip {
|
sub arpnip {
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
my @data = $ssh->capture("show ip arp");
|
my @data = $ssh->capture("show ip arp");
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub arpnip {
|
sub arpnip {
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
my @data = $ssh->capture("show arp vrf all");
|
my @data = $ssh->capture("show arp vrf all");
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }.
|
|||||||
=cut
|
=cut
|
||||||
|
|
||||||
sub arpnip{
|
sub arpnip{
|
||||||
my ($self, $hostlabel, $ssh, @args) = @_;
|
my ($self, $hostlabel, $ssh, $args) = @_;
|
||||||
|
|
||||||
debug "$hostlabel $$ arpnip()";
|
debug "$hostlabel $$ arpnip()";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user