Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
433b87b9df | ||
|
|
f9464bcd6c | ||
|
|
f5c5ec202a | ||
|
|
4b64a70830 | ||
|
|
4c8f7e298e | ||
|
|
2d539be214 | ||
|
|
c35d5814b4 | ||
|
|
7d19ad401b | ||
|
|
985577ce79 | ||
|
|
24e20101d5 | ||
|
|
76c884eb9f | ||
|
|
7041dbab27 | ||
|
|
661051fde4 | ||
|
|
36cba5ce18 | ||
|
|
4753f30c53 | ||
|
|
d719e240d2 | ||
|
|
e35faee278 | ||
|
|
fd3417a09a | ||
|
|
1719709648 | ||
|
|
d37aa3378e | ||
|
|
f017d32860 | ||
|
|
7b23edcb29 | ||
|
|
e48c4b4e84 | ||
|
|
aeca44c7aa | ||
|
|
af6ae8e419 | ||
|
|
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 |
31
.github/issue_template.md
vendored
Normal file
31
.github/issue_template.md
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
<!--- Provide a general summary of the issue in the Title above -->
|
||||
<!--- https://guides.github.com/features/mastering-markdown/#examples -->
|
||||
|
||||
## Expected Behavior
|
||||
<!--- If you're describing a bug, tell us what should happen -->
|
||||
<!--- If you're suggesting a change/improvement, tell us how it should work -->
|
||||
|
||||
## Current Behavior
|
||||
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
|
||||
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
|
||||
|
||||
## Possible Solution
|
||||
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
|
||||
<!--- or ideas how to implement the addition or change -->
|
||||
|
||||
## Steps to Reproduce (for bugs)
|
||||
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
|
||||
<!--- reproduce this bug. Include code to reproduce, if relevant, or attach screenshots -->
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
|
||||
## Context
|
||||
<!--- How has this issue affected you? What are you trying to accomplish? -->
|
||||
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
|
||||
|
||||
## Your Environment
|
||||
<!--- Include as many relevant details about the environment you experienced the bug in -->
|
||||
* SNMP::Info version used:
|
||||
* Netdisco version (if used):
|
||||
@@ -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
|
||||
|
||||
71
ChangeLog
71
ChangeLog
@@ -1,5 +1,74 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
|
||||
version 3.35 (2017-06-28)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Include loading of LLDP-EXT-MED-MIB in LLDP.pm
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* #180 support CiscoConfig on Nexus (sf.net:scratchfury)
|
||||
* #50 remove interface specific part from vrf interfaces on IOS (W. Vandersmissen)
|
||||
* #211 f5 class should respect UseEnums when faking i_type
|
||||
|
||||
version 3.34 (2016-11-20)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* Support Cisco IPS Modules homed on the Cisco ASA (M. Kraus)
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Serial number on Nexus 9372 (genereic check for ID before using) (M. Caines)
|
||||
|
||||
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]
|
||||
@@ -664,7 +733,7 @@ version 1.05 (11/25/07) - CVS only. No official release
|
||||
+ Added support for Cisco (Airespace) wireless controllers as new class
|
||||
L2::Airespace
|
||||
+ Added support for Nortel Ethernet Routing Switch 2500 series and
|
||||
Business Ethernet Switches (David Sieb<EFBFBD>rger)
|
||||
Business Ethernet Switches (David Siebörger)
|
||||
+ Update of L3::Foundry to support all Foundry devices including newer
|
||||
switches. Depreciate L2::Foundry.
|
||||
+ Added generic device type detection using IANA assigned enterpise
|
||||
|
||||
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
65
Info.pm
65
Info.pm
@@ -24,7 +24,7 @@ use vars
|
||||
qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
$NOSUCH $BIGINT $REPEATERS/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -32,7 +32,7 @@ SNMP::Info - OO Interface to Network devices and MIBs through SNMP
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
SNMP::Info - Version 3.30
|
||||
SNMP::Info - Version 3.35
|
||||
|
||||
=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
|
||||
|
||||
@@ -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 {
|
||||
@@ -1504,7 +1512,7 @@ sub device_type {
|
||||
42 => 'SNMP::Info::Layer3::Sun',
|
||||
43 => 'SNMP::Info::Layer2::3Com',
|
||||
45 => 'SNMP::Info::Layer2::Baystack',
|
||||
171 => 'SNMP::Info::Layer3::Dell',
|
||||
171 => 'SNMP::Info::Layer3::DLink',
|
||||
244 => 'SNMP::Info::Layer3::Lantronix',
|
||||
311 => 'SNMP::Info::Layer3::Microsoft',
|
||||
674 => 'SNMP::Info::Layer3::Dell',
|
||||
@@ -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,6 +1545,7 @@ 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',
|
||||
@@ -1547,7 +1557,7 @@ sub device_type {
|
||||
11 => 'SNMP::Info::Layer2::HP',
|
||||
43 => 'SNMP::Info::Layer2::3Com',
|
||||
45 => 'SNMP::Info::Layer2::Baystack',
|
||||
171 => 'SNMP::Info::Layer3::Dell',
|
||||
171 => 'SNMP::Info::Layer3::DLink',
|
||||
207 => 'SNMP::Info::Layer2::Allied',
|
||||
674 => 'SNMP::Info::Layer3::Dell',
|
||||
1872 => 'SNMP::Info::Layer3::AlteonAD',
|
||||
@@ -1609,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)/;
|
||||
|
||||
@@ -1899,6 +1912,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer2::NWSS2300'
|
||||
if (
|
||||
$desc =~ /^(Nortel\s)??Wireless\sSecurity\sSwitch\s23[568][012]\b/);
|
||||
|
||||
# Cisco IPS, older version which doesn't report layer 3 functionality
|
||||
$objtype = 'SNMP::Info::Layer7::CiscoIPS'
|
||||
if ( $soid =~ /\.1\.3\.6\.1\.4\.1\.9\.1\.1545/i );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( defined($id) and $objtype eq 'SNMP::Info') {
|
||||
@@ -3304,6 +3321,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',
|
||||
@@ -3313,6 +3331,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',
|
||||
)
|
||||
|
||||
@@ -3349,6 +3368,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',
|
||||
@@ -3358,6 +3378,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',
|
||||
);
|
||||
|
||||
@@ -3793,6 +3814,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;
|
||||
@@ -3810,7 +3832,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 ) {
|
||||
@@ -4520,6 +4542,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);
|
||||
|
||||
@@ -4669,7 +4696,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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS
|
||||
= ( 'ALCATEL-IND1-INTERSWITCH-PROTOCOL-MIB' => 'aipAMAPRemDeviceType', );
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'ADSL-LINE-MIB' => 'adslLineType' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::IEEE802dot3ad::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
|
||||
@@ -97,6 +97,10 @@ sub copy_run_tftp {
|
||||
print "Using new method, row iid: $rand\n" if $ciscoconfig->debug();
|
||||
|
||||
#Check each set, delete created row if any fail
|
||||
unless ( $ciscoconfig->set_config_row_status( 5, $rand ) ) {
|
||||
$ciscoconfig->error_throw("Initializing config copy instruction failed");
|
||||
return;
|
||||
}
|
||||
unless ( $ciscoconfig->set_config_source_type( 4, $rand ) ) {
|
||||
$ciscoconfig->error_throw("Setting source type failed");
|
||||
unless ( $ciscoconfig->set_config_row_status( 6, $rand ) ) {
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PAECAPABILITIES/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner', );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
@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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
'EXTREME-EDP-MIB' => 'extremeEdpPortIfIndex',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'ENTITY-MIB' => 'entPhysicalSerialNum' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( 'IEEE802dot11-MIB' => 'dot11DesiredSSID', );
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Aggregate;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Aggregate::MIBS,
|
||||
|
||||
16
Info/IPv6.pm
16
Info/IPv6.pm
@@ -44,7 +44,7 @@ use constant {
|
||||
IPV6MIB => 3,
|
||||
};
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
|
||||
|
||||
@@ -72,10 +72,10 @@ $VERSION = '3.30';
|
||||
'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;
|
||||
@@ -307,7 +313,9 @@ sub ipv6_addr_prefix {
|
||||
foreach my $row (keys %$ipv6_addr_prefix){
|
||||
if ($row =~ /^(\d+)\.[\d\.]+$/) {
|
||||
my $type = $1;
|
||||
if ($type == 2) { # IPv6
|
||||
if (($type == 2) or ($type == 4)) { # IPv6
|
||||
# Remove interface specific part from vrf interfaces
|
||||
if ($row =~ /^((\d+\.){17}\d+)/) { $row = $1 }
|
||||
# Remove the OID part from the value
|
||||
my $val = $ipv6_addr_prefix->{$row};
|
||||
if ( $val =~ /^.+?((?:\d+\.){19}\d+)$/ ){
|
||||
|
||||
@@ -39,10 +39,11 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
'LLDP-MIB' => 'lldpLocSysCapEnabled',
|
||||
'LLDP-EXT-MED-MIB' => 'lldpXMedMIB',
|
||||
'LLDP-EXT-DOT1-MIB' => 'lldpXdot1MIB',
|
||||
'LLDP-EXT-DOT3-MIB' => 'lldpXdot3MIB',
|
||||
);
|
||||
@@ -435,6 +436,8 @@ None.
|
||||
|
||||
=item F<LLDP-MIB>
|
||||
|
||||
=item F<LLDP-EXT-MED-MIB>
|
||||
|
||||
=item F<LLDP-EXT-DOT1-MIB>
|
||||
|
||||
=item F<LLDP-EXT-DOT3-MIB>
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::IEEE802dot11::GLOBALS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2::Cisco;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::Cisco::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -52,7 +52,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -50,11 +50,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
|
||||
# This will be filled in with the device's index into the EntPhysicalEntry
|
||||
# table by the serial() function.
|
||||
our $index = undef;
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -15,7 +15,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
@@ -201,7 +201,7 @@ sub serial {
|
||||
my $parent = $e_parent->{$iid};
|
||||
if ( $parent eq '0' ) {
|
||||
my $serial = $l3->e_serial($iid);
|
||||
if ( $serial ) {
|
||||
if ( $serial && $serial->{$iid} ) {
|
||||
return $serial->{$iid};
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# 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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -45,7 +45,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::Cisco::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, %SNMP::Info::Entity::MIBS,
|
||||
|
||||
126
Info/Layer3/DLink.pm
Normal file
126
Info/Layer3/DLink.pm
Normal file
@@ -0,0 +1,126 @@
|
||||
package SNMP::Info::Layer3::DLink;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::LLDP;
|
||||
|
||||
@SNMP::Info::Layer3::DLink::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::DLink::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
'DLINK-ID-REC-MIB' => 'dlink',
|
||||
'SWPRIMGMT-DES3200-MIB' => 'dlink-des3200SeriesProd',
|
||||
'SWPRIMGMT-DES30XXP-MIB' => 'dlink-des30xxproductProd',
|
||||
'SWPRIMGMT-DES1228ME-MIB' => 'dlink-des1228MEproductProd',
|
||||
'SWDES3528-52PRIMGMT-MIB' => 'dlink-Des3500Series',
|
||||
'DES-1210-28-AX' => 'des-1210-28ax',
|
||||
'DES-1210-10MEbx' => 'des-1210-10mebx',
|
||||
'DES-1210-26MEbx' => 'des-1210-26mebx',
|
||||
'DES-1210-52-BX' => 'des-1210-52bx',
|
||||
'DES-1210-52-CX' => 'des-1210-52-cx',
|
||||
'DGS-1210-24-AX' => 'dgs-1210-24ax',
|
||||
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
'dlink_fw' => 'probeSoftwareRev',
|
||||
'dlink_hw' => 'probeHardwareRev',
|
||||
'dlink_stp_i_root_port' => 'MSTP_MIB__swMSTPInstRootPort',
|
||||
'dlink_serial_no' => 'AGENT_GENERAL_MIB__agentSerialNumber',
|
||||
);
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::LLDP::MUNGE, );
|
||||
|
||||
sub model {
|
||||
my $dlink=shift;
|
||||
my $id = $dlink->id();
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
if (defined $model && $model !~ /dlink-products/) {
|
||||
return $model;
|
||||
} else {
|
||||
#If don't have a device MIB
|
||||
return $dlink->description();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub vendor {
|
||||
return 'dlink';
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $dlink = shift;
|
||||
my $model = $dlink->model();
|
||||
my $id = $dlink->id();
|
||||
my $serial;
|
||||
if ($model =~ /1210/) {
|
||||
#Due to the zoo of MIB from DLink by 1210 series
|
||||
$serial->{0} = $dlink->session()->get($id.'.1.30.0');
|
||||
} else {
|
||||
$serial = $dlink->dlink_serial_no();
|
||||
}
|
||||
|
||||
return $serial->{0} if ( defined $serial->{0} and $serial->{0} !~ /^\s*$/ and $serial->{0} !~ 'NOSUCHOBJECT' );
|
||||
return $dlink->SUPER::serial();
|
||||
}
|
||||
|
||||
sub fwver {
|
||||
my $dlink=shift;
|
||||
my $model = $dlink->model();
|
||||
my $id = $dlink->id();
|
||||
my $fw;
|
||||
if ($model =~ /1210/) {
|
||||
#Due to the zoo of MIB from DLink by 1210 series
|
||||
$fw->{0} = $dlink->session()->get($id.'.1.3.0');
|
||||
} else {
|
||||
$fw = $dlink->dlink_fw();
|
||||
}
|
||||
return $fw->{0} if ( defined $fw->{0} and $fw->{0} !~ /^\s*$/ and $fw->{0} !~ 'NOSUCHOBJECT');
|
||||
}
|
||||
|
||||
sub hwver {
|
||||
my $dlink=shift;
|
||||
my $model = $dlink->model();
|
||||
my $id = $dlink->id();
|
||||
my $hw;
|
||||
if ($model =~ /1210/) {
|
||||
#Due to the zoo of MIB from DLink by 1210 series
|
||||
$hw->{0} = $dlink->session()->get($id.'.1.2.0');
|
||||
} else {
|
||||
$hw = $dlink->dlink_hw();
|
||||
}
|
||||
return $hw->{0} if ( defined $hw->{0} and $hw->{0} !~ /^\s*$/ and $hw->{0} !~ 'NOSUCHOBJECT');
|
||||
}
|
||||
|
||||
sub stp_i_root_port {
|
||||
my $dlink=shift;
|
||||
my $model = $dlink->model();
|
||||
my $id = $dlink->id();
|
||||
my $stp_i_root_port;
|
||||
if ($model =~ /1210-(?:10|26)/) {
|
||||
#Due to the zoo of MIB from DLink by 1210 series
|
||||
$stp_i_root_port->{0} = $dlink->session()->get($id.'.6.1.13.0');
|
||||
} else {
|
||||
$stp_i_root_port = $dlink->dlink_stp_i_root_port();
|
||||
}
|
||||
return $stp_i_root_port if ( defined $stp_i_root_port->{0} and $stp_i_root_port->{0} !~ /^\s*$/ and $stp_i_root_port->{0} !~ 'NOSUCHOBJECT');
|
||||
return $dlink->SUPER::stp_i_root_port();
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -165,8 +165,9 @@ sub i_type {
|
||||
|
||||
my %i_type;
|
||||
foreach my $if ( keys %$idx ) {
|
||||
|
||||
$i_type{$if} = 'ethernetCsmacd';
|
||||
$i_type{$if} =
|
||||
((exists $f5->{sess}->{UseEnums} and $f5->{sess}->{UseEnums})
|
||||
? 'ethernetCsmacd' : 6 );
|
||||
}
|
||||
return \%i_type;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -48,7 +48,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -49,6 +49,7 @@ $VERSION = '3.30';
|
||||
'JUNIPER-MIB' => 'jnxBoxAnatomy',
|
||||
'JUNIPER-VIRTUALCHASSIS-MIB' => 'jnxVirtualChassisMemberTable',
|
||||
'JUNIPER-VLAN-MIB' => 'jnxVlanMIBObjects',
|
||||
'JUNIPER-L2ALD-MIB' => 'jnxL2aldVlanFdbId',
|
||||
);
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS,
|
||||
@@ -73,6 +74,9 @@ $VERSION = '3.30';
|
||||
'e_contents_type' => 'jnxContentsType',
|
||||
'e_containers_type' => 'jnxContainersType',
|
||||
'e_hwver' => 'jnxContentsRevision',
|
||||
|
||||
'v_fdb_id' => 'jnxL2aldVlanFdbId',
|
||||
'v_vlan_tag' => 'jnxL2aldVlanTag',
|
||||
);
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE,
|
||||
@@ -109,7 +113,7 @@ sub os_ver {
|
||||
my $descr = $juniper->description() || '';
|
||||
my $lldp_descr = $juniper->lldp_sysdesc() || '';
|
||||
|
||||
if ( $descr =~ m/kernel JUNOS (\S+)/ ) {
|
||||
if ( $descr =~ m/kernel JUNOS ([^,\s]+)/ ) {
|
||||
return $1;
|
||||
}
|
||||
elsif ( $lldp_descr =~ m/version\s(\S+)\s/ ) {
|
||||
@@ -208,7 +212,7 @@ sub i_vlan {
|
||||
|
||||
foreach my $bport ( keys %$i_pvid ) {
|
||||
my $q_vlan = $i_pvid->{$bport};
|
||||
my $vlan = $v_index->{$q_vlan};
|
||||
my $vlan = $v_index->{$q_vlan} || $q_vlan;
|
||||
my $ifindex = $index->{$bport};
|
||||
unless ( defined $ifindex ) {
|
||||
print " Port $bport has no bp_index mapping. Skipping.\n"
|
||||
@@ -256,6 +260,38 @@ sub _vlan_hoa {
|
||||
return $vlan_hoa;
|
||||
}
|
||||
|
||||
sub i_vlan_membership {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $res;
|
||||
|
||||
my $dot1qVlanStaticEgressPorts = $juniper->dot1qVlanCurrentEgressPorts($partial) || $juniper->dot1qVlanStaticEgressPorts($partial);
|
||||
my $bp_index = $juniper->bp_index();
|
||||
foreach my $vlan (keys %$dot1qVlanStaticEgressPorts) {
|
||||
my @bp_indexes = split /,/, $dot1qVlanStaticEgressPorts->{$vlan};
|
||||
push @{$res->{$bp_index->{$_}}}, $vlan for @bp_indexes;
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
sub qb_fw_vlan {
|
||||
my $juniper = shift;
|
||||
|
||||
my $qb_fw_vlan = $juniper->SUPER::qb_fw_vlan();
|
||||
my $v_fdb_id = $juniper->v_fdb_id();
|
||||
my $v_vlan_tag = $juniper->v_vlan_tag();
|
||||
return $qb_fw_vlan unless $v_fdb_id && $v_vlan_tag;
|
||||
my %fdb_id_to_tag = reverse %$v_fdb_id;
|
||||
|
||||
foreach my $key (keys %$qb_fw_vlan) {
|
||||
my $v = $qb_fw_vlan->{$key};
|
||||
$qb_fw_vlan->{$key} = $v_vlan_tag->{$fdb_id_to_tag{$v}};
|
||||
}
|
||||
|
||||
return $qb_fw_vlan;
|
||||
}
|
||||
|
||||
# Pseudo ENTITY-MIB methods
|
||||
|
||||
# This class supports both virtual chassis (stackable) and physical chassis
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::IEEE802dot11;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
@@ -80,18 +80,39 @@ sub os_ver {
|
||||
return $descr;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $nexus = shift;
|
||||
sub _get_snmpid_chassis {
|
||||
my $self = shift;
|
||||
my $funcname = (caller(0))[3]; # Name of this sub, including package, used for debug logging
|
||||
|
||||
my $e_parent = $nexus->e_parent();
|
||||
my $snmpid_chassis;
|
||||
my $position;
|
||||
|
||||
foreach my $iid ( keys %$e_parent ) {
|
||||
my $parent = $e_parent->{$iid};
|
||||
if ( $parent eq '0' ) {
|
||||
my $serial = $nexus->e_serial($iid);
|
||||
return $serial->{$iid};
|
||||
my $entity_entry = $self->e_class;
|
||||
for ( keys %$entity_entry ) {
|
||||
# filter by class (chassis is 3, but with proper MIBs loaded we should get the translated textual value)
|
||||
if ( ($entity_entry->{$_} eq 'chassis') or ($entity_entry->{$_} eq '3') ) {
|
||||
printf("%s - chassis with id %s found, position %s\n", $funcname, $_, $self->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 ) {
|
||||
printf(" %s - chassis with id %s, position %s selected\n", $funcname, $snmpid_chassis, $position);
|
||||
} else {
|
||||
printf(" %s - no chassis found\n", $funcname);
|
||||
}
|
||||
|
||||
return $snmpid_chassis;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $nexus = shift;
|
||||
my $snmpid_chassis = $nexus->_get_snmpid_chassis;
|
||||
return $nexus->e_serial($snmpid_chassis)->{$snmpid_chassis} if defined $snmpid_chassis;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -102,9 +123,7 @@ sub model {
|
||||
my $id = $nexus->id();
|
||||
|
||||
unless ( defined $id ) {
|
||||
print
|
||||
" SNMP::Info::Layer3::Nexus::model() - Device does not support sysObjectID\n"
|
||||
if $nexus->debug();
|
||||
print " SNMP::Info::Layer3::Nexus::model() - Device does not support sysObjectID\n" if $nexus->debug();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '3.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
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.35';
|
||||
|
||||
%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.30';
|
||||
$VERSION = '3.35';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS,
|
||||
@@ -174,6 +174,7 @@ 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();
|
||||
@@ -203,7 +204,7 @@ sub interfaces {
|
||||
$if{$index} = 'Cpu.Virtual';
|
||||
}
|
||||
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[48]/ ) ) {
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[478]/ ) ) {
|
||||
$if{$index} = 'Mgmt.1';
|
||||
}
|
||||
|
||||
@@ -231,11 +232,18 @@ sub interfaces {
|
||||
}
|
||||
|
||||
else {
|
||||
my $port = ( $index % $index_factor ) + $port_offset;
|
||||
my $slot = int( $index / $index_factor ) + $slot_offset;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -388,7 +396,7 @@ sub i_name {
|
||||
$i_name{$iid} = 'CPU Virtual Management IP';
|
||||
}
|
||||
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[48]/ ) ) {
|
||||
elsif ( ( $iid == 64 ) and ( $model =~ /^VSP[478]/ ) ) {
|
||||
$i_name{$iid} = 'Mgmt Port';
|
||||
}
|
||||
|
||||
@@ -591,7 +599,7 @@ sub slot_offset {
|
||||
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[48]/ );
|
||||
if ( defined $model and $model =~ /^VSP[478]/ );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user