tidy the Clavister module

This commit is contained in:
Oliver Gorwits
2020-02-13 10:23:07 +00:00
parent 2d849e60ce
commit 912a971a75

View File

@@ -1,38 +1,37 @@
package App::Netdisco::SSHCollector::Platform::Clavister; package App::Netdisco::SSHCollector::Platform::Clavister;
# vim: set expandtab tabstop=8 softtabstop=4 shiftwidth=4:
=head1 NAME =head1 NAME
App::Netdisco::SSHCollector::Platform::Clavister App::Netdisco::SSHCollector::Platform::Clavister
=head1 DESCRIPTION =head1 DESCRIPTION
Collect ARP entries from Clavister firewalls. Collect ARP entries from Clavister firewalls.
These devices does not expose mac table through snmp. These devices does not expose mac table through snmp.
=cut =cut
use strict; use strict;
use warnings; use warnings;
use Data::Dumper;
sub new { use Dancer ':script';
my $proto = shift; use Moo;
my $class = ref($proto) || $proto;
my $self = {};
bless ($self, $class);
return $self;
}
=head1 PUBLIC METHODS =head1 PUBLIC METHODS
=over 4 =over 4
=item B<arpnip($host, $ssh)> =item B<arpnip($host, $ssh)>
Retrieve ARP entries from device. C<$host> is the hostname or IP address Retrieve ARP entries from device. C<$host> is the hostname or IP address
of the device. C<$ssh> is a Net::OpenSSH connection to the device. of the device. C<$ssh> is a Net::OpenSSH connection to the device.
Returns an array of hashrefs in the format { mac => MACADDR, ip => IPADDR }. 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()";
print "$hostlabel $$ arpnip()\n";
my @data = $ssh->capture("neighborcache"); my @data = $ssh->capture("neighborcache");
chomp @data; chomp @data;
@@ -49,4 +48,5 @@ sub arpnip {
} }
return @arpentries; return @arpentries;
} }
1; 1;