Compare commits
44 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cf88ba3b7 | ||
|
|
f901ba5591 | ||
|
|
7deea96bc3 | ||
|
|
48dfb9bd08 | ||
|
|
85372559fa | ||
|
|
98972b80ef | ||
|
|
d950244232 | ||
|
|
fd898829c3 | ||
|
|
b0158628bb | ||
|
|
0f69a7b391 | ||
|
|
72773117e5 | ||
|
|
06806f5a6e | ||
|
|
a01c785ec8 | ||
|
|
502e206371 | ||
|
|
8fba1bc6a9 | ||
|
|
f43803d6d4 | ||
|
|
338cba6350 | ||
|
|
2a15066062 | ||
|
|
add86bc566 | ||
|
|
e9b4eaaeb9 | ||
|
|
07605051f5 | ||
|
|
998356484b | ||
|
|
e97617ad60 | ||
|
|
9685c3afa8 | ||
|
|
c209b9a72f | ||
|
|
4999b769ba | ||
|
|
d8b5ba2161 | ||
|
|
6f4a4a91cf | ||
|
|
0049f0d72e | ||
|
|
4ea66fc0fd | ||
|
|
8426620572 | ||
|
|
76aece0a3f | ||
|
|
508e7f77a0 | ||
|
|
d250a829cb | ||
|
|
2fada0c31c | ||
|
|
e6ad08733d | ||
|
|
a8d83b5e1c | ||
|
|
9392b74cbc | ||
|
|
e09624efd0 | ||
|
|
d4d7429de4 | ||
|
|
b97cef86a3 | ||
|
|
70615a172b | ||
|
|
d399ca90d3 | ||
|
|
bbc9695075 |
@@ -1,5 +1,5 @@
|
||||
All code from version 0.7 on
|
||||
Copyright (c) 2003-2009 Max Baker and SNMP::Info Developers
|
||||
Copyright (c) 2003-2016 Max Baker and SNMP::Info Developers
|
||||
All rights reserved.
|
||||
|
||||
Original Code
|
||||
|
||||
69
ChangeLog
69
ChangeLog
@@ -1,5 +1,74 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
|
||||
version 3.33 (2016-04-27)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Move author-only tests to xt directory so they aren't run on installation
|
||||
by users
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Correct device serial number reporting for Cisco Nexus 5k switches with
|
||||
software version >= 7
|
||||
|
||||
version 3.32 (2016-04-26)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Add 200 Mbps and 2.0 Gbps aliases to SPEED_MAP
|
||||
* Add Palo Alto support
|
||||
* Add VMware support
|
||||
* Support for propMultiplexor as ifType
|
||||
* Add device MAC to APC UPS
|
||||
* [#61] Report APC model for PDU products
|
||||
* Removed DeviceMatrix from the distribution
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Support undefined (noSuchInstance) values in Offline mode
|
||||
* Do not init table cache if Cache provided by user
|
||||
* Avoid deep recusion when AUTOLOAD and carp collide
|
||||
* Detect Cisco VG350s as L3 devices instead of APs
|
||||
* fix for 'Use of inherited AUTOLOAD for non-method SNMP::Info::Layer2::HP::agg_ports_ifstack() is deprecated'
|
||||
* Workaround in IPv6.pm to deal with possibly incorrect IPV6-MIB implementations
|
||||
* [#71] AUTOLOAD typo-catcher search for SNMP::Info no longer anchored
|
||||
* [#70] Respect version/comm/secname on passed Session obj
|
||||
|
||||
version 3.31 (2016-01-22)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Support for CiscoSB OS and Version (D. Tuecks)
|
||||
* SONMP support for Enhanced Topology Table
|
||||
* Add support for channelized interfaces in L3::Passport
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Correct link to MIB tarball
|
||||
|
||||
version 3.30 (2015-11-16)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* RT #106254: Add new sysObjectID mapping for Ubiquiti
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Correct link to MIB tarball
|
||||
* Correct port indexing of newer VSP 4K and 8K in L3::Passport
|
||||
* Statistics in the sysIfxStatTable are 64-bit counters, so they should
|
||||
override the 64-bit methods.
|
||||
|
||||
version 3.29 (2015-10-13)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Add IPv6::ipv6_addr() method to map IPv6 interface address indexes to actual addresses
|
||||
* Add support for (remote) IPv6 addresses to LLDP::lldp_addr()
|
||||
* Add LLDP::lldp_ipv6() and LLDP::lldp_mac() so that remote management
|
||||
addresses of specific types can be requested
|
||||
|
||||
version 3.28 (2015-06-18)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
1
DEVELOP
1
DEVELOP
@@ -4,7 +4,6 @@ Coding Guidelines:
|
||||
- tab-width of 4, no tab characters
|
||||
- keep POD documentation up-to-date
|
||||
- always update ChangeLog before committing
|
||||
- always update DeviceMatrix.txt before committing
|
||||
- check-in required mibs to netdisco-mibs and release new package if needed
|
||||
|
||||
Release and Testing Instructions:
|
||||
|
||||
1044
DeviceMatrix.txt
1044
DeviceMatrix.txt
File diff suppressed because it is too large
Load Diff
61
Info.pm
61
Info.pm
@@ -24,7 +24,7 @@ use vars
|
||||
qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
$NOSUCH $BIGINT $REPEATERS/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -32,7 +32,7 @@ SNMP::Info - OO Interface to Network devices and MIBs through SNMP
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
SNMP::Info - Version 3.28
|
||||
SNMP::Info - Version 3.33
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
@@ -47,7 +47,9 @@ by Max Baker.
|
||||
|
||||
=head1 DEVICES SUPPORTED
|
||||
|
||||
See L<http://netdisco.org/doc/DeviceMatrix.html> or L<DeviceMatrix.txt> for more details.
|
||||
There are now generic classes for most types of device and so the authors
|
||||
recommend loading SNMP::Info with AutoSpecify, and then reporting to the mail
|
||||
list any missing functionality (such as neighbor discovery tables).
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -168,7 +170,7 @@ install by hand.
|
||||
SNMP::Info operates on textual descriptors found in MIBs.
|
||||
|
||||
If you are using SNMP::Info separate from Netdisco,
|
||||
download the Netdisco MIB package at L<http://sourceforge.net/project/showfiles.php?group_id=80033&package_id=135517>
|
||||
download the Netdisco MIB package at L<http://sourceforge.net/projects/netdisco/files/netdisco-mibs/latest-snapshot/>
|
||||
|
||||
Make sure that your snmp.conf is updated to point to your MIB directory
|
||||
and that the MIBs are world-readable.
|
||||
@@ -876,6 +878,12 @@ Subclass for PacketFront DRG series CPE.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::PacketFront> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::PaloAlto
|
||||
|
||||
Subclass for Palo Alto firewalls.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::PaloAlto> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Passport
|
||||
|
||||
Subclass for Avaya/Nortel Ethernet Routing Switch/Passport 8000 series,
|
||||
@@ -923,6 +931,12 @@ Alcatel-Lucent SR Class.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Timetra> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::VMware
|
||||
|
||||
Subclass for VMware ESXi hosts.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::VMware> for details.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
@@ -1240,16 +1254,13 @@ sub new {
|
||||
return;
|
||||
}
|
||||
|
||||
# Table function store
|
||||
my $store = {};
|
||||
|
||||
# Save Args for later
|
||||
$new_obj->{store} = $store;
|
||||
$new_obj->{store} ||= {};
|
||||
$new_obj->{sess} = $sess;
|
||||
$new_obj->{args} = \%args;
|
||||
$new_obj->{snmp_ver} = $args{Version} || 2;
|
||||
$new_obj->{snmp_comm} = $args{Community} || 'public';
|
||||
$new_obj->{snmp_user} = $args{SecName} || 'initial';
|
||||
$new_obj->{snmp_ver} = $sess->{Version} || $args{Version} || 2;
|
||||
$new_obj->{snmp_comm} = $sess->{Community} || $args{Community} || 'public';
|
||||
$new_obj->{snmp_user} = $sess->{SecName} || $args{SecName} || 'initial';
|
||||
|
||||
return $auto_specific ? $new_obj->specify() : $new_obj;
|
||||
}
|
||||
@@ -1313,7 +1324,7 @@ sub update {
|
||||
=head2 Data is Cached
|
||||
|
||||
Methods and subroutines requesting data from a device will only load the data
|
||||
once, and then return cached versions of that data.
|
||||
once, and then return cached versions of that data.
|
||||
|
||||
Run $info->load_METHOD() where method is something like 'i_name' to reload
|
||||
data from a method.
|
||||
@@ -1321,7 +1332,7 @@ data from a method.
|
||||
Run $info->clear_cache() to clear the cache to allow reload of both globals
|
||||
and table methods.
|
||||
|
||||
The cache can be retreved or set using the $info->cache() method. This works
|
||||
The cache can be retrieved or set using the $info->cache() method. This works
|
||||
together with the C<Offline> option.
|
||||
|
||||
=head2 Object Scalar Methods
|
||||
@@ -1466,9 +1477,6 @@ SNMP::Info::Layer3 subclasses.
|
||||
If the device still can be connected to via SNMP::Info, then
|
||||
SNMP::Info is returned.
|
||||
|
||||
See L<http://netdisco.org/doc/DeviceMatrix.html> or L<DeviceMatrix.txt> for more details
|
||||
about device support, or view C<device_type()> in F<Info.pm>.
|
||||
|
||||
=cut
|
||||
|
||||
sub device_type {
|
||||
@@ -1525,6 +1533,7 @@ sub device_type {
|
||||
6027 => 'SNMP::Info::Layer3::Force10',
|
||||
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
|
||||
6527 => 'SNMP::Info::Layer3::Timetra',
|
||||
6876 => 'SNMP::Info::Layer3::VMware',
|
||||
8072 => 'SNMP::Info::Layer3::NetSNMP',
|
||||
9303 => 'SNMP::Info::Layer3::PacketFront',
|
||||
10002 => 'SNMP::Info::Layer2::Ubiquiti',
|
||||
@@ -1536,9 +1545,11 @@ sub device_type {
|
||||
14988 => 'SNMP::Info::Layer3::Mikrotik',
|
||||
17163 => 'SNMP::Info::Layer3::Steelhead',
|
||||
25506 => 'SNMP::Info::Layer3::H3C',
|
||||
25461 => 'SNMP::Info::Layer3::PaloAlto',
|
||||
26543 => 'SNMP::Info::Layer3::IBMGbTor',
|
||||
30065 => 'SNMP::Info::Layer3::Arista',
|
||||
35098 => 'SNMP::Info::Layer3::Pica8',
|
||||
41112 => 'SNMP::Info::Layer2::Ubiquiti',
|
||||
);
|
||||
|
||||
my %l2sysoidmap = (
|
||||
@@ -1560,6 +1571,7 @@ sub device_type {
|
||||
4526 => 'SNMP::Info::Layer2::Netgear',
|
||||
5624 => 'SNMP::Info::Layer3::Enterasys',
|
||||
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
|
||||
9303 => 'SNMP::Info::Layer3::PacketFront',
|
||||
11898 => 'SNMP::Info::Layer2::Orinoco',
|
||||
14179 => 'SNMP::Info::Layer2::Airespace',
|
||||
14525 => 'SNMP::Info::Layer2::Trapeze',
|
||||
@@ -1607,6 +1619,9 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::Aironet'
|
||||
if ( $desc =~ /Aironet/ and $desc =~ /\D(AP4800)\D/ );
|
||||
|
||||
# Override voice gateway device (VG350) showing up as Aironet
|
||||
$objtype = 'SNMP::Info::Layer3::Cisco' if $desc =~ /VG350/;
|
||||
|
||||
# Cat6k with older SUPs (hybrid CatOS/IOS?)
|
||||
$objtype = 'SNMP::Info::Layer3::C6500' if $desc =~ /(c6sup2|c6sup1)/;
|
||||
|
||||
@@ -3302,6 +3317,7 @@ Makes human friendly speed ratings using %SPEED_MAP
|
||||
'54000000' => '54 Mbps',
|
||||
'64000000' => '64 Mbps',
|
||||
'100000000' => '100 Mbps',
|
||||
'200000000' => '200 Mbps',
|
||||
'149760000' => 'ATM on OC-3',
|
||||
'155000000' => 'OC-3',
|
||||
'155519000' => 'OC-3',
|
||||
@@ -3311,6 +3327,7 @@ Makes human friendly speed ratings using %SPEED_MAP
|
||||
'622000000' => 'OC-12',
|
||||
'622080000' => 'OC-12',
|
||||
'1000000000' => '1.0 Gbps',
|
||||
'2000000000' => '2.0 Gbps',
|
||||
'2488000000' => 'OC-48',
|
||||
)
|
||||
|
||||
@@ -3347,6 +3364,7 @@ munge_highspeed(). SNMP::Info can return speeds up to terabit levels this way.
|
||||
'54000000' => '54 Mbps',
|
||||
'64000000' => '64 Mbps',
|
||||
'100000000' => '100 Mbps',
|
||||
'200000000' => '200 Mbps',
|
||||
'149760000' => 'ATM on OC-3',
|
||||
'155000000' => 'OC-3',
|
||||
'155519000' => 'OC-3',
|
||||
@@ -3356,6 +3374,7 @@ munge_highspeed(). SNMP::Info can return speeds up to terabit levels this way.
|
||||
'622000000' => 'OC-12',
|
||||
'622080000' => 'OC-12',
|
||||
'1000000000' => '1.0 Gbps',
|
||||
'2000000000' => '2.0 Gbps',
|
||||
'2488000000' => 'OC-48',
|
||||
);
|
||||
|
||||
@@ -3791,6 +3810,7 @@ These methods return data as a scalar.
|
||||
sub _global {
|
||||
my $method = shift;
|
||||
my $oid = shift;
|
||||
return sub {} if $method eq 'CARP_TRACE';
|
||||
|
||||
return sub {
|
||||
my $self = shift;
|
||||
@@ -3808,7 +3828,7 @@ sub _global {
|
||||
# Return cached data unless loading
|
||||
# We now store in raw format so munge before returning
|
||||
# unless expecting raw data
|
||||
if ( defined $self->{"_$attr"} && !$load ) {
|
||||
if ( exists $self->{"_$attr"} && !$load ) {
|
||||
my $val = $self->{"_$attr"};
|
||||
|
||||
if ( !$raw ) {
|
||||
@@ -4518,6 +4538,11 @@ sub _validate_autoload_method {
|
||||
$leaf_name =~ s/_/-/g;
|
||||
}
|
||||
|
||||
# skip if offline
|
||||
if ( $self->{Offline} ) {
|
||||
return [1,(exists $self->{store}->{$method} ? 1: 0)];
|
||||
}
|
||||
|
||||
# Translate MIB leaf node name to OID
|
||||
my $oid = SNMP::translateObj($leaf_name);
|
||||
|
||||
@@ -4667,7 +4692,7 @@ sub AUTOLOAD {
|
||||
# Typos in function calls in SNMP::Info subclasses turn into
|
||||
# AUTOLOAD requests for non-methods. While this is deprecated,
|
||||
# we'll still get called, so report a less confusing error.
|
||||
if ( ref($self) !~ /^SNMP::Info/ ) {
|
||||
if ( ref($self) !~ /SNMP::Info/ ) {
|
||||
|
||||
# croak reports one level too high. die reports here.
|
||||
# I would really like to get the place that's likely to
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS
|
||||
= ( 'ALCATEL-IND1-INTERSWITCH-PROTOCOL-MIB' => 'aipAMAPRemDeviceType', );
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'ADSL-LINE-MIB' => 'adslLineType' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (); # IF-MIB
|
||||
|
||||
@@ -61,7 +61,7 @@ sub agg_ports_ifstack {
|
||||
foreach my $idx ( keys %$ifStack ) {
|
||||
my ( $higher, $lower ) = split /\./, $idx;
|
||||
next if ( $higher == 0 or $lower == 0 );
|
||||
if ( $ifType->{ $higher } eq 'ieee8023adLag' ) {
|
||||
if ( $ifType->{ $higher } eq 'ieee8023adLag' or $ifType->{ $higher } eq 'propMultiplexor') {
|
||||
$ret->{ $lower } = $higher;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info;
|
||||
use vars
|
||||
qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT %CDP_CAPABILITIES/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
%MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' );
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::IEEE802dot3ad 'agg_ports_lag';
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::IEEE802dot3ad::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PAECAPABILITIES/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'CISCO-POWER-ETHERNET-EXT-MIB' => 'cpeExtPsePortEntPhyIndex',
|
||||
'CISCO-CDP-MIB' => 'cdpCachePowerConsumption' );
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner', );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'SNMPv2-MIB' => 'sysDescr',
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
@SNMP::Info::CiscoStpExtensions::ISA = qw/SNMP::Info::Bridge SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoStpExtensions::EXPORT_OK = qw//;
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'EXTREME-EDP-MIB' => 'extremeEdpPortIfIndex',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'ENTITY-MIB' => 'entPhysicalSerialNum' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( 'IEEE802dot11-MIB' => 'dot11DesiredSSID', );
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Aggregate;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Aggregate::MIBS,
|
||||
|
||||
39
Info/IPv6.pm
39
Info/IPv6.pm
@@ -44,7 +44,7 @@ use constant {
|
||||
IPV6MIB => 3,
|
||||
};
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ $VERSION = '3.28';
|
||||
'ip_pfx_origin' => 'ipAddressPrefixOrigin', # IP-MIB
|
||||
'c_pfx_origin' => 'cIpAddressPfxOrigin', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_pfx' => 'ipAddressPrefix', # IP-MIB
|
||||
'ip_addr6_pfx' => 'ipAddressPrefix', # IP-MIB
|
||||
'c_addr6_pfx' => 'cIpAddressPrefix', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_index' => 'ipAddressIfIndex', # IP-MIBw
|
||||
'ip_addr6_index' => 'ipAddressIfIndex', # IP-MIB
|
||||
'c_addr6_index' => 'cIpAddressIfIndex', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_type' => 'ipAddressType', # IP-MIB
|
||||
@@ -142,6 +142,12 @@ sub ipv6_n2p_addr {
|
||||
# so what we've collected in that variable is actually the first byte of the address.
|
||||
$v6_packed = pack('C', $addrsize) . $v6_packed;
|
||||
}
|
||||
if (length($v6_packed) == 17) {
|
||||
# Workaround for IPV6-MIB on Windows 2012: if the address is one byte too long, the SNMP agent probably has an incorrect
|
||||
# implementation where a length field precedes the actual IPv6 address.
|
||||
# In that case, the first character should be chr(16), ie 0x10; strip it if that's the case.
|
||||
$v6_packed =~ s/^\x10//;
|
||||
}
|
||||
if (length($v6_packed) == 16) {
|
||||
$v6addr = join(':', map { sprintf("%04x", $_) } unpack("n*", $v6_packed) );
|
||||
$return->{$row} = $v6addr;
|
||||
@@ -321,6 +327,29 @@ sub ipv6_addr_prefix {
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_addr {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $indexes = $info->ipv6_index();
|
||||
foreach my $row (keys %$indexes) {
|
||||
my @parts = split(/\./, $row);
|
||||
my $is_valid = 0;
|
||||
if (scalar @parts == 18) {
|
||||
my $addrtype = shift @parts;
|
||||
$is_valid = 1;
|
||||
} elsif (scalar @parts == 17) {
|
||||
$is_valid = 1;
|
||||
}
|
||||
my $addrsize = shift @parts; # First element now is addrsize, should be 16
|
||||
if ($is_valid && $addrsize == 16) {
|
||||
$return->{$row} = join(':', unpack('(H4)*', pack('C*', @parts)));
|
||||
} else {
|
||||
warn sprintf("%s: unable to decode table index to IPv6 address. Raw data is [%s].\n", &_my_sub_name, $row);
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub _method_used {
|
||||
my $info = shift;
|
||||
my $return = 'none of the MIBs';
|
||||
@@ -459,6 +488,10 @@ Maps an IPv6 prefix with its origin (manual, well-known, dhcp, etc.)
|
||||
|
||||
Maps IPv6 addresses with their prefixes
|
||||
|
||||
=item $info->ipv6_addr()
|
||||
|
||||
Maps a table instance to an IPv6 address
|
||||
|
||||
=back
|
||||
|
||||
=head2 Internet Address Translation Table
|
||||
|
||||
60
Info/LLDP.pm
60
Info/LLDP.pm
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
'LLDP-MIB' => 'lldpLocSysCapEnabled',
|
||||
@@ -149,6 +149,38 @@ sub lldp_ip {
|
||||
return \%lldp_ip;
|
||||
}
|
||||
|
||||
sub lldp_ipv6 {
|
||||
my $lldp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $rman_addr = $lldp->lldp_rman_addr($partial) || {};
|
||||
|
||||
my %lldp_ipv6;
|
||||
foreach my $key ( keys %$rman_addr ) {
|
||||
my ( $index, $proto, $addr ) = _lldp_addr_index($key);
|
||||
next unless defined $index;
|
||||
next unless $proto == 2;
|
||||
$lldp_ipv6{$index} = $addr;
|
||||
}
|
||||
return \%lldp_ipv6;
|
||||
}
|
||||
|
||||
sub lldp_mac {
|
||||
my $lldp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $rman_addr = $lldp->lldp_rman_addr($partial) || {};
|
||||
|
||||
my %lldp_ipv6;
|
||||
foreach my $key ( keys %$rman_addr ) {
|
||||
my ( $index, $proto, $addr ) = _lldp_addr_index($key);
|
||||
next unless defined $index;
|
||||
next unless $proto == 6;
|
||||
$lldp_ipv6{$index} = $addr;
|
||||
}
|
||||
return \%lldp_ipv6;
|
||||
}
|
||||
|
||||
sub lldp_addr {
|
||||
my $lldp = shift;
|
||||
my $partial = shift;
|
||||
@@ -323,13 +355,19 @@ sub _lldp_addr_index {
|
||||
return ( $index, $proto, join( '.', @oids ) );
|
||||
}
|
||||
|
||||
# IPv6
|
||||
elsif ( $proto == 2 ) {
|
||||
return ( $index, $proto,
|
||||
join(':', unpack('(H4)*', pack('C*', @oids)) ) );
|
||||
}
|
||||
|
||||
# MAC
|
||||
elsif ( $proto == 6 ) {
|
||||
return ( $index, $proto,
|
||||
join( ':', map { sprintf "%02x", $_ } @oids ) );
|
||||
}
|
||||
|
||||
# TODO - Need to handle other protocols, i.e. IPv6
|
||||
# TODO - Other protocols may be used as well; implement when needed?
|
||||
else {
|
||||
return;
|
||||
}
|
||||
@@ -495,10 +533,24 @@ if unable defaults to (C<lldpRemLocalPortNum>).
|
||||
Returns remote IPv4 address. Returns for all other address types, use
|
||||
lldp_addr if you want any return address type.
|
||||
|
||||
=item $lldp->lldp_ipv6()
|
||||
|
||||
Returns remote IPv6 address, if known. Returns for all other address types,
|
||||
use lldp_addr if you don't care about return address type.
|
||||
|
||||
=item $lldp->lldp_mac()
|
||||
|
||||
Returns remote (management) MAC address, if known. Returns for all other
|
||||
address types, use lldp_addr if you don't care about return address type.
|
||||
|
||||
=item $lldp->lldp_addr()
|
||||
|
||||
Returns remote address. Type may be any IANA Address Family Number.
|
||||
Currently only returns IPv4 or MAC addresses.
|
||||
Currently only returns IPv4, IPv6 or MAC addresses. If the remote device
|
||||
returns more than one address type, this method will give only one. Which one
|
||||
is returned is decided by chance, phase of the moon and Perl hash ordering.
|
||||
|
||||
Use lldp_mac, lldp_ip or lldp_ipv6 if you want a specific address type.
|
||||
|
||||
=item $lldp->lldp_port()
|
||||
|
||||
@@ -530,7 +582,7 @@ the remote system.
|
||||
|
||||
=item $lldp->lldp_rem_id()
|
||||
|
||||
Returns the string value used to identify the chassis component associated
|
||||
Returns the string value used to identify the chassis component associated
|
||||
with the remote system.
|
||||
|
||||
(C<lldpRemChassisId>)
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS, 'SNMP-REPEATER-MIB' => 'rptrPortGroupIndex' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer1::GLOBALS, 'root_ip' => 'actualIPAddr', );
|
||||
@@ -78,7 +78,7 @@ sub model {
|
||||
|
||||
my $desc = $allied->description();
|
||||
|
||||
if ( $desc =~ /(AT-\d{4}\S{1}?)/ ) {
|
||||
if ( $desc =~ /(AT-\d{4}\S{1})/ ) {
|
||||
return $1;
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer1::GLOBALS, );
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -11,7 +11,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::IEEE802dot11;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::IEEE802dot11::GLOBALS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::LLDP::MIBS,
|
||||
|
||||
@@ -48,7 +48,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2::Cisco;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::Cisco::GLOBALS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2::Cisco;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::Cisco::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -52,7 +52,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -50,11 +50,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
|
||||
# This will be filled in with the device's index into the EntPhysicalEntry
|
||||
# table by the serial() function.
|
||||
our $index = undef;
|
||||
$VERSION = '3.33';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
@@ -98,6 +94,10 @@ sub vendor {
|
||||
return 'cisco';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'ros';
|
||||
}
|
||||
|
||||
# Walk the entPhysicalSerialNum table and return the first serial found
|
||||
sub serial {
|
||||
my $ciscosb = shift;
|
||||
@@ -113,20 +113,26 @@ sub serial {
|
||||
|
||||
sub os_ver {
|
||||
my $ciscosb = shift;
|
||||
my $os_ver = $ciscosb->e_swver();
|
||||
my $e_swver = $ciscosb->e_swver();
|
||||
|
||||
return $os_ver->{$index} if defined $index;
|
||||
foreach my $e ( sort keys %$e_swver ) {
|
||||
if (defined $e_swver->{$e} and $e_swver->{$e} !~ /^\s*$/) {
|
||||
return $e_swver->{$e};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# Grab e_model from Entity and tag on e_hwver
|
||||
sub model {
|
||||
my $ciscosb = shift;
|
||||
my $e_model = $ciscosb->e_model();
|
||||
my $e_model = $ciscosb->e_model();
|
||||
my $e_hwver = $ciscosb->e_hwver();
|
||||
|
||||
if (defined ($index)) {
|
||||
my $model = "$e_model->{$index} $e_hwver->{$index}";
|
||||
return $model;
|
||||
foreach my $e ( sort keys %$e_model ) {
|
||||
if (defined $e_model->{$e} and $e_model->{$e} !~ /^\s*$/) {
|
||||
my $model = "$e_model->{$e} $e_hwver->{$e}";
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
return $ciscosb->description();
|
||||
}
|
||||
@@ -156,14 +162,14 @@ Nic Bernstein (shamelessly stolen from Max Baker's Aironet code)
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $ciscosb = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $ciscosb->class();
|
||||
@@ -210,6 +216,10 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
Returns 'cisco'
|
||||
|
||||
=item $ciscosb->os()
|
||||
|
||||
Returns 'ros'
|
||||
|
||||
=item $ciscosb->os_ver()
|
||||
|
||||
Returns software version (C<entPhysicalSoftwareRev>)
|
||||
|
||||
@@ -37,7 +37,7 @@ use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::Aggregate;
|
||||
use SNMP::Info::Aggregate 'agg_ports_ifstack';
|
||||
|
||||
@SNMP::Info::Layer2::HP::ISA = qw/
|
||||
SNMP::Info::Aggregate
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Aggregate;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::IEEE802dot11::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# This will be filled in with the device's index into the EntPhysicalEntry
|
||||
# table by the serial() function.
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -15,7 +15,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
@@ -53,7 +53,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3;
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE
|
||||
$int_include_vpn $fake_idx $type_class/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
use SNMP::Info::LLDP;
|
||||
use SNMP::Info::Aggregate;
|
||||
use SNMP::Info::Aggregate 'agg_ports_ifstack';
|
||||
|
||||
@SNMP::Info::Layer3::Arista::ISA = qw/
|
||||
SNMP::Info::Aggregate
|
||||
@@ -48,7 +48,7 @@ use SNMP::Info::Aggregate;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Bridge;
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE %MODEL_MAP
|
||||
%MODID_MAP %PROCID_MAP/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -47,7 +47,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
|
||||
@@ -51,7 +51,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -55,7 +55,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -45,7 +45,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::CiscoStats::MIBS, );
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::CiscoStats::MIBS, );
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::Cisco::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, %SNMP::Info::Entity::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::CDP::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::EDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -72,10 +72,14 @@ $VERSION = '3.28';
|
||||
'i_up' => 'sysInterfaceStatus',
|
||||
|
||||
# sysIfxStatTable
|
||||
'i_octet_in' => 'sysIfxStatHcInOctets',
|
||||
'i_octet_out' => 'sysIfxStatHcOutOctets',
|
||||
'i_pkts_ucast_in' => 'sysIfxStatHcInUcastPkts',
|
||||
'i_pkts_ucast_out' => 'sysIfxStatHcOutUcastPkts',
|
||||
'i_octet_in64' => 'sysIfxStatHcInOctets',
|
||||
'i_octet_out64' => 'sysIfxStatHcOutOctets',
|
||||
'i_pkts_ucast_in64' => 'sysIfxStatHcInUcastPkts',
|
||||
'i_pkts_ucast_out64' => 'sysIfxStatHcOutUcastPkts',
|
||||
'i_pkts_mutli_in64' => 'sysIfxStatInMulticastPkts',
|
||||
'i_pkts_multi_out64' => 'sysIfxStatOutMulticastPkts',
|
||||
'i_pkts_bcast_in64' => 'sysIfxStatInBroadcastPkts',
|
||||
'i_pkts_bcast_out64' => 'sysIfxStatOutBroadcastPkts',
|
||||
|
||||
# sysInterfaceStatTable
|
||||
'i_discards_in' => 'sysInterfaceStatDropsIn',
|
||||
@@ -115,8 +119,8 @@ sub fan {
|
||||
my $ret = "";
|
||||
my $s = "";
|
||||
foreach my $i ( sort { $a <=> $b } keys %$fan_state ) {
|
||||
$ret .= $s . $i . ": " . $fan_state->{$i};
|
||||
$s = ", ";
|
||||
$ret .= $s . $i . ': ' . $fan_state->{$i};
|
||||
$s = ', ';
|
||||
}
|
||||
return if ( $s eq "" );
|
||||
return $ret;
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -48,7 +48,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -47,7 +47,7 @@ use SNMP::Info::IEEE802dot3ad 'agg_ports_lag';
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -47,7 +47,7 @@ use SNMP::Info::IEEE802dot3ad 'agg_ports_lag';
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::IEEE802dot11;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
@@ -80,18 +80,49 @@ sub os_ver {
|
||||
return $descr;
|
||||
}
|
||||
|
||||
sub _get_snmpid_chassis {
|
||||
my $self = shift;
|
||||
|
||||
my $snmpid_chassis;
|
||||
my $position;
|
||||
|
||||
my $entity_entry = $self->e_class;
|
||||
for ( keys %$entity_entry ) {
|
||||
# filter by class, chassis is 3
|
||||
if ( $entity_entry->{$_} == 3 ) {
|
||||
print " SNMP::Info::Layer3::Nexus::_get_snmpid_chassis() - ",
|
||||
"chassis with id $_ found, position ",
|
||||
$self->snmpinfo->e_pos->{$_}
|
||||
if $self->debug();
|
||||
|
||||
# and if it's the topmost one
|
||||
if ( !defined $position
|
||||
|| $self->e_pos->{$_} < $position ) {
|
||||
$snmpid_chassis = $_;
|
||||
$position = $self->e_pos->{$_};
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( defined $snmpid_chassis && defined $position ) {
|
||||
print " SNMP::Info::Layer3::Nexus::_get_snmpid_chassis() - ",
|
||||
"chassis with id $snmpid_chassis, position $position selected";
|
||||
}
|
||||
else {
|
||||
print " SNMP::Info::Layer3::Nexus::_get_snmpid_chassis() - ",
|
||||
"no chassis found";
|
||||
}
|
||||
|
||||
return $snmpid_chassis;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $nexus = shift;
|
||||
|
||||
my $e_parent = $nexus->e_parent();
|
||||
my $snmpid_chassis = $nexus->_get_snmpid_chassis;
|
||||
|
||||
return $nexus->e_serial($snmpid_chassis)->{$snmpid_chassis}
|
||||
if defined $snmpid_chassis;
|
||||
|
||||
foreach my $iid ( keys %$e_parent ) {
|
||||
my $parent = $e_parent->{$iid};
|
||||
if ( $parent eq '0' ) {
|
||||
my $serial = $nexus->e_serial($iid);
|
||||
return $serial->{$iid};
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -108,6 +108,21 @@ sub i_ignore {
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
sub layers {
|
||||
my $pfront = shift;
|
||||
|
||||
my $layers = $pfront->SUPER::layers();
|
||||
# Some models or softwware versions don't report L2 properly
|
||||
# so add L2 capability to the output if the device has bridge ports.
|
||||
my $bports = $pfront->b_ports();
|
||||
|
||||
if ($bports) {
|
||||
my $l = substr $layers, 6, 1, "1";
|
||||
}
|
||||
|
||||
return $layers;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -210,6 +225,11 @@ Returns reference to hash. Increments value of IID if port is to be ignored.
|
||||
|
||||
Ignores loopback
|
||||
|
||||
=item $pfront->layers()
|
||||
|
||||
L2 capability isn't always reported correctly by the device itself; what the
|
||||
device reports is augmented with L2 capability if the device has bridge ports.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
190
Info/Layer3/PaloAlto.pm
Normal file
190
Info/Layer3/PaloAlto.pm
Normal file
@@ -0,0 +1,190 @@
|
||||
# SNMP::Info::Layer3::PaloAlto
|
||||
#
|
||||
# Copyright (c) 2014-2016 Max Kosmach
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright notice,
|
||||
# this list of conditions and the following disclaimer.
|
||||
# * Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
# * Neither the name of the University of California, Santa Cruz nor the
|
||||
# names of its contributors may be used to endorse or promote products
|
||||
# derived from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
# LIABLE FOR # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::PaloAlto;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
|
||||
@SNMP::Info::Layer3::PaloAlto::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::PaloAlto::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'PAN-COMMON-MIB' => 'panSysSwVersion',
|
||||
'PAN-PRODUCTS-MIB' => 'panProductsMibsModule',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
# Oids from PAN-COMMON-MIB.
|
||||
'os_ver' => 'panSysSwVersion',
|
||||
'serial1' => 'panSysSerialNumber',
|
||||
'pa_model' => 'panChassisType'
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
return 'Palo Alto Networks';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $pa = shift;
|
||||
my $model = $pa->pa_model;
|
||||
$model =~ s/^pan//;
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'PAN-OS';
|
||||
}
|
||||
|
||||
sub layers {
|
||||
return '01001100';
|
||||
}
|
||||
|
||||
# TODO:
|
||||
# support fan and temp sensors from ENTITY-SENSOR-MIB
|
||||
# test with other Palo Alto devices
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::PaloAlto - SNMP Interface to Palo Alto devices
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Max Kosmach
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $pa = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $pa->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Palo Alto devices
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $pa->vendor()
|
||||
|
||||
Returns C<'Palo Alto Networks'>.
|
||||
|
||||
=item $pa->os()
|
||||
|
||||
Returns C<'PANOS'>.
|
||||
|
||||
=item $pa->model()
|
||||
|
||||
Returns the value of C<panChassisType.0>.
|
||||
|
||||
=item $pa->os_ver()
|
||||
|
||||
Returns the value of C<panSysSwVersion.0>.
|
||||
|
||||
=item $pa->serial()
|
||||
|
||||
Returns the value of C<panSysSerialNumber.0>.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $pa->layers()
|
||||
|
||||
Returns 01001110. Palo Alto doesn't report layers, modified to reflect
|
||||
Layer 2,3,4,7 functionality.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
|
||||
=cut
|
||||
@@ -1,6 +1,6 @@
|
||||
# SNMP::Info::Layer3::Passport
|
||||
#
|
||||
# Copyright (c) 2012 Eric Miller
|
||||
# Copyright (c) 2016 Eric Miller
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS,
|
||||
@@ -174,9 +174,11 @@ sub interfaces {
|
||||
my $partial = shift;
|
||||
|
||||
my $i_index = $passport->i_index($partial);
|
||||
my $i_descr = $passport->orig_i_description($partial) || {};
|
||||
my $model = $passport->model();
|
||||
my $index_factor = $passport->index_factor();
|
||||
my $port_offset = $passport->port_offset();
|
||||
my $slot_offset = $passport->slot_offset();
|
||||
my $vlan_index = {};
|
||||
my %reverse_vlan;
|
||||
my $vlan_id = {};
|
||||
@@ -202,6 +204,10 @@ sub interfaces {
|
||||
$if{$index} = 'Cpu.Virtual';
|
||||
}
|
||||
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[478]/ ) ) {
|
||||
$if{$index} = 'Mgmt.1';
|
||||
}
|
||||
|
||||
elsif ( ( $index == 192 ) and ( $model =~ /^8[86]03/ ) ) {
|
||||
$if{$index} = 'Cpu.3';
|
||||
}
|
||||
@@ -226,11 +232,18 @@ sub interfaces {
|
||||
}
|
||||
|
||||
else {
|
||||
my $port = ( $index % $index_factor ) + $port_offset;
|
||||
my $slot = int( $index / $index_factor );
|
||||
if ($model =~ /VSP/ and $i_descr->{$iid} and $i_descr->{$iid} =~ m<Port\s+(\d+(?:/\d+)*)>) {
|
||||
my $ps = $1;
|
||||
$ps =~ s|/|.|g;
|
||||
$if{$iid} = $ps;
|
||||
}
|
||||
else {
|
||||
my $port = ( $index % $index_factor ) + $port_offset;
|
||||
my $slot = int( $index / $index_factor ) + $slot_offset;
|
||||
|
||||
my $slotport = "$slot.$port";
|
||||
$if{$iid} = $slotport;
|
||||
my $slotport = "$slot.$port";
|
||||
$if{$iid} = $slotport;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -383,6 +396,10 @@ sub i_name {
|
||||
$i_name{$iid} = 'CPU Virtual Management IP';
|
||||
}
|
||||
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[478]/ ) ) {
|
||||
$i_name{$iid} = 'Mgmt Port';
|
||||
}
|
||||
|
||||
elsif ( ( $iid == 192 ) and ( $model =~ /^8[86]03/ ) ) {
|
||||
$i_name{$iid} = 'CPU 3 Ethernet Port';
|
||||
}
|
||||
@@ -573,13 +590,17 @@ sub index_factor {
|
||||
# Older Accelar models use base 16 instead of 64
|
||||
$index_factor = 16
|
||||
if ( defined $model and $model =~ /^1[012][05]0/ );
|
||||
# Newer VSP 4K uses 192?
|
||||
$index_factor = 192
|
||||
if ( defined $model and $model =~ /^VSP4/ );
|
||||
|
||||
return $index_factor;
|
||||
}
|
||||
|
||||
sub slot_offset {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
# Newer VSP 4K and 8K start at an index of 192 ~ slot 3 but really slot 1
|
||||
return -2
|
||||
if ( defined $model and $model =~ /^VSP[478]/ );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.28';
|
||||
$VERSION = '3.33';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user