Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7db0371aa | ||
|
|
53860aaa46 | ||
|
|
829a4bf16a | ||
|
|
ead15a1cde | ||
|
|
9c19c70029 | ||
|
|
0862047241 | ||
|
|
6cfce1916d | ||
|
|
1e37bfa8ce | ||
|
|
87197067a0 | ||
|
|
8264f68f6c | ||
|
|
3e21357e8d | ||
|
|
ee5953d743 | ||
|
|
46f941b416 | ||
|
|
225e12e979 | ||
|
|
912ba274a6 | ||
|
|
18f59db2b9 | ||
|
|
f0ca1a5fa3 | ||
|
|
446e5a13f7 | ||
|
|
e8a9d18445 | ||
|
|
6256f33079 | ||
|
|
b5c4bd99bf | ||
|
|
56dae91c8a | ||
|
|
0661b1307a | ||
|
|
cd112f4925 |
26
ChangeLog
26
ChangeLog
@@ -1,5 +1,31 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
|
||||
version 2.09 (2012-11-28)
|
||||
|
||||
[NEW FEATURES]
|
||||
|
||||
* New method i_ssidmac() to get BSSID's from AP's with initial support
|
||||
in L2::Aironet and Airespace classes
|
||||
* Support for Avaya Secure Routers in new class L3::Tasman
|
||||
* Add EDP and LLDP L2 Topology to L3::Extreme
|
||||
* [3185393] Support for Juniper SSL VPN in new class L7::Neoteris
|
||||
* [3381027] Support for Cisco Nexus in new class L3::Nexus
|
||||
* [1424336] Support for Extreme Discovery Protocol (EDP)
|
||||
|
||||
[ENHANCEMENTS]
|
||||
|
||||
* [3017571] Add LLDP support for NetSNMP device class (begemot)
|
||||
* [3418918] Extreme devices now report OS as either extremeware or xos
|
||||
* [2809045] Strip preceding netscreen from model name in L3::Netscreen
|
||||
* [] Classify Linksys 2024 as L3::Dell (Rogier Krieger)
|
||||
|
||||
[BUG FIXES]
|
||||
|
||||
* Fixed logic to return cached data for table methods when available and
|
||||
not a partial fetch
|
||||
* Fix typo in PoD for Bridge.pm and CiscoConfig.pm (William Bulley)
|
||||
* Fix/improve IPv6 neighbor cache handling, especially for Cisco Nexus
|
||||
|
||||
version 2.08 (2012-07-15)
|
||||
|
||||
[NEW FEATURES]
|
||||
|
||||
45
Info.pm
45
Info.pm
@@ -23,7 +23,7 @@ use vars
|
||||
qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
$NOSUCH $BIGINT $REPEATERS/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
=head1 NAME
|
||||
|
||||
@@ -31,7 +31,7 @@ SNMP::Info - Object Oriented Perl5 Interface to Network devices and MIBs through
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
SNMP::Info - Version 2.08
|
||||
SNMP::Info - Version 2.09
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
@@ -321,6 +321,12 @@ F<CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB>
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoVTP> for details.
|
||||
|
||||
=item SNMP::Info::EDP
|
||||
|
||||
Extreme Discovery Protocol. F<EXTREME-EDP-MIB>
|
||||
|
||||
See documentation in L<SNMP::Info::EDP> for details.
|
||||
|
||||
=item SNMP::Info::Entity
|
||||
|
||||
F<ENTITY-MIB>. Used for device info in Cisco and other vendors.
|
||||
@@ -753,6 +759,12 @@ Subclass for Juniper NetScreen.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Netscreen> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Nexus
|
||||
|
||||
Subclass for Cisco Nexus devices running NX-OS
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Nexus> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::PacketFront
|
||||
|
||||
Subclass for PacketFront DRG series CPE.
|
||||
@@ -783,6 +795,12 @@ Subclass for Generic Sun Routers running SunOS.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Sun> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Tasman
|
||||
|
||||
Subclass for Avaya Secure Routers.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Tasman> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Timetra
|
||||
|
||||
Alcatel-Lucent SR Class.
|
||||
@@ -809,6 +827,12 @@ SNMP Interface to APC UPS devices
|
||||
|
||||
See documentation in L<SNMP::Info::Layer7::APC> for details.
|
||||
|
||||
=item SNMP::Info::Layer7::Neoteris
|
||||
|
||||
SNMP Interface to Juniper SSL VPN appliances
|
||||
|
||||
See documentation in L<SNMP::Info::Layer7::Neoteris> for details.
|
||||
|
||||
=back
|
||||
|
||||
=back
|
||||
@@ -1305,6 +1329,7 @@ sub device_type {
|
||||
|
||||
my %l7sysoidmap = (
|
||||
318 => 'SNMP::Info::Layer7::APC',
|
||||
12532 => 'SNMP::Info::Layer7::Neoteris',
|
||||
);
|
||||
|
||||
# Get just the enterprise number for generic mapping
|
||||
@@ -1358,6 +1383,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /cisco/i and $desc =~ /CBS3[0-9A-Za-z]{3}/ );
|
||||
|
||||
# Cisco Nexus running NX-OS
|
||||
$objtype = 'SNMP::Info::Layer3::Nexus'
|
||||
if ( $desc =~ /^Cisco\s+NX-OS/ );
|
||||
|
||||
# HP, older ProCurve models (1600, 2400, 2424m, 4000, 8000)
|
||||
$objtype = 'SNMP::Info::Layer2::HP4000'
|
||||
if $desc =~ /\b(J4093A|J4110A|J4120A|J4121A|J4122A|J4122B)\b/;
|
||||
@@ -1392,6 +1421,10 @@ sub device_type {
|
||||
# Cisco FWSM
|
||||
$objtype = 'SNMP::Info::Layer3::CiscoFWSM'
|
||||
if ( $desc =~ /Cisco Firewall Services Module/i );
|
||||
|
||||
# Avaya Secure Router
|
||||
$objtype = 'SNMP::Info::Layer3::Tasman'
|
||||
if ( $desc =~ /^(avaya|nortel)\s+(SR|secure\srouter)\s+\d{4}/i );
|
||||
|
||||
# HP VirtualConnect blade switches
|
||||
$objtype = 'SNMP::Info::Layer2::HPVC'
|
||||
@@ -1450,10 +1483,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::Dell'
|
||||
if ( $desc =~ /^IBM Gigabit Ethernet Switch Module$/ );
|
||||
|
||||
# Linksys 2048
|
||||
# Linksys 2024/2048
|
||||
$objtype = 'SNMP::Info::Layer3::Dell'
|
||||
if (
|
||||
$desc =~ /^48-Port 10\/100\/1000 Gigabit Switch with WebView$/ );
|
||||
$desc =~ /^(24|48)-Port 10\/100\/1000 Gigabit Switch (with |w\/)WebView$/ );
|
||||
|
||||
# Centillion ATM
|
||||
$objtype = 'SNMP::Info::Layer2::Centillion' if ( $desc =~ /MCP/ );
|
||||
@@ -3825,11 +3858,11 @@ sub AUTOLOAD {
|
||||
# Load data if it both not cached and we are not requesting partial info.
|
||||
if ( defined $funcs{$attr} ) {
|
||||
return $self->_load_attr( $attr, $funcs{$attr}, @_ )
|
||||
unless ( defined $self->{"_${attr}"} and !scalar(@_) );
|
||||
unless ( defined $self->{"_${attr}"} and !defined $_[0] );
|
||||
}
|
||||
if ($table_leaf) {
|
||||
return $self->_load_attr( $attr, $attr, @_ )
|
||||
unless ( defined $self->{"_${attr}"} and !scalar(@_) );
|
||||
unless ( defined $self->{"_${attr}"} and !defined $_[0] );
|
||||
}
|
||||
|
||||
return $self->_show_attr($attr);
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'ADSL-LINE-MIB' => 'adslLineType' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
@@ -421,11 +421,12 @@ sub i_mac {
|
||||
next unless defined $mac;
|
||||
$i_mac{$iid} = $mac;
|
||||
}
|
||||
|
||||
# Don't grab AP MACs - we want the AP to show up on edge switch
|
||||
# ports
|
||||
elsif ( $index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/ ) {
|
||||
$index =~ s/\.\d+$//;
|
||||
next unless defined $index;
|
||||
$i_mac{$iid} = $index;
|
||||
}
|
||||
# Some switch interfaces have MACs, virtuals report 00:00:00:00:00:00
|
||||
|
||||
else {
|
||||
my $mac = $if_mac->{$iid};
|
||||
next unless defined $mac;
|
||||
@@ -659,6 +660,60 @@ sub i_ssidbcast {
|
||||
return \%i_ssidbcast;
|
||||
}
|
||||
|
||||
# Secret decoder ring for BSSID: https://supportforums.cisco.com/docs/DOC-2935
|
||||
# We need radio base MAC, SSID index, radio band, and whether AP is
|
||||
# VxWorks or IOS based then we can do the arithmetic
|
||||
|
||||
sub i_ssidmac {
|
||||
my $airespace = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $ssidlist = $airespace->i_ssidlist($partial) || {};
|
||||
my $apif_type = $airespace->airespace_apif_type() || {};
|
||||
my $ap_ios = $airespace->bsnAPIOSVersion() || {};
|
||||
|
||||
my %i_ssidmac;
|
||||
foreach my $oid ( keys %$ssidlist ) {
|
||||
|
||||
my @parts = split( /\./, $oid );
|
||||
my $ssid_idx = pop (@parts);
|
||||
my $slot = pop (@parts);
|
||||
my $last = pop (@parts);
|
||||
|
||||
my $iid = $oid;
|
||||
# Get radio band
|
||||
$iid =~ s/\.\d+$//;
|
||||
my $ap_type = $apif_type->{$iid};
|
||||
# Determine if IOS based
|
||||
$iid =~ s/\.\d+$//;
|
||||
my $ios = $ap_ios->{$iid} || '';
|
||||
|
||||
# Four cases:
|
||||
# IOS and 2.4Ghz count up, starts at zero
|
||||
if ($ios and $ap_type =~ /b$/) {
|
||||
$last = $last + ($ssid_idx - 1);
|
||||
}
|
||||
# IOS and 5Ghz - count down from maximum of 16
|
||||
elsif ($ios and $ap_type =~ /a$/) {
|
||||
$last = $last + (16 - $ssid_idx);
|
||||
}
|
||||
# VxWorks and 5Ghz - count up, starts at zero
|
||||
elsif ($ios and $ap_type =~ /a$/) {
|
||||
$last = $last + ($ssid_idx - 1);
|
||||
}
|
||||
# VxWorks and 2.4Ghz - count down from maximum of 16
|
||||
else {
|
||||
$last = $last + (16 - $ssid_idx);
|
||||
}
|
||||
|
||||
push (@parts, $last);
|
||||
my $bssid = join( ':', map { sprintf( "%02x", $_ ) } @parts );
|
||||
$i_ssidmac{$oid} = $bssid;
|
||||
}
|
||||
|
||||
return \%i_ssidmac;
|
||||
}
|
||||
|
||||
sub i_80211channel {
|
||||
my $airespace = shift;
|
||||
my $partial = shift;
|
||||
@@ -1188,6 +1243,11 @@ interface.
|
||||
Returns reference to hash. Current transmit power, in milliwatts, of the
|
||||
radio interface.
|
||||
|
||||
=item $airespace->i_ssidmac()
|
||||
|
||||
With the same keys as i_ssidlist, returns the Basic service set
|
||||
identification (BSSID), MAC address, the AP is using for the SSID.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Dot11 Ess Table (C<bsnDot11EssTable>)
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||
@@ -631,7 +631,7 @@ identifier (iid)
|
||||
|
||||
Returns reference to hash of forwarding table entries status
|
||||
|
||||
(C<dot2dTpFdbStatus>)
|
||||
(C<dot1dTpFdbStatus>)
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
%MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' );
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
|
||||
@@ -449,7 +449,7 @@ devices running older code revisions.
|
||||
|
||||
Example:
|
||||
$ciscoconfig->copy_run_tftp('1.2.3.4', 'myconfig')
|
||||
or die Couldn't save config. ",$ciscoconfig->error(1);
|
||||
or die "Couldn't save config. ",$ciscoconfig->error(1);
|
||||
|
||||
=item $ciscoconfig->copy_run_start()
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'CISCO-IMAGE-MIB' => 'ciscoImageString', );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PAECAPABILITIES/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'SNMPv2-MIB' => 'sysDescr',
|
||||
|
||||
@@ -35,7 +35,7 @@ use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/;
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
@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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
|
||||
295
Info/EDP.pm
Normal file
295
Info/EDP.pm
Normal file
@@ -0,0 +1,295 @@
|
||||
# SNMP::Info::EDP
|
||||
#
|
||||
# Copyright (c) 2012 Eric Miller
|
||||
# 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::EDP;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::LLDP::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::LLDP::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'EXTREME-EDP-MIB' => 'extremeEdpPortIfIndex',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
# EXTREME-EDP-MIB::extremeEdpTable
|
||||
'edp_rem_sysname' => 'extremeEdpNeighborName',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
'edp_rem_sysname' => \&SNMP::Info::munge_null,
|
||||
);
|
||||
|
||||
sub hasEDP {
|
||||
my $edp = shift;
|
||||
|
||||
my $edp_ip = $edp->extremeEdpNeighborVlanIpAddress() || {};
|
||||
|
||||
return 1 if ( scalar( keys %$edp_ip ) );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
# Since we need to get IP Addresses from the extremeEdpNeighborTable which has
|
||||
# a different index (adds VLAN name) than the extremeEdpTable which holds
|
||||
# the remote device details use the index from extremeEdpNeighborTable but skip
|
||||
# indexes which have an address of 0.0.0.0. Would like to include only one
|
||||
# address since they should all originate from the same device, but we don't
|
||||
# know if they would all be reachable from the network management application.
|
||||
#
|
||||
# We don't inplement partials since this is private index function
|
||||
sub _edp_index {
|
||||
my $edp = shift;
|
||||
|
||||
my $edp_ip = $edp->extremeEdpNeighborVlanIpAddress() || {};
|
||||
|
||||
my %edp_index;
|
||||
foreach my $key ( keys %$edp_ip ) {
|
||||
my $ip = $edp_ip->{$key};
|
||||
next if ($ip eq '0.0.0.0');
|
||||
next unless $ip;
|
||||
$edp_index{$key} = $key;
|
||||
}
|
||||
return \%edp_index;
|
||||
}
|
||||
|
||||
sub edp_if {
|
||||
my $edp = shift;
|
||||
|
||||
my $index = $edp->_edp_index() || {};
|
||||
|
||||
my %edp_if;
|
||||
foreach my $key (keys %$index) {
|
||||
my $iid = $key;
|
||||
# ifIndex is first part of the iid
|
||||
$iid = $1 if $iid =~ /^(\d+)\./;
|
||||
$edp_if{$key} = $iid;
|
||||
}
|
||||
|
||||
return \%edp_if;
|
||||
}
|
||||
|
||||
sub edp_ip {
|
||||
my $edp = shift;
|
||||
|
||||
my $index = $edp->_edp_index() || {};
|
||||
my $edp_ip = $edp->extremeEdpNeighborVlanIpAddress() || {};
|
||||
|
||||
my %edp_ip;
|
||||
foreach my $key ( keys %$index ) {
|
||||
my $ip = $edp_ip->{$key};
|
||||
# MIB says should only be IPv4
|
||||
next unless ($ip =~ /\d+(\.\d+){3}/);
|
||||
$edp_ip{$key} = $ip;
|
||||
}
|
||||
return \%edp_ip;
|
||||
}
|
||||
|
||||
sub edp_port {
|
||||
my $edp = shift;
|
||||
|
||||
my $index = $edp->_edp_index() || {};
|
||||
my $edp_rport = $edp->extremeEdpNeighborPort() || {};
|
||||
my $edp_rslot = $edp->extremeEdpNeighborSlot() || {};
|
||||
|
||||
my %edp_port;
|
||||
foreach my $key ( sort keys %$edp_rport ) {
|
||||
my $port = $edp_rport->{$key};
|
||||
my $slot = $edp_rslot->{$key} || 0;
|
||||
next unless $port;
|
||||
my $slotport = defined $slot ? "$slot\/$port" : $port;
|
||||
|
||||
foreach my $iid ( sort keys %$index ) {
|
||||
$edp_port{$iid} = $slotport if ($iid =~ /^$key/);
|
||||
}
|
||||
}
|
||||
return \%edp_port;
|
||||
}
|
||||
|
||||
sub edp_id {
|
||||
my $edp = shift;
|
||||
|
||||
my $index = $edp->_edp_index() || {};
|
||||
my $edp_name = $edp->edp_rem_sysname() || {};
|
||||
|
||||
my %edp_name;
|
||||
foreach my $key ( sort keys %$edp_name ) {
|
||||
my $name = $edp_name->{$key} || 0;
|
||||
next unless $name;
|
||||
|
||||
foreach my $iid ( sort keys %$index ) {
|
||||
$edp_name{$iid} = $name if ($iid =~ /^$key/);
|
||||
}
|
||||
}
|
||||
return \%edp_name;
|
||||
}
|
||||
|
||||
sub edp_ver {
|
||||
my $edp = shift;
|
||||
|
||||
my $index = $edp->_edp_index() || {};
|
||||
my $edp_ver = $edp->extremeEdpNeighborSoftwareVersion() || {};
|
||||
|
||||
my %edp_ver;
|
||||
foreach my $key ( sort keys %$edp_ver ) {
|
||||
my $ver = $edp_ver->{$key} || 0;
|
||||
next unless $ver;
|
||||
|
||||
foreach my $iid ( sort keys %$index ) {
|
||||
$edp_ver{$iid} = $ver if ($iid =~ /^$key/);
|
||||
}
|
||||
}
|
||||
return \%edp_ver;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::EDP - SNMP Interface to the Extreme Discovery Protocol (EDP)
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $edp = new SNMP::Info (
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'router',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
);
|
||||
|
||||
my $class = $edp->class();
|
||||
print " Using device sub class : $class\n";
|
||||
|
||||
$haslldp = $edp->hasLLDP() ? 'yes' : 'no';
|
||||
|
||||
# Print out a map of device ports with LLDP neighbors:
|
||||
my $interfaces = $edp->interfaces();
|
||||
my $edp_if = $edp->edp_if();
|
||||
my $edp_ip = $edp->edp_ip();
|
||||
my $edp_port = $edp->edp_port();
|
||||
|
||||
foreach my $edp_key (keys %$edp_ip){
|
||||
my $iid = $edp_if->{$edp_key};
|
||||
my $port = $interfaces->{$iid};
|
||||
my $neighbor = $edp_ip->{$edp_key};
|
||||
my $neighbor_port = $edp_port->{$edp_key};
|
||||
print "Port : $port connected to $neighbor / $neighbor_port\n";
|
||||
}
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::EDP is a subclass of SNMP::Info that provides an object oriented
|
||||
interface to EDP information through SNMP.
|
||||
|
||||
EDP is a Layer 2 protocol that allows a network device to advertise its
|
||||
identity and capabilities on the local network providing topology information.
|
||||
|
||||
Create or use a device subclass that inherits this class. Do not use
|
||||
directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
None.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<EXTREME-EDP-MIB>
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBAL METHODS
|
||||
|
||||
These are methods that return scalar values from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $edp->hasEDP()
|
||||
|
||||
Is EDP is active in this device?
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=item $edp->edp_id()
|
||||
|
||||
Returns the string value used to identify the chassis component associated
|
||||
with the remote system.
|
||||
|
||||
(C<extremeEdpNeighborName>)
|
||||
|
||||
=item $edp->edp_if()
|
||||
|
||||
Returns the mapping to the SNMP Interface Table.
|
||||
|
||||
=item $edp->edp_ip()
|
||||
|
||||
Returns remote IPv4 address.
|
||||
|
||||
=item $edp->edp_port()
|
||||
|
||||
Returns remote port ID
|
||||
|
||||
=item $edp->edp_ver()
|
||||
|
||||
Returns the operating system version of the remote system.
|
||||
|
||||
Nulls are removed before the value is returned.
|
||||
|
||||
(C<extremeEdpNeighborSoftwareVersion>)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'ENTITY-MIB' => 'entPhysicalSerialNum' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'IEEE802dot11-MIB' => 'dot11DesiredSSID', );
|
||||
|
||||
|
||||
15
Info/IPv6.pm
15
Info/IPv6.pm
@@ -44,7 +44,7 @@ use constant {
|
||||
IPV6MIB => 3,
|
||||
};
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
|
||||
|
||||
@@ -137,8 +137,17 @@ sub ipv6_n2p_addr {
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
my $v6_packed = pack("C*", split(/\./, $v6addr));
|
||||
$v6addr = join(':', map { sprintf("%04x", $_) } unpack("n*", $v6_packed) );
|
||||
$return->{$row} = $v6addr;
|
||||
if (length($v6_packed) == 15) {
|
||||
# Workaround for some some IP-MIB implementations, eg on Cisco Nexus: no explicit addrsize,
|
||||
# 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) == 16) {
|
||||
$v6addr = join(':', map { sprintf("%04x", $_) } unpack("n*", $v6_packed) );
|
||||
$return->{$row} = $v6addr;
|
||||
} else {
|
||||
printf("Invalid size for IPv6 address: expected 16 bytes, got %d (%s = %s)\n", length($v6_packed), $row, $net_addr->{$row});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
16
Info/LLDP.pm
16
Info/LLDP.pm
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'LLDP-MIB' => 'lldpLocSysCapEnabled',
|
||||
@@ -95,7 +95,7 @@ sub hasLLDP {
|
||||
|
||||
sub lldp_if {
|
||||
my $lldp = shift;
|
||||
my $partial = shift || 0;
|
||||
my $partial = shift;
|
||||
|
||||
my $addr = $lldp->lldp_rem_pid($partial) || {};
|
||||
my $i_descr = $lldp->i_description() || {};
|
||||
@@ -122,7 +122,7 @@ sub lldp_if {
|
||||
|
||||
sub lldp_ip {
|
||||
my $lldp = shift;
|
||||
my $partial = shift || 0;
|
||||
my $partial = shift;
|
||||
|
||||
my $rman_addr = $lldp->lldp_rman_addr($partial) || {};
|
||||
|
||||
@@ -138,7 +138,7 @@ sub lldp_ip {
|
||||
|
||||
sub lldp_addr {
|
||||
my $lldp = shift;
|
||||
my $partial = shift || 0;
|
||||
my $partial = shift;
|
||||
|
||||
my $rman_addr = $lldp->lldp_rman_addr($partial) || {};
|
||||
|
||||
@@ -153,7 +153,7 @@ sub lldp_addr {
|
||||
|
||||
sub lldp_port {
|
||||
my $lldp = shift;
|
||||
my $partial = shift || 0;
|
||||
my $partial = shift;
|
||||
|
||||
my $pdesc = $lldp->lldp_rem_desc($partial) || {};
|
||||
my $pid = $lldp->lldp_rem_pid($partial) || {};
|
||||
@@ -188,7 +188,7 @@ sub lldp_port {
|
||||
|
||||
sub lldp_id {
|
||||
my $lldp = shift;
|
||||
my $partial = shift || 0;
|
||||
my $partial = shift;
|
||||
|
||||
my $ch_type = $lldp->lldp_rem_id_type($partial) || {};
|
||||
my $ch = $lldp->lldp_rem_id($partial) || {};
|
||||
@@ -400,10 +400,6 @@ capability and nothing else."
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
Methods accessing the (C<lldpRemTable>) table use a partial value of zero if
|
||||
not provided to set the (C<lldpRemTimeMark>) TimeMark instance to a known value
|
||||
as per RFC 2021.
|
||||
|
||||
=over
|
||||
|
||||
=item $lldp->lldp_id()
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer1::GLOBALS, 'root_ip' => 'actualIPAddr', );
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# 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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -45,7 +45,7 @@ use SNMP::Info::PowerEthernet;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::IEEE802dot11::GLOBALS,
|
||||
@@ -437,6 +437,26 @@ sub i_ssidbcast {
|
||||
return $i_ssidbcast;
|
||||
}
|
||||
|
||||
sub i_ssidmac {
|
||||
my $aironet = shift;
|
||||
my $partial = shift;
|
||||
my $mbss_mac_addr = $aironet->mbss_mac_addr();
|
||||
|
||||
# Same logic as i_ssidbcast to return same indexes as i_ssidlist
|
||||
my $map = {};
|
||||
foreach my $key ( keys %$mbss_mac_addr ) {
|
||||
my ( $interface, @idx ) = split( /\./, $key );
|
||||
$map->{ pack( "C*", @idx ) } = $mbss_mac_addr->{$key};
|
||||
}
|
||||
|
||||
my $i_ssidlist = $aironet->i_ssidlist();
|
||||
my $i_ssidmac = {};
|
||||
foreach my $key ( keys %$i_ssidlist ) {
|
||||
$i_ssidmac->{$key} = $map->{ $i_ssidlist->{$key} };
|
||||
}
|
||||
return $i_ssidmac;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -623,6 +643,11 @@ to which they belong.
|
||||
With the same keys as i_ssidlist, returns whether the given SSID is
|
||||
being broadcast.
|
||||
|
||||
=item $aironet->i_ssidmac()
|
||||
|
||||
With the same keys as i_ssidlist, returns the Basic service set
|
||||
identification (BSSID), MAC address, the AP is using for the SSID.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = (
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::LLDP::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
|
||||
@@ -47,7 +47,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS, %SNMP::Info::CiscoConfig::GLOBALS,
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::CiscoPortSecurity::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::CiscoConfig::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::FDP::MIBS,
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::IEEE802dot11::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS, %SNMP::Info::LLDP::MIBS, );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
@@ -51,7 +51,7 @@ use SNMP::Info::AdslLine;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -64,7 +64,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -66,7 +66,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
|
||||
@@ -52,7 +52,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3::Cisco;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::Cisco::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%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 = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::CDP::MIBS,
|
||||
@@ -166,6 +166,12 @@ sub fw_port {
|
||||
}
|
||||
|
||||
# Use CDP and/or LLDP
|
||||
#
|
||||
# LLDP table timefilter implementation continuously increments when walked
|
||||
# and we may never reach the end of the table. This behavior can be
|
||||
# modified with the "set snmp timefilter break disable" command,
|
||||
# unfortunately it is not the default. Query with a partial value of zero
|
||||
# which means no time filter.
|
||||
|
||||
sub hasCDP {
|
||||
my $enterasys = shift;
|
||||
@@ -178,7 +184,7 @@ sub c_ip {
|
||||
my $partial = shift;
|
||||
|
||||
my $cdp = $enterasys->SUPER::c_ip($partial) || {};
|
||||
my $lldp = $enterasys->lldp_ip($partial) || {};
|
||||
my $lldp = $enterasys->lldp_ip(0) || {};
|
||||
|
||||
my %c_ip;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
@@ -201,7 +207,7 @@ sub c_if {
|
||||
my $enterasys = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $enterasys->lldp_if($partial) || {};
|
||||
my $lldp = $enterasys->lldp_if(0) || {};
|
||||
my $cdp = $enterasys->SUPER::c_if($partial) || {};
|
||||
|
||||
my %c_if;
|
||||
@@ -225,7 +231,7 @@ sub c_port {
|
||||
my $enterasys = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $enterasys->lldp_port($partial) || {};
|
||||
my $lldp = $enterasys->lldp_port(0) || {};
|
||||
my $cdp = $enterasys->SUPER::c_port($partial) || {};
|
||||
|
||||
my %c_port;
|
||||
@@ -249,7 +255,7 @@ sub c_id {
|
||||
my $enterasys = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $enterasys->lldp_id($partial) || {};
|
||||
my $lldp = $enterasys->lldp_id(0) || {};
|
||||
my $cdp = $enterasys->SUPER::c_id($partial) || {};
|
||||
|
||||
my %c_id;
|
||||
@@ -273,7 +279,7 @@ sub c_platform {
|
||||
my $enterasys = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $enterasys->lldp_rem_sysdesc($partial) || {};
|
||||
my $lldp = $enterasys->lldp_rem_sysdesc(0) || {};
|
||||
my $cdp = $enterasys->SUPER::c_platform($partial) || {};
|
||||
|
||||
my %c_platform;
|
||||
|
||||
@@ -36,18 +36,23 @@ use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
use SNMP::Info::LLDP;
|
||||
use SNMP::Info::EDP;
|
||||
|
||||
@SNMP::Info::Layer3::Extreme::ISA
|
||||
= qw/SNMP::Info::Layer3 SNMP::Info::MAU Exporter/;
|
||||
= qw/SNMP::Info::Layer3 SNMP::Info::MAU SNMP::Info::LLDP
|
||||
SNMP::Info::EDP Exporter/;
|
||||
@SNMP::Info::Layer3::Extreme::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
%SNMP::Info::EDP::MIBS,
|
||||
'EXTREME-BASE-MIB' => 'extremeAgent',
|
||||
'EXTREME-SYSTEM-MIB' => 'extremeSystem',
|
||||
'EXTREME-FDB-MIB' => 'extremeSystem',
|
||||
@@ -58,6 +63,8 @@ $VERSION = '2.08';
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
%SNMP::Info::EDP::GLOBALS,
|
||||
'serial1' => 'extremeSystemID.0',
|
||||
'temp' => 'extremeCurrentTemperature',
|
||||
'ps1_status_old' => 'extremePrimaryPowerOperational.0',
|
||||
@@ -70,6 +77,8 @@ $VERSION = '2.08';
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
%SNMP::Info::EDP::FUNCS,
|
||||
'fan_state' => 'extremeFanOperational',
|
||||
|
||||
# EXTREME-FDB-MIB:extremeFdbMacFdbTable
|
||||
@@ -92,6 +101,8 @@ $VERSION = '2.08';
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE,
|
||||
%SNMP::Info::EDP::MUNGE,
|
||||
'ex_fw_mac' => \&SNMP::Info::munge_mac,
|
||||
'ps1_status_old' => \&munge_true_ok,
|
||||
'ps1_status_new' => \&munge_power_stat,
|
||||
@@ -129,7 +140,15 @@ sub vendor {
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'extreme';
|
||||
my $extreme = shift;
|
||||
|
||||
my $desc = $extreme->description();
|
||||
|
||||
if ($desc =~ /xos/i) {
|
||||
return 'xos';
|
||||
}
|
||||
|
||||
return 'extremeware';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
@@ -530,6 +549,125 @@ sub set_add_i_vlan_tagged {
|
||||
return $rv;
|
||||
}
|
||||
|
||||
# Use EDP and/or LLDP
|
||||
sub hasCDP {
|
||||
my $extreme = shift;
|
||||
|
||||
return $extreme->hasLLDP() || $extreme->hasEDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $extreme = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $edp = $extreme->edp_ip() || {};
|
||||
my $lldp = $extreme->lldp_ip($partial) || {};
|
||||
|
||||
my %c_ip;
|
||||
foreach my $iid ( keys %$edp ) {
|
||||
my $ip = $edp->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
$c_ip{$iid} = $ip;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $ip = $lldp->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
$c_ip{$iid} = $ip;
|
||||
}
|
||||
return \%c_ip;
|
||||
}
|
||||
|
||||
sub c_if {
|
||||
my $extreme = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $extreme->lldp_if($partial) || {};
|
||||
my $edp = $extreme->edp_if() || {};
|
||||
|
||||
my %c_if;
|
||||
foreach my $iid ( keys %$edp ) {
|
||||
my $if = $edp->{$iid};
|
||||
next unless defined $if;
|
||||
|
||||
$c_if{$iid} = $if;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $if = $lldp->{$iid};
|
||||
next unless defined $if;
|
||||
|
||||
$c_if{$iid} = $if;
|
||||
}
|
||||
return \%c_if;
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $extreme = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $extreme->lldp_port($partial) || {};
|
||||
my $edp = $extreme->edp_port() || {};
|
||||
|
||||
my %c_port;
|
||||
foreach my $iid ( keys %$edp ) {
|
||||
my $port = $edp->{$iid};
|
||||
next unless defined $port;
|
||||
|
||||
$c_port{$iid} = $port;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $port = $lldp->{$iid};
|
||||
next unless defined $port;
|
||||
$c_port{$iid} = $port;
|
||||
}
|
||||
return \%c_port;
|
||||
}
|
||||
|
||||
sub c_id {
|
||||
my $extreme = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $extreme->lldp_id($partial) || {};
|
||||
my $edp = $extreme->edp_id() || {};
|
||||
|
||||
my %c_id;
|
||||
foreach my $iid ( keys %$edp ) {
|
||||
my $id = $edp->{$iid};
|
||||
next unless defined $id;
|
||||
|
||||
$c_id{$iid} = $id;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $id = $lldp->{$iid};
|
||||
next unless defined $id;
|
||||
|
||||
$c_id{$iid} = $id;
|
||||
}
|
||||
return \%c_id;
|
||||
}
|
||||
|
||||
sub c_platform {
|
||||
my $extreme = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $extreme->lldp_rem_sysdesc($partial) || {};
|
||||
|
||||
my %c_platform;
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $platform = $lldp->{$iid};
|
||||
next unless defined $platform;
|
||||
|
||||
$c_platform{$iid} = $platform;
|
||||
}
|
||||
return \%c_platform;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
@@ -576,6 +714,10 @@ my $extreme = new SNMP::Info::Layer3::Extreme(...);
|
||||
|
||||
=item SNMP::Info::MAU
|
||||
|
||||
=item SNMP::Info::LLDP
|
||||
|
||||
=item SNMP::Info::EDP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -658,12 +800,6 @@ Returns base mac
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
@@ -672,6 +808,14 @@ See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::MAU/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::EDP
|
||||
|
||||
See documentation in L<SNMP::Info::EDP/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -760,6 +904,58 @@ Power supplied by PoE ports, in milliwatts
|
||||
|
||||
=back
|
||||
|
||||
=head2 Topology information
|
||||
|
||||
Based upon the firmware version Extreme devices may support Extreme Discovery
|
||||
Protocol (EDP), Link Layer Discovery Protocol (LLDP), or both. These methods
|
||||
will query both and return the combination of all information. As a result,
|
||||
there may be identical topology information returned from the two protocols
|
||||
causing duplicate entries. It is the calling program's responsibility to
|
||||
identify any duplicate entries and remove duplicates if necessary.
|
||||
|
||||
=over
|
||||
|
||||
=item $extreme->hasCDP()
|
||||
|
||||
Returns true if the device is running either EDP or LLDP.
|
||||
|
||||
=item $extreme->c_if()
|
||||
|
||||
Returns reference to hash. Key: iid Value: local device port (interfaces)
|
||||
|
||||
=item $extreme->c_ip()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote IPv4 address
|
||||
|
||||
If multiple entries exist with the same local port, c_if(), with the same IPv4
|
||||
address, c_ip(), it may be a duplicate entry.
|
||||
|
||||
With EDP multiple entries may exist with the same local port, c_if(), and
|
||||
different IPv4 addresses, c_ip(), as EDP reports addresses for each VLAN
|
||||
transported across the trunk. In the case of LLDP with multiple addresses
|
||||
there is either a non-LLDP device in between two or more devices or multiple
|
||||
devices which are not directly connected.
|
||||
|
||||
Use the data from the Layer2 Topology Table below to dig deeper.
|
||||
|
||||
=item $extreme->c_port()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote port (interfaces)
|
||||
|
||||
=item $extreme->c_id()
|
||||
|
||||
Returns reference to hash. Key: iid Value: string value used to identify the
|
||||
chassis component associated with the remote system.
|
||||
|
||||
=item $extreme->c_platform()
|
||||
|
||||
Returns reference to hash. Key: iid Value: Remote Device Type
|
||||
|
||||
This information is only available from LLDP. EDP does not provide an
|
||||
equivalent.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
||||
@@ -768,6 +964,14 @@ See documentation in L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::MAU/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::EDP
|
||||
|
||||
See documentation in L<SNMP::Info::EDP/"TABLE METHODS"> for details.
|
||||
|
||||
=head1 SET METHODS
|
||||
|
||||
These are methods that provide SNMP set functionality for overridden methods
|
||||
@@ -818,7 +1022,6 @@ with the numeric VLAN ID and port C<ifIndex>.
|
||||
$extreme->set_remove_i_vlan_tagged('2', $if_map{'FastEthernet0/1'})
|
||||
or die "Couldn't add port to egress list. ",$extreme->error(1);
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head1 Data Munging Callback Subroutines
|
||||
|
||||
@@ -44,7 +44,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -273,7 +273,7 @@ sub stp_p_state {
|
||||
sub hasCDP {
|
||||
my $foundry = shift;
|
||||
|
||||
return $foundry->hasLLDP() || $foundry->SUPER::hasCDP();
|
||||
return $foundry->hasLLDP() || $foundry->hasFDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -33,16 +33,18 @@ package SNMP::Info::Layer3::NetSNMP;
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::LLDP;
|
||||
|
||||
@SNMP::Info::Layer3::NetSNMP::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::NetSNMP::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::NetSNMP::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
'UCD-SNMP-MIB' => 'versionTag',
|
||||
'NET-SNMP-TC' => 'netSnmpAgentOIDs',
|
||||
'HOST-RESOURCES-MIB' => 'hrSystem',
|
||||
@@ -50,13 +52,20 @@ $VERSION = '2.08';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
'netsnmp_vers' => 'versionTag',
|
||||
'hrSystemUptime' => 'hrSystemUptime',
|
||||
);
|
||||
|
||||
%FUNCS = ( %SNMP::Info::Layer3::FUNCS, );
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
return 'Net-SNMP';
|
||||
@@ -121,6 +130,42 @@ sub i_ignore {
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
# Use LLDP
|
||||
sub hasCDP {
|
||||
my $netsnmp = shift;
|
||||
return $netsnmp->hasLLDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $netsnmp = shift;
|
||||
my $partial = shift;
|
||||
return $netsnmp->lldp_ip($partial);
|
||||
}
|
||||
|
||||
sub c_if {
|
||||
my $netsnmp = shift;
|
||||
my $partial = shift;
|
||||
return $netsnmp->lldp_if($partial);
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $netsnmp = shift;
|
||||
my $partial = shift;
|
||||
return $netsnmp->lldp_port($partial);
|
||||
}
|
||||
|
||||
sub c_id {
|
||||
my $netsnmp = shift;
|
||||
my $partial = shift;
|
||||
return $netsnmp->lldp_id($partial);
|
||||
}
|
||||
|
||||
sub c_platform {
|
||||
my $netsnmp = shift;
|
||||
my $partial = shift;
|
||||
return $netsnmp->lldp_rem_sysdesc($partial);
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -173,6 +218,8 @@ Subclass for Generic Net-SNMP devices
|
||||
|
||||
See L<SNMP::Info::Layer3> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::LLDP> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -210,6 +257,10 @@ Returns ''.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -227,10 +278,54 @@ Ignores loopback
|
||||
|
||||
=back
|
||||
|
||||
=head2 Topology information
|
||||
|
||||
Link Layer Discovery Protocol (LLDP) support. The device must be running
|
||||
an optional LLDP agent, such as lldpd, which can integrate with the SNMP agent.
|
||||
|
||||
=over
|
||||
|
||||
=item $netsnmp->hasCDP()
|
||||
|
||||
Returns true if the device is running LLDP.
|
||||
|
||||
=item $netsnmp->c_if()
|
||||
|
||||
Returns reference to hash. Key: iid Value: local device port (interfaces)
|
||||
|
||||
=item $netsnmp->c_ip()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote IPv4 address
|
||||
|
||||
If multiple entries exist with the same local port, c_if(), with different
|
||||
IPv4 addresses, c_ip(), there is either a non-LLDP device in between two
|
||||
or more devices or multiple devices which are not directly connected.
|
||||
|
||||
Use the data from the Layer2 Topology Table below to dig deeper.
|
||||
|
||||
=item $netsnmp->c_port()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote port (interfaces)
|
||||
|
||||
=item $netsnmp->c_id()
|
||||
|
||||
Returns reference to hash. Key: iid Value: string value used to identify the
|
||||
chassis component associated with the remote system.
|
||||
|
||||
=item $netsnmp->c_platform()
|
||||
|
||||
Returns reference to hash. Key: iid Value: Remote Device Type
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP> for details.
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
In order to cause SNMP::Info to classify your device into this class, it
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -92,6 +92,26 @@ sub serial {
|
||||
return;
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $netscreen = shift;
|
||||
|
||||
my $id = $netscreen->id();
|
||||
|
||||
unless ( defined $id ) {
|
||||
print
|
||||
" SNMP::Info::Layer3::model() - Device does not support sysObjectID\n"
|
||||
if $netscreen->debug();
|
||||
return;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^netscreen//i;
|
||||
return $model;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
@@ -161,6 +181,10 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $netscreen->model()
|
||||
|
||||
(C<chassisModel>)
|
||||
|
||||
=item $netscreen->vendor()
|
||||
|
||||
Returns 'netscreen'
|
||||
|
||||
564
Info/Layer3/Nexus.pm
Normal file
564
Info/Layer3/Nexus.pm
Normal file
@@ -0,0 +1,564 @@
|
||||
# SNMP::Info::Layer3::Nexus
|
||||
#
|
||||
# Copyright (c) 2012 Eric Miller
|
||||
# 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::Nexus;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::LLDP;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoImage;
|
||||
use SNMP::Info::CiscoPortSecurity;
|
||||
use SNMP::Info::CiscoConfig;
|
||||
use SNMP::Info::CiscoPower;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::CiscoStpExtensions;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
# NOTE : Top-most items gets precedence for @ISA
|
||||
@SNMP::Info::Layer3::Nexus::ISA = qw/
|
||||
SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CiscoStpExtensions
|
||||
SNMP::Info::LLDP
|
||||
SNMP::Info::CDP
|
||||
SNMP::Info::CiscoImage
|
||||
SNMP::Info::CiscoPortSecurity
|
||||
SNMP::Info::CiscoConfig
|
||||
SNMP::Info::CiscoPower
|
||||
SNMP::Info::Layer3
|
||||
Exporter
|
||||
/;
|
||||
|
||||
@SNMP::Info::Layer3::Nexus::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.09';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
# Bridge is called from Layer3 and CiscoStpExtensions
|
||||
# So we want CiscoVTP to come last to get the right one.
|
||||
# The @ISA order should be reverse of these orders.
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoPower::MIBS,
|
||||
%SNMP::Info::CiscoConfig::MIBS,
|
||||
%SNMP::Info::CiscoPortSecurity::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
%SNMP::Info::CiscoStpExtensions::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
'CISCO-ENTITY-VENDORTYPE-OID-MIB' => 'cevMIBObjects',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::CiscoPower::GLOBALS,
|
||||
%SNMP::Info::CiscoConfig::GLOBALS,
|
||||
%SNMP::Info::CiscoPortSecurity::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStpExtensions::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
'mac' => 'dot1dBaseBridgeAddress',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::CiscoPower::FUNCS,
|
||||
%SNMP::Info::CiscoConfig::FUNCS,
|
||||
%SNMP::Info::CiscoPortSecurity::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
%SNMP::Info::CiscoStpExtensions::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
);
|
||||
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::CiscoPower::MUNGE,
|
||||
%SNMP::Info::CiscoConfig::MUNGE,
|
||||
%SNMP::Info::CiscoPortSecurity::MUNGE,
|
||||
%SNMP::Info::CiscoImage::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE,
|
||||
%SNMP::Info::CiscoStpExtensions::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
);
|
||||
|
||||
sub cisco_comm_indexing { return 1; }
|
||||
|
||||
sub vendor {
|
||||
return 'cisco';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'nx-os';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $nexus = shift;
|
||||
my $descr = $nexus->description();
|
||||
|
||||
return $1 if ( $descr =~ /\),\s+Version\s+(.+?),/ );
|
||||
return $descr;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $nexus = shift;
|
||||
|
||||
my $e_class = $nexus->e_class();
|
||||
|
||||
foreach my $iid ( keys %$e_class ) {
|
||||
my $class = $e_class->{$iid} || '';
|
||||
if ($class =~ /chassis/) {
|
||||
my $serial = $nexus->e_serial($iid);
|
||||
return $serial->{$iid};
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# sysObjectID returns an IID to an entry in the CISCO-ENTITY-VENDORTYPE-OID-MIB.
|
||||
# Look it up and return it.
|
||||
sub model {
|
||||
my $nexus = shift;
|
||||
my $id = $nexus->id();
|
||||
|
||||
unless ( defined $id ) {
|
||||
print
|
||||
" SNMP::Info::Layer3::Nexus::model() - Device does not support sysObjectID\n"
|
||||
if $nexus->debug();
|
||||
return;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^cevChassis//i;
|
||||
return $model;
|
||||
}
|
||||
|
||||
# Use CDP and/or LLDP
|
||||
sub hasCDP {
|
||||
my $nexus = shift;
|
||||
|
||||
return $nexus->hasLLDP() || $nexus->SUPER::hasCDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $nexus = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $cdp = $nexus->SUPER::c_ip($partial) || {};
|
||||
my $lldp = $nexus->lldp_ip($partial) || {};
|
||||
|
||||
my %c_ip;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $ip = $cdp->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
$c_ip{$iid} = $ip;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $ip = $lldp->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
$c_ip{$iid} = $ip;
|
||||
}
|
||||
return \%c_ip;
|
||||
}
|
||||
|
||||
sub c_if {
|
||||
my $nexus = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $nexus->lldp_if($partial) || {};
|
||||
my $cdp = $nexus->SUPER::c_if($partial) || {};
|
||||
|
||||
my %c_if;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $if = $cdp->{$iid};
|
||||
next unless defined $if;
|
||||
|
||||
$c_if{$iid} = $if;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $if = $lldp->{$iid};
|
||||
next unless defined $if;
|
||||
|
||||
$c_if{$iid} = $if;
|
||||
}
|
||||
return \%c_if;
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $nexus = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $nexus->lldp_port($partial) || {};
|
||||
my $cdp = $nexus->SUPER::c_port($partial) || {};
|
||||
|
||||
my %c_port;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $port = $cdp->{$iid};
|
||||
next unless defined $port;
|
||||
|
||||
$c_port{$iid} = $port;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $port = $lldp->{$iid};
|
||||
next unless defined $port;
|
||||
$c_port{$iid} = $port;
|
||||
}
|
||||
return \%c_port;
|
||||
}
|
||||
|
||||
sub c_id {
|
||||
my $nexus = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $nexus->lldp_id($partial) || {};
|
||||
my $cdp = $nexus->SUPER::c_id($partial) || {};
|
||||
|
||||
my %c_id;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $id = $cdp->{$iid};
|
||||
next unless defined $id;
|
||||
|
||||
$c_id{$iid} = $id;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $id = $lldp->{$iid};
|
||||
next unless defined $id;
|
||||
|
||||
$c_id{$iid} = $id;
|
||||
}
|
||||
return \%c_id;
|
||||
}
|
||||
|
||||
sub c_platform {
|
||||
my $nexus = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $nexus->lldp_rem_sysdesc($partial) || {};
|
||||
my $cdp = $nexus->SUPER::c_platform($partial) || {};
|
||||
|
||||
my %c_platform;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $platform = $cdp->{$iid};
|
||||
next unless defined $platform;
|
||||
|
||||
$c_platform{$iid} = $platform;
|
||||
}
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $platform = $lldp->{$iid};
|
||||
next unless defined $platform;
|
||||
|
||||
$c_platform{$iid} = $platform;
|
||||
}
|
||||
return \%c_platform;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Nexus - SNMP Interface to Cisco Nexus Switches running
|
||||
NX-OS
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $nexus = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $nexus->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Abstraction subclass for Cisco Nexus Switches running NX-OS.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not
|
||||
after determining a more specific class using the method above.
|
||||
|
||||
my $nexus = new SNMP::Info::Layer3::Nexus(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::CiscoVTP
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
|
||||
=item SNMP::Info::CiscoPortSecurity
|
||||
|
||||
=item SNMP::Info::CiscoConfig
|
||||
|
||||
=item SNMP::Info::CiscoPower
|
||||
|
||||
=item SNMP::Info::CiscoStpExtensions
|
||||
|
||||
=item SNMP::Info::LLDP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<CISCO-ENTITY-VENDORTYPE-OID-MIB>
|
||||
|
||||
=back
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoVTP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CDP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoImage/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoPortSecurity/"Required MIBs"> for its own MIB
|
||||
requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoConfig/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoPower/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CiscoStpExtensions/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::LLDP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return a scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $nexus->vendor()
|
||||
|
||||
Returns 'cisco'
|
||||
|
||||
=item $nexus->os()
|
||||
|
||||
Returns 'nx-os'
|
||||
|
||||
=item $nexus->os_ver()
|
||||
|
||||
Returns operating system version extracted fron C<sysDescr>.
|
||||
|
||||
=item $nexus->serial()
|
||||
|
||||
Returns the serial number of the chassis from F<ENTITY-MIB>.
|
||||
|
||||
=item $nexus->model()
|
||||
|
||||
Tries to reference $nexus->id() to F<CISCO-ENTITY-VENDORTYPE-OID-MIB>
|
||||
|
||||
Removes 'cevChassis' for readability.
|
||||
|
||||
=item $nexus->mac()
|
||||
|
||||
C<dot1dBaseBridgeAddress>
|
||||
|
||||
=item $nexus->cisco_comm_indexing()
|
||||
|
||||
Returns 1. Use vlan indexing.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoVTP/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in L<SNMP::Info::CDP/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoImage/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoPortSecurity
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoPortSecurity/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoConfig
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoConfig/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoPower
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoPower/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStpExtensions
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoStpExtensions/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Topology information
|
||||
|
||||
Based upon the firmware version Cisco devices may support Link Layer Discover
|
||||
Protocol (LLDP) in addition to the Cisco-proprietary CDP. These methods
|
||||
will query both and return the combination of all information. As a result,
|
||||
there may be identical topology information returned from the two protocols
|
||||
causing duplicate entries. It is the calling program's responsibility to
|
||||
identify any duplicate entries and remove duplicates if necessary.
|
||||
|
||||
=over
|
||||
|
||||
=item $nexus->hasCDP()
|
||||
|
||||
Returns true if the device is running either CDP or LLDP.
|
||||
|
||||
=item $nexus->c_if()
|
||||
|
||||
Returns reference to hash. Key: iid Value: local device port (interfaces)
|
||||
|
||||
=item $nexus->c_ip()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote IPv4 address
|
||||
|
||||
If multiple entries exist with the same local port, c_if(), with the same IPv4
|
||||
address, c_ip(), it may be a duplicate entry.
|
||||
|
||||
If multiple entries exist with the same local port, c_if(), with different
|
||||
IPv4 addresses, c_ip(), there is either a non-CDP/LLDP device in between two
|
||||
or more devices or multiple devices which are not directly connected.
|
||||
|
||||
Use the data from the Layer2 Topology Table below to dig deeper.
|
||||
|
||||
=item $nexus->c_port()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote port (interfaces)
|
||||
|
||||
=item $nexus->c_id()
|
||||
|
||||
Returns reference to hash. Key: iid Value: string value used to identify the
|
||||
chassis component associated with the remote system.
|
||||
|
||||
=item $nexus->c_platform()
|
||||
|
||||
Returns reference to hash. Key: iid Value: Remote Device Type
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoVTP/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in L<SNMP::Info::CDP/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoStats/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoImage/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoPortSecurity
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoPortSecurity/"TABLE METHODS"> for
|
||||
details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoConfig
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoConfig/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoPower
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoPower/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStpExtensions
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoStpExtensions/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::LLDP
|
||||
|
||||
See documentation in L<SNMP::Info::LLDP/"TABLE METHODS"> for details.
|
||||
|
||||
=cut
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS,
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -36,7 +36,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
278
Info/Layer3/Tasman.pm
Normal file
278
Info/Layer3/Tasman.pm
Normal file
@@ -0,0 +1,278 @@
|
||||
# SNMP::Info::Layer3::Tasman
|
||||
#
|
||||
# Copyright (c) 2012 Eric Miller
|
||||
# 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::Tasman;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
|
||||
@SNMP::Info::Layer3::Tasman::ISA = qw/SNMP::Info::MAU
|
||||
SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Tasman::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
'NT-ENTERPRISE-DATA-MIB' => 'ntEnterpriseRouters',
|
||||
'SYSTEM-MIB' => 'nnsysVersion',
|
||||
'CHASSIS-MIB' => 'nnchassisModel',
|
||||
'ENVIRONMENT-MIB' => 'nnenvPwrsupStatus',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
'ps1_type' => 'nnenvPwrsupType.1',
|
||||
'ps1_status' => 'nnenvPwrsupStatus.1',
|
||||
'ps2_type' => 'nnenvPwrsupType.2',
|
||||
'ps2_status' => 'nnenvPwrsupStatus.2',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
);
|
||||
|
||||
# use MAU-MIB for admin. duplex and admin. speed
|
||||
*SNMP::Info::Layer3::Tasman::i_duplex_admin
|
||||
= \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
*SNMP::Info::Layer3::Tasman::i_speed_admin
|
||||
= \&SNMP::Info::MAU::mau_i_speed_admin;
|
||||
|
||||
sub vendor {
|
||||
return 'avaya';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'tasman';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $tasman = shift;
|
||||
my $version = $tasman->nnsysVersion() || "";
|
||||
my $descr = $tasman->description() || "";
|
||||
|
||||
# Newer versions
|
||||
return $1 if ( $version =~ /^SW:\s+(.+?)\s+/ );
|
||||
# Older versions
|
||||
return $1 if ( $descr =~ /Software Version\s+=\s+[r]*(.+),/);
|
||||
# Can't find
|
||||
return;
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $tasman = shift;
|
||||
|
||||
my $id = $tasman->id();
|
||||
my $ch_model = $tasman->nnchassisModel();
|
||||
|
||||
return $ch_model if $ch_model;
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^ntSecureRouter/SR/;
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $tasman = shift;
|
||||
|
||||
# Newer versions of the software redefined the MIB in a non-backwards
|
||||
# compatible manner. Try the old OID first.
|
||||
my $serial = $tasman->nnchassisOperStatus();
|
||||
# Newer versions populate status, serial should contain some numbers
|
||||
return $serial if ($serial !~ /^\D+$/);
|
||||
|
||||
# Unfortunately newer versions don't seem to populate the newer OID.
|
||||
return $tasman->nnchassisSerialNumber();
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Tasman - SNMP Interface to Avaya Secure Routers
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $tasman = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $tasman->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Avaya Secure Routers
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::MAU
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<NT-ENTERPRISE-DATA-MIB>
|
||||
|
||||
=item F<SYSTEM-MIB>
|
||||
|
||||
=item F<CHASSIS-MIB>
|
||||
|
||||
=item F<ENVIRONMENT-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::MAU/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar values from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $tasman->vendor()
|
||||
|
||||
Returns 'avaya'
|
||||
|
||||
=item $tasman->model()
|
||||
|
||||
Tries to get the model from C<nnchassisModel> and if not available
|
||||
cross references $tasman->id() to F<NT-ENTERPRISE-DATA-MIB>.
|
||||
|
||||
Substitutes 'SR' for 'ntSecureRouter' in the name for readability.
|
||||
|
||||
=item $tasman->os()
|
||||
|
||||
Returns 'tasman'
|
||||
|
||||
=item $tasman->os_ver()
|
||||
|
||||
Grabs the os version from C<nnsysVersion>
|
||||
|
||||
=item $tasman->ps1_type()
|
||||
|
||||
(C<nnenvPwrsupType.1>)
|
||||
|
||||
=item $tasman->ps1_status()
|
||||
|
||||
(C<nnenvPwrsupStatus.1>)
|
||||
|
||||
=item $tasman->ps2_type()
|
||||
|
||||
(C<nnenvPwrsupType.2>)
|
||||
|
||||
=item $tasman->ps2_status()
|
||||
|
||||
(C<nnenvPwrsupStatus.2>)
|
||||
|
||||
=item $tasman->serial()
|
||||
|
||||
Tries both (C<nnchassisOperStatus>) and (C<nnchassisSerialNumber>) as OID's
|
||||
were redefined between versions.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in L<SNMP::Info::MAU/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over 4
|
||||
|
||||
=item $stack->i_duplex_admin()
|
||||
|
||||
Returns reference to hash of iid to administrative duplex setting.
|
||||
|
||||
First checks for fixed gigabit ports which are always full duplex. Next checks
|
||||
the port administrative speed (C<portAdminSpeed>) which if set to
|
||||
autonegotiate then the duplex will also autonegotiate, otherwise it uses the
|
||||
reported port duplex (C<portDuplex>).
|
||||
|
||||
=item $stack->i_speed_admin()
|
||||
|
||||
Returns reference to hash of iid to administrative speed setting.
|
||||
|
||||
C<portAdminSpeed>
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in L<SNMP::Info::MAU/"TABLE METHODS"> for details.
|
||||
|
||||
=cut
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, 'TIMETRA-GLOBAL-MIB' => 'timetraReg', );
|
||||
|
||||
|
||||
@@ -37,9 +37,9 @@ use SNMP::Info;
|
||||
@SNMP::Info::Layer7::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::Layer7::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
@@ -60,11 +60,15 @@ $VERSION = '2.08';
|
||||
|
||||
|
||||
# $l7->model() - Looks at sysObjectID which gives the oid of the system
|
||||
# name, contained in a propriatry MIB.
|
||||
# name, contained in a proprietary MIB.
|
||||
sub model {
|
||||
my $l7 = shift;
|
||||
my $id = $l7->id();
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
# Neoteris (Juniper IVE)
|
||||
$model =~ s/^ive//i;
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
@@ -84,15 +88,35 @@ sub interfaces {
|
||||
my $l7 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $interfaces = $l7->i_index($partial) || {};
|
||||
my $rptr_port = $l7->rptr_port($partial) || {};
|
||||
my $interfaces = $l7->i_index($partial) || {};
|
||||
my $i_descr = $l7->i_description($partial) || {};
|
||||
|
||||
foreach my $port ( keys %$rptr_port ) {
|
||||
$interfaces->{$port} = $port;
|
||||
# Replace the Index with the ifDescr field.
|
||||
foreach my $iid ( keys %$i_descr ) {
|
||||
my $port = $i_descr->{$iid};
|
||||
next unless defined $port;
|
||||
$interfaces->{$iid} = $port;
|
||||
}
|
||||
return $interfaces;
|
||||
}
|
||||
|
||||
sub i_ignore {
|
||||
my $l7 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $i_type = $l7->i_type($partial) || {};
|
||||
|
||||
my %i_ignore = ();
|
||||
|
||||
foreach my $if ( keys %$i_type ) {
|
||||
my $type = $i_type->{$if};
|
||||
$i_ignore{$if}++
|
||||
if $type =~ /(loopback|other|cpu)/i;
|
||||
}
|
||||
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -186,7 +210,6 @@ Cross references $l7->id() with product IDs.
|
||||
Tries to discover the vendor by looking up the enterprise number in
|
||||
C<sysObjectID>.
|
||||
|
||||
|
||||
=back
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info
|
||||
@@ -206,6 +229,12 @@ to a hash.
|
||||
|
||||
Returns reference to the map between IID and physical Port.
|
||||
|
||||
=item $l7->i_ignore()
|
||||
|
||||
Returns reference to hash. Increments value of IID if port is to be ignored.
|
||||
|
||||
Ignores loopback, other, and cpu
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer7;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer7::MIBS,
|
||||
|
||||
164
Info/Layer7/Neoteris.pm
Normal file
164
Info/Layer7/Neoteris.pm
Normal file
@@ -0,0 +1,164 @@
|
||||
# SNMP::Info::Layer7::Neoteris
|
||||
#
|
||||
# Copyright (c) 2012 Eric Miller
|
||||
# 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::Layer7::Neoteris;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer7;
|
||||
|
||||
@SNMP::Info::Layer7::Neoteris::ISA = qw/SNMP::Info::Layer7 Exporter/;
|
||||
@SNMP::Info::Layer7::Neoteris::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer7::MIBS,
|
||||
'UCD-SNMP-MIB' => 'versionTag',
|
||||
'JUNIPER-IVE-MIB' => 'productVersion',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer7::GLOBALS,
|
||||
'os_ver' => 'productVersion',
|
||||
'cpu' => 'iveCpuUtil',
|
||||
);
|
||||
|
||||
%FUNCS = ( %SNMP::Info::Layer7::FUNCS, );
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer7::MUNGE, );
|
||||
|
||||
sub vendor {
|
||||
return 'juniper';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'ive';
|
||||
}
|
||||
|
||||
sub serial {
|
||||
return '';
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer7::Neoteris - SNMP Interface to Juniper SSL VPN appliances
|
||||
|
||||
=head1 AUTHORS
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $neoteris = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $neoteris->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Juniper SSL VPN appliances
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer7
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<UCD-SNMP-MIB>
|
||||
|
||||
=item F<JUNIPER-IVE-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer7> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $neoteris->vendor()
|
||||
|
||||
Returns 'juniper'.
|
||||
|
||||
=item $neoteris->os()
|
||||
|
||||
Returns 'ive'.
|
||||
|
||||
=item $neoteris->os_ver()
|
||||
|
||||
C<productVersion>
|
||||
|
||||
=item $neoteris->cpu()
|
||||
|
||||
C<iveCpuUtil>
|
||||
|
||||
=item $neoteris->serial()
|
||||
|
||||
Returns ''.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer7
|
||||
|
||||
See documentation in L<SNMP::Info::Layer7> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer7
|
||||
|
||||
See documentation in L<SNMP::Info::Layer7> for details.
|
||||
|
||||
=cut
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'MAU-MIB' => 'mauMod' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'POWER-ETHERNET-MIB' => 'pethPsePortDetectionStatus' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = ( 'RAPID-CITY' => 'rapidCity', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.08';
|
||||
$VERSION = '2.09';
|
||||
|
||||
%MIBS = (
|
||||
'SYNOPTICS-ROOT-MIB' => 'synoptics',
|
||||
|
||||
4
MANIFEST
4
MANIFEST
@@ -17,6 +17,7 @@ Info/CiscoStack.pm
|
||||
Info/CiscoStats.pm
|
||||
Info/CiscoStpExtensions.pm
|
||||
Info/CiscoVTP.pm
|
||||
Info/EDP.pm
|
||||
Info/Entity.pm
|
||||
Info/EtherLike.pm
|
||||
Info/FDP.pm
|
||||
@@ -75,14 +76,17 @@ Info/Layer3/Mikrotik.pm
|
||||
Info/Layer3/N1600.pm
|
||||
Info/Layer3/Netscreen.pm
|
||||
Info/Layer3/NetSNMP.pm
|
||||
Info/Layer3/Nexus.pm
|
||||
Info/Layer3/PacketFront.pm
|
||||
Info/Layer3/Passport.pm
|
||||
Info/Layer3/Pf.pm
|
||||
Info/Layer3/SonicWALL.pm
|
||||
Info/Layer3/Sun.pm
|
||||
Info/Layer3/Tasman.pm
|
||||
Info/Layer3/Timetra.pm
|
||||
Info/Layer7.pm
|
||||
Info/Layer7/APC.pm
|
||||
Info/Layer7/Neoteris.pm
|
||||
Info/LLDP.pm
|
||||
Info/MAU.pm
|
||||
Info/NortelStack.pm
|
||||
|
||||
22
README
22
README
@@ -5,7 +5,7 @@ NAME
|
||||
|
||||
VERSION
|
||||
|
||||
SNMP::Info - Version 2.08
|
||||
SNMP::Info - Version 2.09
|
||||
|
||||
AUTHOR
|
||||
|
||||
@@ -276,6 +276,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
SNMP::Info::EDP
|
||||
Extreme Discovery Protocol. EXTREME-EDP-MIB
|
||||
|
||||
See documentation in SNMP::Info::EDP for details.
|
||||
|
||||
SNMP::Info::Entity
|
||||
ENTITY-MIB. Used for device info in Cisco and other vendors.
|
||||
|
||||
@@ -642,6 +647,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Netscreen for details.
|
||||
|
||||
SNMP::Info::Layer3::Nexus
|
||||
Subclass for Cisco Nexus devices running NX-OS
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Nexus for details.
|
||||
|
||||
SNMP::Info::Layer3::PacketFront
|
||||
Subclass for PacketFront DRG series CPE.
|
||||
|
||||
@@ -668,6 +678,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Sun for details.
|
||||
|
||||
SNMP::Info::Layer3::Tasman
|
||||
Subclass for Avaya Secure Routers.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Tasman for details.
|
||||
|
||||
SNMP::Info::Layer3::Timetra
|
||||
Alcatel-Lucent SR Class.
|
||||
|
||||
@@ -683,6 +698,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer7::APC for details.
|
||||
|
||||
SNMP::Info::Layer7::Neoteris
|
||||
SNMP Interface to Juniper SSL VPN appliances
|
||||
|
||||
See documentation in SNMP::Info::Layer7::Neoteris for details.
|
||||
|
||||
Thanks
|
||||
|
||||
Thanks for testing and coding help (in no particular order) to :
|
||||
|
||||
@@ -5,7 +5,7 @@ use File::Glob qw/bsd_glob/;
|
||||
|
||||
my @pms = glob_rec("../Info");
|
||||
|
||||
$new_version = shift @ARGV || '2.08';
|
||||
$new_version = shift @ARGV || '2.09';
|
||||
|
||||
foreach my $p (@pms) {
|
||||
print "$p\n";
|
||||
|
||||
Reference in New Issue
Block a user