Compare commits
48 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
631010ed3f | ||
|
|
8506638e5c | ||
|
|
c0f3a8eb2b | ||
|
|
662d870ad7 | ||
|
|
08746d6b10 | ||
|
|
bc8c8a6061 | ||
|
|
d09e5de229 | ||
|
|
1df1bda641 | ||
|
|
e8612e3779 | ||
|
|
a58d060310 | ||
|
|
a77c539f38 | ||
|
|
b5107b5634 | ||
|
|
6c880bb7b3 | ||
|
|
9297c70d11 | ||
|
|
bfafdc99d9 | ||
|
|
ab111a8e93 | ||
|
|
c2ce3d81e1 | ||
|
|
fb9813af51 | ||
|
|
4fb63d8a7b | ||
|
|
77982188bd | ||
|
|
8748932460 | ||
|
|
6c88df1ac0 | ||
|
|
cacb0777b7 | ||
|
|
bdf5a80868 | ||
|
|
ad1f1933e2 | ||
|
|
d7fe49a028 | ||
|
|
e802ccdc6e | ||
|
|
af2a881142 | ||
|
|
0ccf5409ca | ||
|
|
2529305803 | ||
|
|
bb8fb9d01a | ||
|
|
665f33a482 | ||
|
|
e5f948acda | ||
|
|
c28bbd5728 | ||
|
|
262fa5a3cd | ||
|
|
a58b774443 | ||
|
|
6deceb6bd1 | ||
|
|
808d3fd5c6 | ||
|
|
b82d3b82d9 | ||
|
|
cb8d780d70 | ||
|
|
01cd78c75d | ||
|
|
e7b289c399 | ||
|
|
a9b28c2270 | ||
|
|
5b059e6286 | ||
|
|
2c84636b7f | ||
|
|
2aba8dd8f1 | ||
|
|
41d68936b0 | ||
|
|
cb750624f9 |
30
ChangeLog
30
ChangeLog
@@ -1,6 +1,36 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
ChangeLog $Id$
|
||||
|
||||
version 2.05 (2011-06-23)
|
||||
+ Fix broken function call in L2::Aironet
|
||||
+ Promote L2::Aruba to L3::Aruba, as Aruba devices can be L3 entities and
|
||||
provide L3 information.
|
||||
|
||||
version 2.04 (2011-03-31)
|
||||
+ Support for older HP switch models moved to new L2::HP4000 class
|
||||
+ Fix VLAN changing in L2::HP and L2::HP4000 classes
|
||||
* Updated model lists in HP classes
|
||||
+ [2980782] Added L3::CiscoFWSM for Cisco Firewall Services Modules
|
||||
(Brian De Wolf)
|
||||
+ Added L3::Pf for FreeBSD PFSense Firewalls (max)
|
||||
* Added specific functions for neighbor mgmt addresses to CDP class
|
||||
* Implemented os_bin() method in CiscoStats
|
||||
+ [2980787] Fix for C1900 bp_index not containing interfaces.
|
||||
(Brian De Wolf)
|
||||
+ [2599795] Added vendor_i_type() method to HP and HP4000 clases
|
||||
+ [2688801] Minor modification for obscure Proxim/Orinoco device
|
||||
(jrbinks)
|
||||
+ [3051443] Add PoE measured power per port to Cisco, Extrme and HP
|
||||
classes (jeroenvi)
|
||||
* Minor tweaks to support devices without sysServices
|
||||
* Added Cisco CBS3xxx blade switches to L3::C6500
|
||||
* Fix for FWSMs not being detected properly. Special thanks goes to
|
||||
Jukka Pirhonen for pointing it out. (Brian De Wolf)
|
||||
+ Added support for IPv6 to physical address mapping
|
||||
* Added ME340x to L3::C3550
|
||||
* Added new ProCurve models to HP class
|
||||
* Fixed i_speed_raw not returning raw values (Alexander Hartmaier)
|
||||
|
||||
version 2.01 (06/12/09)
|
||||
+ Added CiscoStpExtensions Class (Carlos Vicente)
|
||||
+ Added Layer3::Arista (fenner)
|
||||
|
||||
29
DEVELOP
Normal file
29
DEVELOP
Normal file
@@ -0,0 +1,29 @@
|
||||
SNMP::Info Developer Guidelines
|
||||
|
||||
Coding Guidelines:
|
||||
- tab-width of 4, no tab characters
|
||||
- keep POD documentation up-to-date
|
||||
- always update ChangeLog before committing
|
||||
- always update DeviceMatrix.txt before committing
|
||||
- check-in required mibs to netdisco-mibs and release new package if needed
|
||||
|
||||
Release and Testing Instructions:
|
||||
- Please see misc/RELEASE in Netdisco
|
||||
( http://netdisco.cvs.sourceforge.net/viewvc/netdisco/misc/RELEASE?view=markup )
|
||||
and follow all testing and release guidelines
|
||||
|
||||
FAQ:
|
||||
- Do I have to update the version number and timestamp in modified files before committing?
|
||||
-> No. These are RCS tags that are automatically updated by CVS when you commit
|
||||
|
||||
- Should I add changes at the top of the ChangeLog?
|
||||
-> Yes. The changelog is created one commit at a time. If there isn't a
|
||||
section for the current version, then add one at the top and put your
|
||||
changes after. You can leave the date field for the release empty ().
|
||||
|
||||
- What should I change the $VERSION to?
|
||||
-> If you are the first person to get to a file after a release, update it
|
||||
to either release++ or "release++ dash cvs".
|
||||
Example: File is marked 2.01, change it to 2.02-cvs with your new changes.
|
||||
Example: File is marked 2.02-cvs, no change until packaging for release when the -cvs is removed.
|
||||
TODO: Is there still an odd/even scheme as introduced by Eric?
|
||||
@@ -39,7 +39,7 @@ class: Layer3::Timetra
|
||||
device: All
|
||||
|
||||
device-family: AOS
|
||||
class: Layer2::Aruba
|
||||
class: Layer3::Aruba
|
||||
device: All
|
||||
|
||||
#
|
||||
@@ -82,17 +82,19 @@ device: All
|
||||
# Aruba
|
||||
#
|
||||
device-vendor: Aruba
|
||||
arpnip: no
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: no
|
||||
class: Layer2::Aruba
|
||||
class: Layer3::Aruba
|
||||
|
||||
device-family: Aruba Wireless Controllers
|
||||
note: Uses proprietary MIBs to provide MAC to port mapping. APs appear as switch ports.
|
||||
|
||||
device: 5000
|
||||
|
||||
device: 6000
|
||||
|
||||
#
|
||||
# Asante
|
||||
#
|
||||
@@ -301,6 +303,11 @@ class: Layer3::C6500
|
||||
|
||||
device: 3750
|
||||
|
||||
device-family: Catalyst Blade Switch 3xxx
|
||||
macsuck: vlan
|
||||
class: Layer3::C6500
|
||||
note: Cisco Blade switches for Dell, FSC, HP and IBM blade system chassis. Limited testing done.
|
||||
|
||||
device-family: Catalyst 4000
|
||||
duplex: write
|
||||
macsuck: vlan
|
||||
@@ -398,7 +405,11 @@ device-family: Firewall
|
||||
class: Layer3::Cisco
|
||||
device: PIX Security Appliance
|
||||
device: Adaptive Security Applicance
|
||||
device: Firewall Services Moduels (FWSM)
|
||||
|
||||
device: Firewall Services Modules (FWSM)
|
||||
note: !Arpnip only available for 4.x software releases.
|
||||
class: Layer3::CiscoFWSM
|
||||
arpnip: yes
|
||||
|
||||
#
|
||||
# Cyclades
|
||||
@@ -473,6 +484,16 @@ device-family: Alpine and Summit
|
||||
device: Alpine 3808
|
||||
device: Summit 7i, 48si
|
||||
|
||||
#
|
||||
# FreeBSD
|
||||
#
|
||||
device-vendor: FreeBSD
|
||||
device-famly: Pf
|
||||
class: Layer3::Pf
|
||||
arpnip: yes
|
||||
cdp: no
|
||||
note: LLDP support might be available. See note in Layer3::Pf
|
||||
|
||||
#
|
||||
# Foundry
|
||||
#
|
||||
@@ -512,30 +533,43 @@ device: FLS624, FLS648
|
||||
# HP
|
||||
#
|
||||
device-vendor: HP
|
||||
class: Layer2::HP
|
||||
note: HP Devices are very widely supported.
|
||||
ver: 2
|
||||
modules: yes
|
||||
|
||||
device-family: HP ProCurve
|
||||
device-family: HP ProCurve (old)
|
||||
class: Layer2::HP4000
|
||||
duplex: both
|
||||
macsuck: yes
|
||||
arpnip: no
|
||||
cdp: yes
|
||||
vlan: write
|
||||
note: CDP and LLDP support are very firmware version dependent
|
||||
note: This list hasn't been updated since 2003
|
||||
note: devices in this class only have CDP support
|
||||
note: VLAN info in HP-VLAN MIB
|
||||
|
||||
device: 2512, 2524
|
||||
ver: 1
|
||||
|
||||
device: 4000,4104GL
|
||||
device: 1600M,2400,2424M,4000,8000
|
||||
duplex: link
|
||||
note: duplex issues?
|
||||
|
||||
device: 4108GL,8000,2626,2650,8000
|
||||
device-family: HP ProCurve (recent)
|
||||
class: Layer2::HP
|
||||
duplex: both
|
||||
macsuck: yes
|
||||
arpnip: no
|
||||
cdp: yes
|
||||
vlan: write
|
||||
note: old firmware versions only have CDP support, more recent have LLDP
|
||||
note: VLAN info in Q-BRIDGE-MIB
|
||||
|
||||
device: 2312,2324,2512,2524
|
||||
ver: 1
|
||||
|
||||
device: 2510,2600,2610,2800,2810,2900,2910al
|
||||
device: 3124,3324XL,3400cl,3500,3500yl
|
||||
device: 4100GL,4200vl,5300XL,5400yy,5400zl
|
||||
device: 6108,6200yl,6400cl,6410cl,6600,6600ml,8200zl
|
||||
|
||||
|
||||
#
|
||||
# Juniper
|
||||
#
|
||||
|
||||
129
Info.pm
129
Info.pm
@@ -1,6 +1,6 @@
|
||||
# SNMP::Info
|
||||
#
|
||||
# Copyright (c) 2003-2009 Max Baker and SNMP::Info Developers
|
||||
# Copyright (c) 2003-2010 Max Baker and SNMP::Info Developers
|
||||
# All rights reserved.
|
||||
#
|
||||
# Portions Copyright (c) 2002-2003, Regents of the University of California
|
||||
@@ -23,7 +23,7 @@ use vars
|
||||
qw/$VERSION $VERSION_CVS %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG %SPEED_MAP
|
||||
$NOSUCH $BIGINT $REPEATERS/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
$VERSION_CVS = '$Id$';
|
||||
|
||||
=head1 NAME
|
||||
@@ -32,12 +32,12 @@ SNMP::Info - Object Oriented Perl5 Interface to Network devices and MIBs through
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
SNMP::Info - Version 2.01
|
||||
SNMP::Info - Version 2.05
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
SNMP::Info is maintained by team of Open Source authors headed by Eric Miller
|
||||
and Bill Fenner.
|
||||
SNMP::Info is maintained by team of Open Source authors headed by Eric Miller,
|
||||
Bill Fenner, Max Baker, Jeroen van Ingen and Oliver Gorwits.
|
||||
|
||||
Please visit L<http://sourceforge.net/projects/snmp-info/> for most up-to-date
|
||||
list of developers.
|
||||
@@ -333,6 +333,14 @@ Foundry Discovery Protocol. F<FOUNDRY-SN-SWITCH-GROUP-MIB>
|
||||
|
||||
See documentation in L<SNMP::Info::FDP> for details.
|
||||
|
||||
=item SNMP::Info::IPv6
|
||||
|
||||
SNMP Interface for obtaining configured IPv6 addresses and mapping IPv6
|
||||
addresses to MACs and interfaces, using information from F<IP-MIB>,
|
||||
F<IPV6-MIB> and/or F<CISCO-IETF-IP-MIB>.
|
||||
|
||||
See documentation in L<SNMP::Info::IPv6> for details.
|
||||
|
||||
=item SNMP::Info::IEEE802dot11
|
||||
|
||||
F<IEEE802dot11-MIB>. A collection of OIDs providing information about
|
||||
@@ -465,12 +473,6 @@ Allied Telesys switches.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::Allied> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::Aruba
|
||||
|
||||
Subclass for Aruba wireless switches.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::Aruba> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::Bay
|
||||
|
||||
Depreciated. Use BayStack.
|
||||
@@ -523,12 +525,20 @@ Depreciated. Use SNMP::Info::Layer3::Foundry.
|
||||
|
||||
=item SNMP::Info::Layer2::HP
|
||||
|
||||
Subclass for HP Procurve Switches
|
||||
Subclass for more recent HP Procurve Switches
|
||||
|
||||
Requires F<HP-ICF-OID> and F<ENTITY-MIB> downloaded from HP.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::HP> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::HP4000
|
||||
|
||||
Subclass for older HP Procurve Switches
|
||||
|
||||
Requires F<HP-ICF-OID> and F<ENTITY-MIB> downloaded from HP.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2::HP4000> for details.
|
||||
|
||||
=item SNMP::Info::Layer2::N2270
|
||||
|
||||
Subclass for Nortel 2270 wireless switches.
|
||||
@@ -601,6 +611,12 @@ See documentation in L<SNMP::Info::Layer3::Altiga> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Arista> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Aruba
|
||||
|
||||
Subclass for Aruba wireless switches.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Aruba> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::BayRS
|
||||
|
||||
Subclass for Nortel Multiprotocol/BayRS routers. This includes BCN, BLN, ASN,
|
||||
@@ -633,6 +649,12 @@ This is a simple wrapper around Layer3 for IOS devices. It adds on CiscoVTP.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Cisco> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::CiscoFWSM
|
||||
|
||||
Subclass for Cisco Firewall Services Modules.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::CiscoFWSM> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Contivity
|
||||
|
||||
Subclass for Nortel Contivity/VPN Routers.
|
||||
@@ -668,7 +690,7 @@ See documentation in L<SNMP::Info::Layer3::Foundry> for details.
|
||||
=item SNMP::Info::Layer3::HP9300
|
||||
|
||||
Subclass for HP network devices which Foundry Networks was the
|
||||
Original Equipment Manufacturer (OEM) such as the HP ProCurve 9300 series.
|
||||
Original Equipment Manufacturer (OEM) such as the HP ProCurve 9300 and 6300 series.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::HP9300> for details.
|
||||
|
||||
@@ -709,6 +731,12 @@ series switches.
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Passport> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Pf
|
||||
|
||||
Subclass for FreeBSD-Based Firewalls using Pf /Pf Sense
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Pf> for details.
|
||||
|
||||
=item SNMP::Info::Layer3::Sun
|
||||
|
||||
Subclass for Generic Sun Routers running SunOS.
|
||||
@@ -1151,13 +1179,22 @@ sub device_type {
|
||||
|
||||
my $objtype = "SNMP::Info";
|
||||
|
||||
my $layers = $info->layers();
|
||||
|
||||
# if we dont have sysServices, we dont have anything else either probably.
|
||||
return unless ( defined $layers and length($layers) );
|
||||
my $layers = $info->layers() || '00000000';
|
||||
|
||||
my $desc = $info->description() || 'undef';
|
||||
$desc =~ s/[\r\n\l]+/ /g;
|
||||
|
||||
# Some devices don't implement sysServices, but do return a description.
|
||||
# In that case, log a warning and continue.
|
||||
if ( $layers eq '00000000' ) {
|
||||
if ($desc ne 'undef') {
|
||||
carp("Device doesn't implement sysServices but did return sysDescr. Might give unexpected results.\n") if $info->debug();
|
||||
} else {
|
||||
# No sysServices, no sysDescr
|
||||
return undef;
|
||||
}
|
||||
}
|
||||
|
||||
my $id = $info->id() || 'undef';
|
||||
|
||||
# Hash for generic fallback to a device class if unable to determine using
|
||||
@@ -1181,6 +1218,7 @@ sub device_type {
|
||||
6486 => 'SNMP::Info::Layer3::AlcatelLucent',
|
||||
6527 => 'SNMP::Info::Layer3::Timetra',
|
||||
8072 => 'SNMP::Info::Layer3::NetSNMP',
|
||||
12325 => 'SNMP::Info::Layer3::Pf',
|
||||
30065 => 'SNMP::Info::Layer3::Arista',
|
||||
);
|
||||
|
||||
@@ -1196,8 +1234,9 @@ sub device_type {
|
||||
2925 => 'SNMP::Info::Layer1::Cyclades',
|
||||
4526 => 'SNMP::Info::Layer2::Netgear',
|
||||
5624 => 'SNMP::Info::Layer3::Enterasys',
|
||||
11898 => 'SNMP::Info::Layer2::Orinoco',
|
||||
14179 => 'SNMP::Info::Layer2::Airespace',
|
||||
14823 => 'SNMP::Info::Layer2::Aruba',
|
||||
14823 => 'SNMP::Info::Layer3::Aruba',
|
||||
);
|
||||
|
||||
# Get just the enterprise number for generic mapping
|
||||
@@ -1235,6 +1274,22 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if $desc =~ /(s72033_rp|s3223_rp|s32p3_rp|s222_rp)/;
|
||||
|
||||
# Cisco 2970
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /(C2970|C2960)/ );
|
||||
|
||||
# Cisco 3400 w/ Layer3 capable image
|
||||
$objtype = 'SNMP::Info::Layer3::C3550'
|
||||
if ( $desc =~ /(ME340x)/ );
|
||||
|
||||
# Various Cisco blade switches, CBS30x0 and CBS31x0 models
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /cisco/i and $desc =~ /CBS3[0-9A-Za-z]{3}/ );
|
||||
|
||||
# HP, older ProCurve models (1600, 2400, 2424m, 4000, 8000)
|
||||
$objtype = 'SNMP::Info::Layer2::HP4000'
|
||||
if $desc =~ /\b(J4093A|J4110A|J4120A|J4121A|J4122A|J4122B)\b/;
|
||||
|
||||
# HP, Foundry OEM
|
||||
$objtype = 'SNMP::Info::Layer3::HP9300'
|
||||
if $desc =~ /\b(J4874A|J4138A|J4139A|J4840A|J4841A)\b/;
|
||||
@@ -1253,12 +1308,16 @@ sub device_type {
|
||||
if $desc =~ /Alteon\s[1A][8D]/;
|
||||
|
||||
# Nortel Contivity
|
||||
$objtype = 'SNMP::Info::Layer3::Contivity' if $desc =~ /\bCES\b/;
|
||||
$objtype = 'SNMP::Info::Layer3::Contivity' if $desc =~ /(\bCES\b|\bNVR\sV\d)/;
|
||||
|
||||
# Allied Telesyn Layer2 managed switches. They report they have L3 support
|
||||
$objtype = 'SNMP::Info::Layer2::Allied'
|
||||
if ( $desc =~ /Allied.*AT-80\d{2}\S*/i );
|
||||
|
||||
# Cisco FWSM
|
||||
$objtype = 'SNMP::Info::Layer3::CiscoFWSM'
|
||||
if ( $desc =~ /Cisco Firewall Services Module/i );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( ( $objtype eq 'SNMP::Info::Layer3' )
|
||||
and ( defined($id) )
|
||||
@@ -1296,6 +1355,10 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::C6500'
|
||||
if ( $desc =~ /(C2970|C2960)/ );
|
||||
|
||||
# HP, older ProCurve models (1600, 2400, 2424m, 4000, 8000)
|
||||
$objtype = 'SNMP::Info::Layer2::HP4000'
|
||||
if $desc =~ /\b(J4093A|J4110A|J4120A|J4121A|J4122A|J4122B)\b/;
|
||||
|
||||
# HP, Foundry OEM
|
||||
$objtype = 'SNMP::Info::Layer3::HP9300'
|
||||
if $desc =~ /\b(J4874A|J4138A|J4139A|J4840A|J4841A)\b/;
|
||||
@@ -1386,11 +1449,11 @@ sub device_type {
|
||||
if ( $desc =~ /8-port .DSL Module\(Annex .\)/i );
|
||||
|
||||
# Aruba wireless switches
|
||||
$objtype = 'SNMP::Info::Layer2::Aruba'
|
||||
$objtype = 'SNMP::Info::Layer3::Aruba'
|
||||
if ( $desc =~ /(ArubaOS|AirOS)/ );
|
||||
|
||||
# Alcatel-Lucent branded Aruba
|
||||
$objtype = 'SNMP::Info::Layer2::Aruba'
|
||||
$objtype = 'SNMP::Info::Layer3::Aruba'
|
||||
if ( $desc =~ /^AOS-W/ );
|
||||
|
||||
#Juniper NetScreen
|
||||
@@ -1405,10 +1468,14 @@ sub device_type {
|
||||
$objtype = 'SNMP::Info::Layer3::Cisco'
|
||||
if ( $desc =~ /Cisco Adaptive Security Appliance/i );
|
||||
|
||||
# Cisco FWSM
|
||||
$objtype = 'SNMP::Info::Layer3::Cisco'
|
||||
if ( $desc =~ /Cisco Firewall Services Module/i );
|
||||
|
||||
# Generic device classification based upon sysObjectID
|
||||
if ( defined($id) ) {
|
||||
if ( defined $l3sysoidmap{$id} ) {
|
||||
$objtype = $l3sysoidmap{$id};
|
||||
} elsif ( defined $l2sysoidmap{$id}) {
|
||||
$objtype = $l2sysoidmap{$id};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $objtype;
|
||||
@@ -1722,6 +1789,11 @@ sub i_speed_raw {
|
||||
my $info = shift;
|
||||
my $partial = shift;
|
||||
|
||||
# remove the speed formating
|
||||
my $munge_i_speed = delete $info->{munge}{i_speed};
|
||||
# also for highspeed interfaces e.g. TenGigabitEthernet
|
||||
my $munge_i_speed_high = delete $info->{munge}{i_speed_high};
|
||||
|
||||
my $i_speed_raw = $info->orig_i_speed($partial);
|
||||
|
||||
my $i_speed_high = undef;
|
||||
@@ -1733,6 +1805,11 @@ sub i_speed_raw {
|
||||
if ( $i_speed_high->{$i} );
|
||||
}
|
||||
}
|
||||
|
||||
# restore the speed formating
|
||||
$info->{munge}{i_speed} = $munge_i_speed;
|
||||
$info->{munge}{i_speed_high} = $munge_i_speed_high;
|
||||
|
||||
return $i_speed_raw;
|
||||
}
|
||||
|
||||
@@ -3655,7 +3732,7 @@ sub AUTOLOAD {
|
||||
=head1 COPYRIGHT AND LICENSE
|
||||
|
||||
Changes from SNMP::Info Version 0.7 and on are:
|
||||
Copyright (c) 2003-2009 Max Baker and SNMP::Info Developers
|
||||
Copyright (c) 2003-2010 Max Baker and SNMP::Info Developers
|
||||
All rights reserved.
|
||||
|
||||
Original Code is:
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
@@ -85,16 +85,17 @@ $VERSION = '2.01';
|
||||
'airespace_ess_aclname' => 'bsnDot11EssAclName',
|
||||
|
||||
# AIRESPACE-WIRELESS-MIB::bsnAPTable
|
||||
'airespace_ap_mac' => 'bsnAPDot3MacAddress',
|
||||
'airespace_ap_name' => 'bsnAPName',
|
||||
'airespace_ap_ip' => 'bsnApIpAddress',
|
||||
'airespace_ap_loc' => 'bsnAPLocation',
|
||||
'airespace_ap_sw' => 'bsnAPSoftwareVersion',
|
||||
'airespace_ap_fw' => 'bsnAPBootVersion',
|
||||
'airespace_ap_model' => 'bsnAPModel',
|
||||
'airespace_ap_serial' => 'bsnAPSerialNumber',
|
||||
'airespace_ap_type' => 'bsnAPType',
|
||||
'airespace_ap_status' => 'bsnAPAdminStatus',
|
||||
'airespace_ap_mac' => 'bsnAPDot3MacAddress',
|
||||
'airespace_ap_name' => 'bsnAPName',
|
||||
'airespace_ap_ip' => 'bsnApIpAddress',
|
||||
'airespace_ap_loc' => 'bsnAPLocation',
|
||||
'airespace_ap_sw' => 'bsnAPSoftwareVersion',
|
||||
'airespace_ap_fw' => 'bsnAPBootVersion',
|
||||
'airespace_ap_model' => 'bsnAPModel',
|
||||
'airespace_ap_serial' => 'bsnAPSerialNumber',
|
||||
'airespace_ap_type' => 'bsnAPType',
|
||||
'airespace_ap_status' => 'bsnAPAdminStatus',
|
||||
'airespace_ap_ethermac' => 'bsnAPEthernetMacAddress',
|
||||
|
||||
# AIRESPACE-WIRELESS-MIB::bsnAPIfTable
|
||||
'airespace_apif_slot' => 'bsnAPIfSlotId',
|
||||
@@ -112,6 +113,7 @@ $VERSION = '2.01';
|
||||
'airespace_sta_ess_idx' => 'bsnMobileStationEssIndex',
|
||||
'airespace_sta_ssid' => 'bsnMobileStationSsid',
|
||||
'airespace_sta_delete' => 'bsnMobileStationDeleteAction',
|
||||
'airespace_sta_ip' => 'bsnMobileStationIpAddress',
|
||||
|
||||
# AIRESPACE-WIRELESS-MIB::bsnUsersTable
|
||||
'airespace_user_name' => 'bsnUserName',
|
||||
@@ -148,15 +150,16 @@ $VERSION = '2.01';
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
'airespace_ap_mac' => \&SNMP::Info::munge_mac,
|
||||
'fw_port' => \&SNMP::Info::munge_mac,
|
||||
'airespace_bl_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_if_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_sta_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_ap_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_ap_ethermac' => \&SNMP::Info::munge_mac,
|
||||
'fw_port' => \&SNMP::Info::munge_mac,
|
||||
'airespace_bl_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_if_mac' => \&SNMP::Info::munge_mac,
|
||||
'airespace_sta_mac' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
sub layers {
|
||||
return '00000011';
|
||||
return '00000111';
|
||||
}
|
||||
|
||||
sub serial {
|
||||
@@ -896,6 +899,47 @@ sub e_parent {
|
||||
return \%e_parent;
|
||||
}
|
||||
|
||||
# arpnip:
|
||||
#
|
||||
# This is the controller snooping on the MAC->IP mappings.
|
||||
# Pretending this is arpnip data allows us to get MAC->IP
|
||||
# mappings even for stations that only communicate locally.
|
||||
# Also use the controller's knowledge of the APs' MAC and
|
||||
# IP addresses to augment the data.
|
||||
|
||||
sub at_paddr {
|
||||
my $airespace = shift;
|
||||
my $mac2ip = $airespace->airespace_sta_ip();
|
||||
my $apethermac = $airespace->airespace_ap_ethermac();
|
||||
|
||||
my $ret = {};
|
||||
foreach my $idx ( keys %$mac2ip ) {
|
||||
next if ( $mac2ip->{ $idx } eq '0.0.0.0' );
|
||||
my $mac = join( ":", map { sprintf "%02x", $_ } split /\./, $idx );
|
||||
$ret->{$idx} = $mac;
|
||||
}
|
||||
foreach my $idx ( keys %$apethermac ) {
|
||||
$ret->{$idx} = $apethermac->{$idx};
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub at_netaddr {
|
||||
my $airespace = shift;
|
||||
my $mac2ip = $airespace->airespace_sta_ip();
|
||||
my $ap2ip = $airespace->airespace_ap_ip();
|
||||
|
||||
my $ret = {};
|
||||
foreach my $idx ( keys %$mac2ip ) {
|
||||
next if ( $mac2ip->{ $idx } eq '0.0.0.0' );
|
||||
$ret->{$idx} = $mac2ip->{ $idx };
|
||||
}
|
||||
foreach my $idx ( keys %$ap2ip ) {
|
||||
$ret->{$idx} = $ap2ip->{ $idx };
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -1074,6 +1118,9 @@ switch.
|
||||
Returns 00000011. Class emulates Layer 2 functionality for Thin APs through
|
||||
proprietary MIBs.
|
||||
|
||||
=item $airespace->at_netaddr()
|
||||
=item $airespace->at_paddr()
|
||||
|
||||
=item $airespace->serial()
|
||||
|
||||
(C<agentInventorySerialNumber>)
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
%MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' );
|
||||
@@ -69,6 +69,10 @@ $VERSION = '2.01';
|
||||
'c_vlan' => 'cdpCacheNativeVLAN',
|
||||
'c_duplex' => 'cdpCacheDuplex',
|
||||
'c_power' => 'cdpCachePowerConsumption',
|
||||
'c_pri_mgmt_type'=> 'cdpCachePrimaryMgmtAddrType',
|
||||
'c_pri_mgmt_addr'=> 'cdpCachePrimaryMgmtAddr',
|
||||
'c_sec_mgmt_type'=> 'cdpCacheSecondaryMgmtAddrType',
|
||||
'c_sec_mgmt_addr'=> 'cdpCacheSecondaryMgmtAddr',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CONFIG-COPY-MIB' => 'ccCopyTable',
|
||||
|
||||
@@ -38,7 +38,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'CISCO-IMAGE-MIB' => 'ciscoImageString', );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PAECAPABILITIES/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
|
||||
@@ -39,13 +39,17 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'CISCO-POWER-ETHERNET-EXT-MIB' => 'cpeExtPsePortEntPhyIndex' );
|
||||
%MIBS = ( 'CISCO-POWER-ETHERNET-EXT-MIB' => 'cpeExtPsePortEntPhyIndex',
|
||||
'CISCO-CDP-MIB' => 'cdpCachePowerConsumption' );
|
||||
|
||||
%GLOBALS = ();
|
||||
|
||||
%FUNCS = ( 'cpeth_ent_phy' => 'cpeExtPsePortEntPhyIndex', );
|
||||
%FUNCS = (
|
||||
'cpeth_ent_phy' => 'cpeExtPsePortEntPhyIndex',
|
||||
'peth_port_power' => 'cpeExtPsePortPwrConsumption',
|
||||
);
|
||||
|
||||
%MUNGE = ();
|
||||
|
||||
@@ -69,6 +73,31 @@ sub peth_port_ifindex {
|
||||
return $peth_port_ifindex;
|
||||
}
|
||||
|
||||
# peth_port_neg_power uses the same index as the other peth_port_* tables.
|
||||
# However, cdpCachePowerConsumption uses <ifIndex>.<neighbor>.
|
||||
# Therefore, we have to invert peth_port_ifindex, to get to
|
||||
# the index that is expected and the rest of the code can re-invert it.
|
||||
sub peth_port_neg_power {
|
||||
my $cpeth = shift;
|
||||
my $partial = shift;
|
||||
|
||||
# Ignoring partial, since it's not easy to implement properly.
|
||||
my $index = $cpeth->peth_port_ifindex();
|
||||
my %inverse_index;
|
||||
foreach my $i ( keys %$index ) {
|
||||
$inverse_index{ $index->{$i} } = $i;
|
||||
}
|
||||
my $neg_power = $cpeth->cdpCachePowerConsumption();
|
||||
my $peth_port_neg_power = {};
|
||||
foreach my $i ( keys %$neg_power ) {
|
||||
my( $ifIndex, $nbrIndex ) = split( /\./, $i );
|
||||
if ( defined( $inverse_index{ $ifIndex } ) ) {
|
||||
$peth_port_neg_power->{ $inverse_index{ $ifIndex } } = $neg_power->{ $i };
|
||||
}
|
||||
}
|
||||
return $peth_port_neg_power;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
@@ -143,6 +172,22 @@ to a hash.
|
||||
|
||||
Maps the C<pethPsePortTable> to C<ifIndex> by way of the F<ENTITY-MIB>.
|
||||
|
||||
=item $poe->peth_port_power()
|
||||
|
||||
Power supplied by PoE ports, in milliwatts
|
||||
("cpeExtPsePortPwrConsumption")
|
||||
|
||||
=back
|
||||
|
||||
=head2 CDP Port table
|
||||
|
||||
=over
|
||||
|
||||
=item $poe->peth_port_neg_power()
|
||||
|
||||
Power negotiated using CDP, in milliwats
|
||||
("cdpCachePowerConsumption")
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'SNMPv2-MIB' => 'sysDescr',
|
||||
@@ -76,6 +76,7 @@ $VERSION = '2.01';
|
||||
|
||||
# OLD-CISCO-SYSTEM-MIB
|
||||
'write_mem' => 'writeMem',
|
||||
'rom_id' => 'romId',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
@@ -205,6 +206,15 @@ sub os_ver {
|
||||
return;
|
||||
}
|
||||
|
||||
sub os_bin {
|
||||
my $self = shift;
|
||||
my $rom_id = $self->rom_id();
|
||||
if ($rom_id =~ m/Version ([^,]+),/) {
|
||||
return $1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sub cpu {
|
||||
my $self = shift;
|
||||
my $ios_cpu = $self->ios_cpu();
|
||||
@@ -427,6 +437,10 @@ Cisco Content Switch Secure Content Acceleration
|
||||
|
||||
Tries to parse device operating system version from description()
|
||||
|
||||
=item $ciscostats->os_bin()
|
||||
|
||||
Tries to parse ROMMON version from rom_id() string
|
||||
|
||||
=item $ciscostats->ios_cpu()
|
||||
|
||||
Current CPU usage in percent.
|
||||
|
||||
@@ -35,7 +35,7 @@ use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/;
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
@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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'ENTITY-MIB' => 'entPhysicalSerialNum' );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'EtherLike-MIB' => 'etherMIB' );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ use Exporter;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'IEEE802dot11-MIB' => 'dot11DesiredSSID', );
|
||||
|
||||
|
||||
475
Info/IPv6.pm
Normal file
475
Info/IPv6.pm
Normal file
@@ -0,0 +1,475 @@
|
||||
# SNMP::Info::IPv6
|
||||
#
|
||||
# Copyright (c) 2010 Jeroen van Ingen and Carlos Vicente
|
||||
# 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::IPv6;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::IPv6::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::IPv6::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE $METHOD/;
|
||||
|
||||
use constant {
|
||||
IPMIB => 1,
|
||||
CISCO => 2,
|
||||
IPV6MIB => 3,
|
||||
};
|
||||
|
||||
$VERSION = '2.05';
|
||||
|
||||
|
||||
|
||||
%MIBS = (
|
||||
'IP-MIB' => 'ipv6InterfaceTableLastChange',
|
||||
'IPV6-MIB' => 'ipv6IfTableLastChange',
|
||||
'CISCO-IETF-IP-MIB' => 'cInetNetToMediaNetAddress',
|
||||
);
|
||||
|
||||
%GLOBALS = ();
|
||||
|
||||
%FUNCS = (
|
||||
'ip_n2p_phys_addr' => 'ipNetToPhysicalPhysAddress', # IP-MIB
|
||||
'c_inet_phys_addr' => 'cInetNetToMediaPhysAddress', # CISCO-IETF-IP-MIB
|
||||
'i6_n2p_phys_addr' => 'ipv6NetToMediaNetAddress', # IPV6-MIB
|
||||
|
||||
'ip_n2p_phys_type' => 'ipNetToPhysicalType', # IP-MIB
|
||||
'c_inet_phys_type' => 'cInetNetToMediaType', # CISCO-IETF-IP-MIB
|
||||
'i6_n2p_phys_type' => 'ipv6NetToMediaType', # IPV6-MIB
|
||||
|
||||
'ip_n2p_phys_state' => 'ipNetToPhysicalState', # IP-MIB
|
||||
'c_inet_phys_state' => 'cInetNetToMediaState', # CISCO-IETF-IP-MIB
|
||||
'i6_n2p_phys_state' => 'ipv6NetToMediaState', # IPV6-MIB
|
||||
|
||||
'ip_pfx_origin' => 'ipAddressPrefixOrigin', # IP-MIB
|
||||
'c_pfx_origin' => 'cIpAddressPfxOrigin', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_pfx' => 'ipAddressPrefix', # IP-MIB
|
||||
'c_addr6_pfx' => 'cIpAddressPrefix', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_index' => 'ipAddressIfIndex', # IP-MIBw
|
||||
'c_addr6_index' => 'cIpAddressIfIndex', # CISCO-IETF-IP-MIB
|
||||
|
||||
'ip_addr6_type' => 'ipAddressType', # IP-MIB
|
||||
'c_addr6_type' => 'cIpAddressType', # CISCO-IETF-IP-MIB
|
||||
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
'ip_n2p_phys_addr' => \&SNMP::Info::munge_mac,
|
||||
'c_inet_phys_addr' => \&munge_physaddr,
|
||||
'i6_n2p_phys_addr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
|
||||
sub ipv6_n2p_mac {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $phys_addr = &_test_methods( $info, {
|
||||
ip_n2p_phys_addr => IPMIB,
|
||||
c_inet_phys_addr => CISCO,
|
||||
i6_n2p_phys_addr => IPV6MIB,
|
||||
});
|
||||
return unless defined $phys_addr;
|
||||
foreach my $row (keys %$phys_addr) {
|
||||
if ($row =~ /^(\d+)\.(\d+)\.(\d+)\.([\d\.]+)$/) {
|
||||
my $ifindex = $1; my $addrtype = $2; my $addrsize = $3; my $v6addr = $4;
|
||||
if ($info::METHOD == IPV6MIB) {
|
||||
# IPV6-MIB doesn't include the addrtype in the index;
|
||||
# also, address syntax is IPv6Address (fixed 16 bytes) and not InetAddress (length field followed by address bytes)
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = substr($phys_addr->{$row}, 0, 17);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_n2p_addr {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $net_addr = &_test_methods( $info, {
|
||||
ip_n2p_phys_addr => IPMIB,
|
||||
c_inet_phys_addr => CISCO,
|
||||
i6_n2p_phys_addr => IPV6MIB,
|
||||
});
|
||||
return unless defined $net_addr;
|
||||
foreach my $row (keys %$net_addr) {
|
||||
if ($row =~ /^(\d+)\.(\d+)\.(\d+)\.([\d\.]+)$/) {
|
||||
my $ifindex = $1; my $addrtype = $2; my $addrsize = $3; my $v6addr = $4;
|
||||
if ($info::METHOD == IPV6MIB) {
|
||||
# IPV6-MIB doesn't include the addrtype in the index;
|
||||
# also, address syntax is IPv6Address (fixed 16 bytes) and not InetAddress (length field followed by address bytes)
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
my $v6_packed = pack("C*", split(/\./, $v6addr));
|
||||
$v6addr = join(':', map { sprintf("%04x", $_) } unpack("n*", $v6_packed) );
|
||||
$return->{$row} = $v6addr;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_n2p_if {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $phys_addr = &_test_methods( $info, {
|
||||
ip_n2p_phys_addr => IPMIB,
|
||||
c_inet_phys_addr => CISCO,
|
||||
i6_n2p_phys_addr => IPV6MIB,
|
||||
});
|
||||
return unless defined $phys_addr;
|
||||
foreach my $row (keys %$phys_addr) {
|
||||
if ($row =~ /^(\d+)\.(\d+)\.(\d+)\.([\d\.]+)$/) {
|
||||
my $ifindex = $1; my $addrtype = $2; my $addrsize = $3; my $v6addr = $4;
|
||||
if ($info::METHOD == IPV6MIB) {
|
||||
# IPV6-MIB doesn't include the addrtype in the index;
|
||||
# also, address syntax is IPv6Address (fixed 16 bytes) and not InetAddress (length field followed by address bytes)
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = $ifindex;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_n2p_type {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $phys_type = &_test_methods( $info, {
|
||||
ip_n2p_phys_type => IPMIB,
|
||||
c_inet_phys_type => CISCO,
|
||||
i6_n2p_phys_type => IPV6MIB,
|
||||
});
|
||||
return unless defined $phys_type;
|
||||
foreach my $row (keys %$phys_type) {
|
||||
if ($row =~ /^(\d+)\.(\d+)\.(\d+)\.([\d\.]+)$/) {
|
||||
my $ifindex = $1; my $addrtype = $2; my $addrsize = $3; my $v6addr = $4;
|
||||
if ($info::METHOD == IPV6MIB) {
|
||||
# IPV6-MIB doesn't include the addrtype in the index;
|
||||
# also, address syntax is IPv6Address (fixed 16 bytes) and not InetAddress (length field followed by address bytes)
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = $phys_type->{$row};
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_n2p_state {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $phys_state = &_test_methods( $info, {
|
||||
ip_n2p_phys_state => IPMIB,
|
||||
c_inet_phys_state => CISCO,
|
||||
i6_n2p_phys_state => IPV6MIB,
|
||||
});
|
||||
return unless defined $phys_state;
|
||||
foreach my $row (keys %$phys_state) {
|
||||
if ($row =~ /^(\d+)\.(\d+)\.(\d+)\.([\d\.]+)$/) {
|
||||
my $ifindex = $1; my $addrtype = $2; my $addrsize = $3; my $v6addr = $4;
|
||||
if ($info::METHOD == IPV6MIB) {
|
||||
# IPV6-MIB doesn't include the addrtype in the index;
|
||||
# also, address syntax is IPv6Address (fixed 16 bytes) and not InetAddress (length field followed by address bytes)
|
||||
$v6addr = join('.', $addrtype, $addrsize, $v6addr);
|
||||
$addrtype = 2;
|
||||
}
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = $phys_state->{$row};
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_index {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $ipv6_index = &_test_methods( $info, {
|
||||
ip_addr6_index => IPMIB,
|
||||
c_addr6_index => CISCO,
|
||||
});
|
||||
return unless defined $ipv6_index;
|
||||
foreach my $row (keys %$ipv6_index){
|
||||
if ($row =~ /^(\d+)\.([\d\.]+)$/) {
|
||||
my $addrtype = $1; my $v6addr = $2;
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = $ipv6_index->{$row};
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_type {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $ipv6_type = &_test_methods( $info, {
|
||||
ip_addr6_type => IPMIB,
|
||||
c_addr6_type => CISCO,
|
||||
});
|
||||
return unless defined $ipv6_type;
|
||||
foreach my $row (keys %$ipv6_type){
|
||||
if ($row =~ /^(\d+)\.([\d\.]+)$/) {
|
||||
my $addrtype = $1; my $v6addr = $2;
|
||||
if ($addrtype == 2) { # IPv6
|
||||
$return->{$row} = $ipv6_type->{$row};
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_pfx_origin {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $ipv6_pfx_origin = &_test_methods( $info, {
|
||||
ip_pfx_origin => IPMIB,
|
||||
c_pfx_origin => CISCO,
|
||||
});
|
||||
return unless defined $ipv6_pfx_origin;
|
||||
foreach my $row (keys %$ipv6_pfx_origin){
|
||||
if ($row =~ /^(\d+)\.(\d+)\.([\d\.]+)\.(\d+)$/) {
|
||||
my $ifindex = $1; my $type = $2; my $pfx = $3; my $len = $4;
|
||||
if ($type == 2) { # IPv6
|
||||
$return->{$row} = $ipv6_pfx_origin->{$row};
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub ipv6_addr_prefix {
|
||||
my $info = shift;
|
||||
my $return;
|
||||
my $ipv6_addr_prefix = &_test_methods( $info, {
|
||||
ip_addr6_pfx => IPMIB,
|
||||
c_addr6_pfx => CISCO,
|
||||
});
|
||||
return unless defined $ipv6_addr_prefix;
|
||||
foreach my $row (keys %$ipv6_addr_prefix){
|
||||
if ($row =~ /^(\d+)\.[\d\.]+$/) {
|
||||
my $type = $1;
|
||||
if ($type == 2) { # IPv6
|
||||
# Remove the OID part from the value
|
||||
my $val = $ipv6_addr_prefix->{$row};
|
||||
if ( $val =~ /^.+?((?:\d+\.){19}\d+)$/ ){
|
||||
$val = $1;
|
||||
$return->{$row} = $val;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%s: data comes from %s.\n", &_my_sub_name, $info->_method_used() ) if $info->debug();
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub _method_used {
|
||||
my $info = shift;
|
||||
my $return = 'none of the MIBs';
|
||||
if (defined $info::METHOD) {
|
||||
if ($info::METHOD eq IPMIB) {
|
||||
$return = 'IP-MIB';
|
||||
} elsif ($info::METHOD eq IPV6MIB) {
|
||||
$return = 'IPV6-MIB';
|
||||
} elsif ($info::METHOD eq CISCO) {
|
||||
$return = 'CISCO-IETF-IP-MIB';
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub _test_methods {
|
||||
my $info = shift;
|
||||
my $test = shift;
|
||||
my $return = {};
|
||||
foreach my $method (sort {$test->{$a} <=> $test->{$b}} keys %$test) {
|
||||
$return = $info->$method || {};
|
||||
if (scalar keys %$return) {
|
||||
$info::METHOD = $test->{$method};
|
||||
last;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
sub _my_sub_name {
|
||||
my @callinfo = caller(1);
|
||||
return $callinfo[3];
|
||||
}
|
||||
|
||||
sub munge_physaddr {
|
||||
my $addr = shift;
|
||||
return unless defined $addr;
|
||||
return unless length $addr;
|
||||
$addr = join( ':', map { sprintf "%02x", $_ } unpack( 'C*', $addr ) );
|
||||
return $addr;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::IPv6 - SNMP Interface for obtaining IPv6 addresses and IPv6
|
||||
address mappings
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Jeroen van Ingen and Carlos Vicente
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $info = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $info->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
The SNMP::Info::IPv6 class implements functions to for mapping IPv6 addresses
|
||||
to MAC addresses, interfaces and more. It will use data from the IP-MIB, IPV6-MIB
|
||||
or the CISCO-IETF-IP-MIB, whichever is supported by the device.
|
||||
|
||||
This class is inherited by Info::Layer3 to provide IPv6 node tracking across
|
||||
device classes.
|
||||
|
||||
For debugging purposes you can call this class directly as you would
|
||||
SNMP::Info
|
||||
|
||||
my $info = new SNMP::Info::IPv6 (...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
none.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<IP-MIB>
|
||||
=item F<IPV6-MIB>
|
||||
=item F<CISCO-IETF-IP-MIB>
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
none.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Internet Address Table
|
||||
|
||||
=over
|
||||
|
||||
=item $info->ipv6_n2p_addr()
|
||||
|
||||
=item $info->ipv6_n2p_if()
|
||||
|
||||
=item $info->ipv6_n2p_mac()
|
||||
|
||||
=item $info->ipv6_n2p_state()
|
||||
|
||||
=item $info->ipv6_n2p_type()
|
||||
|
||||
=item $info->ipv6_index()
|
||||
|
||||
Maps an IPv6 address to an interface C<ifIndex>
|
||||
|
||||
=item $info->ipv6_type()
|
||||
|
||||
Maps an IPv6 address to its type (unicast, anycast, etc.)
|
||||
|
||||
=item $info->ipv6_pfx_origin()
|
||||
|
||||
Maps an IPv6 prefix with its origin (manual, well-known, dhcp, etc.)
|
||||
|
||||
=item $info->ipv6_addr_prefix()
|
||||
|
||||
Maps IPv6 addresses with their prefixes
|
||||
|
||||
=back
|
||||
|
||||
=head2 Internet Address Translation Table
|
||||
|
||||
=over
|
||||
|
||||
=item $info->c_inet_phys_address()
|
||||
|
||||
Maps an address of type C<cInetNetToMediaNetAddressType> on interface C<ifIndex> to a physical address.
|
||||
|
||||
=back
|
||||
|
||||
=head1 MUNGES
|
||||
|
||||
=over
|
||||
|
||||
=item munge_physaddr()
|
||||
|
||||
Takes an octet stream (HEX-STRING) and returns a colon separated ASCII hex
|
||||
string.
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'LLDP-MIB' => 'lldpLocSysCapEnabled',
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# 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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# 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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
|
||||
@@ -45,7 +45,7 @@ use SNMP::Info::PowerEthernet;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
|
||||
@@ -41,11 +41,13 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::CDP::MIBS, %SNMP::Info::Airespace::MIBS,
|
||||
'AIRESPACE-SWITCHING-MIB' => 'agentInterfaceVlanId',
|
||||
'CISCO-LWAPP-DOT11-CLIENT-MIB' => 'cldcClientCurrentTxRateSet',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -56,11 +58,26 @@ $VERSION = '2.01';
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS, %SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS, %SNMP::Info::Airespace::FUNCS,
|
||||
|
||||
# This needs to be cleaned up, but for now we pretend to
|
||||
# have the CISCO-DOT11-MIB for signal strengths, etc.
|
||||
'cd11_sigstrength' => 'bsnMobileStationRSSI', # kinda
|
||||
'cd11_sigqual' => 'bsnMobileStationSnr', # kinda
|
||||
'cd11_rxbyte' => 'bsnMobileStationBytesReceived',
|
||||
'cd11_txbyte' => 'bsnMobileStationBytesSent',
|
||||
'cd11_rxpkt' => 'bsnMobileStationPacketsReceived',
|
||||
'cd11_txpkt' => 'bsnMobileStationPacketsSent',
|
||||
'cd11_txrate' => 'cldcClientCurrentTxRateSet',
|
||||
'cd11_rateset' => 'cldcClientDataRateSet',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE, %SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE, %SNMP::Info::Airespace::MUNGE,
|
||||
'cd11_rxpkt' => \&munge_64bits,
|
||||
'cd11_txpkt' => \&munge_64bits,
|
||||
'cd11_txrate' => \&munge_cd11_txrate,
|
||||
'cd11_rateset' => \&munge_cd11_rateset,
|
||||
);
|
||||
|
||||
sub os {
|
||||
@@ -79,6 +96,42 @@ sub model {
|
||||
return $model;
|
||||
}
|
||||
|
||||
# vlan:
|
||||
# AIRESPACE-SWITCHING-MIB::agentInterfaceVlanId
|
||||
|
||||
sub cd11_mac {
|
||||
my $airespace = shift;
|
||||
my $cd11_sigstrength = $airespace->cd11_sigstrength();
|
||||
|
||||
my $ret = {};
|
||||
foreach my $idx ( keys %$cd11_sigstrength ) {
|
||||
my $mac = join( ":", map { sprintf "%02x", $_ } split /\./, $idx );
|
||||
$ret->{$idx} = $mac
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub munge_cd11_txrate {
|
||||
my $rate = shift;
|
||||
if ( $rate ) {
|
||||
return [ $rate * 1.0 ];
|
||||
} else {
|
||||
return [ 0.0 ];
|
||||
}
|
||||
}
|
||||
|
||||
sub munge_cd11_rateset {
|
||||
my $rates = shift;
|
||||
return [ map { $_ * 1.0 } split /,/, $rates ];
|
||||
}
|
||||
|
||||
sub munge_64bits {
|
||||
# The controller sometimes hands off a ridiculous value for packets.
|
||||
# Just truncate it to 32 bits.
|
||||
my $value = shift;
|
||||
return $value & 0xffffffff;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -181,14 +234,14 @@ See documentation in L<SNMP::Info::Bridge/"GLOBALS"> for details.
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=item cd11_mac()
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item None
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Airespace
|
||||
|
||||
See documentation in L<SNMP::Info::Airespace/"TABLE METHODS"> for details.
|
||||
@@ -201,4 +254,16 @@ See documentation in L<SNMP::Info::CDP/"TABLE METHODS"> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::Bridge/"TABLE METHODS"> for details.
|
||||
|
||||
=head1 MUNGES
|
||||
|
||||
=over
|
||||
|
||||
=item munge_64bits()
|
||||
|
||||
=item munge_cd11_rateset()
|
||||
|
||||
=item munge_cd11_txrate()
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
@@ -49,7 +49,7 @@ use SNMP::Info::IEEE802dot11;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::IEEE802dot11::GLOBALS,
|
||||
@@ -193,7 +193,7 @@ sub _aironet_breakout_dot11idx {
|
||||
sub fw_mac {
|
||||
my $aironet = shift;
|
||||
|
||||
return qb_fw_mac($aironet) unless _aironet_special($aironet);
|
||||
return $aironet->qb_fw_mac() unless _aironet_special($aironet);
|
||||
my $c_dot11subif = $aironet->c_dot11subif();
|
||||
my $fw_mac = {};
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer1;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = (
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::LLDP::MIBS,
|
||||
@@ -82,20 +82,26 @@ sub os {
|
||||
my $descr = $baystack->description();
|
||||
my $model = $baystack->model();
|
||||
|
||||
if (( defined $model
|
||||
and $model
|
||||
=~ /(325|420|425|470|460|BPS|2500|3510|4524|4526|4548|4550|5510|5520|5530)/
|
||||
)
|
||||
and ( defined $descr and $descr =~ m/SW:v[3-5]/i )
|
||||
)
|
||||
{
|
||||
return 'boss';
|
||||
}
|
||||
if ( ( defined $descr and $descr =~ /Business Ethernet Switch.*SW:v/i ) )
|
||||
{
|
||||
return 'bes';
|
||||
}
|
||||
return 'baystack';
|
||||
if (
|
||||
(
|
||||
(defined $model and $model =~ /(420|425|BPS)/ )
|
||||
and
|
||||
(defined $descr and $descr =~ m/SW:v[1-2]/i )
|
||||
)
|
||||
or
|
||||
(
|
||||
(defined $model and $model =~ /(410|450|380)/ )
|
||||
)
|
||||
)
|
||||
{
|
||||
return 'baystack';
|
||||
}
|
||||
|
||||
return 'boss';
|
||||
}
|
||||
|
||||
sub os_bin {
|
||||
@@ -210,14 +216,23 @@ sub index_factor {
|
||||
my $baystack = shift;
|
||||
my $model = $baystack->model();
|
||||
my $os = $baystack->os();
|
||||
my $os_ver = $baystack->os_ver();
|
||||
my $op_mode = $baystack->ns_op_mode();
|
||||
|
||||
$op_mode = 'pure' unless defined $op_mode;
|
||||
if ( $os_ver =~ m/^(\d+)\./ ) {
|
||||
$os_ver = $1;
|
||||
} else {
|
||||
$os_ver = 1;
|
||||
}
|
||||
|
||||
my $index_factor = 32;
|
||||
$index_factor = 64
|
||||
if ( ( defined $model and $model =~ /(470)/ )
|
||||
or ( $os =~ m/(boss|bes)/ ) and ( $op_mode eq 'pure' ) );
|
||||
$index_factor = 128
|
||||
if ( ( defined $model and $model =~ /(5[56]\d\d)/ )
|
||||
and ( $os_ver >= 6 ) );
|
||||
|
||||
return $index_factor;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
@@ -251,6 +251,18 @@ sub i_vlan_membership {
|
||||
return $i_vlan_membership;
|
||||
}
|
||||
|
||||
sub bp_index {
|
||||
my $c1900 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $if_index = $c1900->i_index($partial);
|
||||
my $index = $c1900->orig_bp_index($partial) || {};
|
||||
foreach my $iid ( keys %$if_index ) {
|
||||
$index->{$iid} = $iid if(!defined $index->{$iid});
|
||||
}
|
||||
return $index;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -432,6 +444,13 @@ bridge group IDs.
|
||||
print "Port: $port VLAN: $vlan\n";
|
||||
}
|
||||
|
||||
|
||||
=item $c1900->bp_index()
|
||||
|
||||
Returns a bp_index that contains the original bp_index entries and extra
|
||||
entries for those interfaces listed in if_index, as some C1900 devices do not
|
||||
return complete bp_indexes.
|
||||
|
||||
=back
|
||||
|
||||
=head2 F<STAND-ALONE-ETHERNET-SWITCH-MIB> Switch Port Table Entries:
|
||||
|
||||
@@ -47,7 +47,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -55,12 +55,12 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
'RFC1271-MIB' => 'logDescription',
|
||||
'HP-ICF-OID' => 'hpSwitch4000',
|
||||
'HP-VLAN' => 'hpVlanMemberIndex',
|
||||
'STATISTICS-MIB' => 'hpSwitchCpuStat',
|
||||
'NETSWITCH-MIB' => 'hpMsgBufFree',
|
||||
'CONFIG-MIB' => 'hpSwitchConfig',
|
||||
'SEMI-MIB' => 'hpHttpMgSerialNumber',
|
||||
'HP-ICF-CHASSIS' => 'hpicfSensorObjectId',
|
||||
'HP-ICF-BRIDGE' => 'hpicfBridgeRstpForceVersion',
|
||||
'HP-ICF-POE-MIB' => 'hpicfPoePethPsePortCurrent',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -69,7 +69,6 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'serial1' => 'entPhysicalSerialNum.1',
|
||||
'serial2' => 'hpHttpMgSerialNumber.0',
|
||||
'hp_cpu' => 'hpSwitchCpuStat.0',
|
||||
'hp_mem_total' => 'hpGlobalMemTotalBytes.1',
|
||||
'mem_free' => 'hpGlobalMemFreeBytes.1',
|
||||
@@ -77,7 +76,7 @@ $VERSION = '2.01';
|
||||
'os_version' => 'hpSwitchOsVersion.0',
|
||||
'os_bin' => 'hpSwitchRomVersion.0',
|
||||
'mac' => 'hpSwitchBaseMACAddress.0',
|
||||
'hp_vlans' => 'hpVlanNumber',
|
||||
'rstp_ver' => 'hpicfBridgeRstpForceVersion',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
@@ -85,30 +84,23 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'bp_index2' => 'dot1dBasePortIfIndex',
|
||||
'i_type2' => 'ifType',
|
||||
|
||||
# RFC1271
|
||||
'l_descr' => 'logDescription',
|
||||
|
||||
# HP-VLAN-MIB
|
||||
'hp_v_index' => 'hpVlanDot1QID',
|
||||
'hp_v_name' => 'hpVlanIdentName',
|
||||
'hp_v_state' => 'hpVlanIdentState',
|
||||
'hp_v_type' => 'hpVlanIdentType',
|
||||
'hp_v_status' => 'hpVlanIdentStatus',
|
||||
'hp_v_mac' => 'hpVlanAddrPhysAddress',
|
||||
'hp_v_if_index' => 'hpVlanMemberIndex',
|
||||
'hp_v_if_tag' => 'hpVlanMemberTagged2',
|
||||
|
||||
# CONFIG-MIB::hpSwitchPortTable
|
||||
'hp_duplex' => 'hpSwitchPortEtherMode',
|
||||
'hp_duplex_admin' => 'hpSwitchPortFastEtherMode',
|
||||
'vendor_i_type' => 'hpSwitchPortType',
|
||||
|
||||
# HP-ICF-CHASSIS
|
||||
'hp_s_oid' => 'hpicfSensorObjectId',
|
||||
'hp_s_name' => 'hpicfSensorDescr',
|
||||
'hp_s_status' => 'hpicfSensorStatus',
|
||||
|
||||
# HP-ICF-POE-MIB
|
||||
'peth_port_power' => 'hpicfPoePethPsePortPower',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -120,69 +112,101 @@ $VERSION = '2.01';
|
||||
'c_id' => \&munge_hp_c_id,
|
||||
);
|
||||
|
||||
|
||||
# Model map, reverse sorted by common model name (sort -k2 -r)
|
||||
# Potential sources for model information: http://www.hp.com/rnd/software/switches.htm or HP-ICF-OID MIB
|
||||
%MODEL_MAP = (
|
||||
'J4093A' => '2424M',
|
||||
'J4110A' => '8000M',
|
||||
'J4120A' => '1600M',
|
||||
'J4121A' => '4000M',
|
||||
'J4122A' => '2400M',
|
||||
'J4122B' => '2424M',
|
||||
'J4138A' => '9308M',
|
||||
'J4139A' => '9304M',
|
||||
'J4812A' => '2512',
|
||||
'J4813A' => '2524',
|
||||
'J4815A' => '3324XL',
|
||||
'J4819A' => '5308XL',
|
||||
'J4840A' => '6308M-SX',
|
||||
'J4841A' => '6208M-SX',
|
||||
'J4850A' => '5304XL',
|
||||
'J4851A' => '3124',
|
||||
'J4865A' => '4108GL',
|
||||
'J4874A' => '9315M',
|
||||
'J4887A' => '4104GL',
|
||||
'J4899A' => '2650',
|
||||
'J4899B' => '2650-CR',
|
||||
'J4900A' => '2626',
|
||||
'J4900B' => '2626-CR',
|
||||
'J4902A' => '6108',
|
||||
'J4903A' => '2824',
|
||||
'J4904A' => '2848',
|
||||
'J4905A' => '3400cl-24G',
|
||||
'J4906A' => '3400cl-48G',
|
||||
'J8130A' => 'WAP-420-NA',
|
||||
'J8131A' => 'WAP-420-WW',
|
||||
'J8130A' => 'WAP-420-NA',
|
||||
'J8133A' => 'AP520WL',
|
||||
'J8164A' => '2626-PWR',
|
||||
'J8165A' => '2650-PWR',
|
||||
'J8433A' => 'CX4-6400cl-6XG',
|
||||
'J8474A' => 'MF-6400cl-6XG',
|
||||
'J8680A' => '9608sl',
|
||||
'J8692A' => '3500yl-24G-PWR',
|
||||
'J8693A' => '3500yl-48G-PWR',
|
||||
'J8697A' => '5406zl',
|
||||
'J8698A' => '5412zl',
|
||||
'J8718A' => '5404yl',
|
||||
'J8719A' => '5408yl',
|
||||
'J8770A' => '4204vl',
|
||||
'J8771A' => '4202vl-48G',
|
||||
'J8772A' => '4202vl-72',
|
||||
'J8773A' => '4208vl',
|
||||
'J8762A' => '2600-8-PWR',
|
||||
'J8680A' => '9408sl',
|
||||
'J9091A' => '8212zl',
|
||||
'J9475A' => '8206zl',
|
||||
'J9265A' => '6600ml-24XG',
|
||||
'J9264A' => '6600ml-24G-4XG',
|
||||
'J9263A' => '6600ml-24G',
|
||||
'J9452A' => '6600-48G-4XG',
|
||||
'J9451A' => '6600-48G',
|
||||
'J8474A' => '6410cl-6XG',
|
||||
'J8433A' => '6400cl-6XG',
|
||||
'J8992A' => '6200yl-24G',
|
||||
'J9019A' => '2510-24A',
|
||||
'J9020A' => '2510-48A',
|
||||
'J9021A' => '2810-24G',
|
||||
'J9022A' => '2810-48G',
|
||||
'J9028A' => '1800-24G',
|
||||
'J9029A' => '1800-8G',
|
||||
'J4902A' => '6108',
|
||||
'J8698A' => '5412zl',
|
||||
'J8719A' => '5408yl',
|
||||
'J8697A' => '5406zl',
|
||||
'J8718A' => '5404yl',
|
||||
'J4819A' => '5308XL',
|
||||
'J4850A' => '5304XL',
|
||||
'J8773A' => '4208vl',
|
||||
'J8770A' => '4204vl',
|
||||
'J8772A' => '4202vl-72',
|
||||
'J9032A' => '4202vl-68G',
|
||||
'J9031A' => '4202vl-68',
|
||||
'J8771A' => '4202vl-48G',
|
||||
'J4865A' => '4108GL',
|
||||
'J4887A' => '4104GL',
|
||||
'J8693A' => '3500yl-48G-PWR',
|
||||
'J8692A' => '3500yl-24G-PWR',
|
||||
'J9473A' => '3500-48-PoE',
|
||||
'J9472A' => '3500-48',
|
||||
'J9471A' => '3500-24-PoE',
|
||||
'J9470A' => '3500-24',
|
||||
'J4906A' => '3400cl-48G',
|
||||
'J4905A' => '3400cl-24G',
|
||||
'J4815A' => '3324XL',
|
||||
'J4851A' => '3124',
|
||||
'J9562A' => '2915-8G-PoE',
|
||||
'J9148A' => '2910al-48G-PoE+',
|
||||
'J9147A' => '2910al-48G',
|
||||
'J9146A' => '2910al-24G-PoE+',
|
||||
'J9145A' => '2910al-24G',
|
||||
'J9050A' => '2900-48G',
|
||||
'J9049A' => '2900-24G',
|
||||
'J9032A' => '4202vl-68G',
|
||||
'J9091A' => '8212zl',
|
||||
'J4904A' => '2848',
|
||||
'J4903A' => '2824',
|
||||
'J9022A' => '2810-48G',
|
||||
'J9021A' => '2810-24G',
|
||||
'J8165A' => '2650-PWR',
|
||||
'J4899B' => '2650-CR',
|
||||
'J4899C' => '2650C',
|
||||
'J4899A' => '2650',
|
||||
'J8164A' => '2626-PWR',
|
||||
'J4900B' => '2626-CR',
|
||||
'J4900C' => '2626C',
|
||||
'J4900A' => '2626',
|
||||
'J9565A' => '2615-8-PoE',
|
||||
'J9089A' => '2610-48-PWR',
|
||||
'J9088A' => '2610-48',
|
||||
'J9087A' => '2610-24-PWR',
|
||||
'J9086A' => '2610-24/12PWR',
|
||||
'J9085A' => '2610-24',
|
||||
'J8762A' => '2600-8-PWR',
|
||||
'J4813A' => '2524',
|
||||
'J9137A' => '2520-8-PoE',
|
||||
'J9138A' => '2520-24-PoE',
|
||||
'J9298A' => '2520G-8-PoE',
|
||||
'J9299A' => '2520G-24-PoE',
|
||||
'J4812A' => '2512',
|
||||
'J9280A' => '2510G-48',
|
||||
'J9279A' => '2510G-24',
|
||||
'J9020A' => '2510-48A',
|
||||
'J9019B' => '2510-24B',
|
||||
'J9019A' => '2510-24A',
|
||||
'J4818A' => '2324',
|
||||
'J4817A' => '2312',
|
||||
'J9449A' => '1810G-8',
|
||||
'J9450A' => '1810G-24',
|
||||
'J9029A' => '1800-8G',
|
||||
'J9028A' => '1800-24G',
|
||||
);
|
||||
|
||||
# Method Overrides
|
||||
|
||||
sub stp_ver {
|
||||
my $hp = shift;
|
||||
return $hp->rstp_ver() || $hp->SUPER::stp_ver();
|
||||
}
|
||||
|
||||
sub cpu {
|
||||
my $hp = shift;
|
||||
return $hp->hp_cpu();
|
||||
@@ -223,15 +247,6 @@ sub model {
|
||||
return defined $MODEL_MAP{$model} ? $MODEL_MAP{$model} : $model;
|
||||
}
|
||||
|
||||
# Some have the serial in entity mib, some have it in SEMI-MIB::hphttpmanageable
|
||||
sub serial {
|
||||
my $hp = shift;
|
||||
|
||||
my $serial = $hp->serial1() || $hp->serial2() || undef;
|
||||
|
||||
return $serial;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $hp = shift;
|
||||
my $interfaces = $hp->i_index();
|
||||
@@ -371,116 +386,7 @@ sub _sensor {
|
||||
return $result;
|
||||
}
|
||||
|
||||
# Bridge MIB does not map Bridge Port to ifIndex correctly on all models
|
||||
sub bp_index {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $if_index = $hp->i_index($partial);
|
||||
my $model = $hp->model();
|
||||
my $bp_index = $hp->bp_index2($partial);
|
||||
|
||||
unless ( defined $model and $model =~ /(1600|2424|4000|8000)/ ) {
|
||||
return $bp_index;
|
||||
}
|
||||
|
||||
my %mod_bp_index;
|
||||
foreach my $iid ( keys %$if_index ) {
|
||||
$mod_bp_index{$iid} = $iid;
|
||||
}
|
||||
return \%mod_bp_index;
|
||||
}
|
||||
|
||||
# VLAN methods. Newer HPs use Q-BRIDGE, older use proprietary MIB. Use
|
||||
# Q-BRIDGE if available.
|
||||
|
||||
sub v_index {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
# Newer devices
|
||||
my $q_index = $hp->SUPER::v_index($partial);
|
||||
if ( defined $q_index and scalar( keys %$q_index ) ) {
|
||||
return $q_index;
|
||||
}
|
||||
|
||||
# Older devices
|
||||
return $hp->hp_v_index($partial);
|
||||
}
|
||||
|
||||
sub v_name {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
# Newer devices
|
||||
my $q_name = $hp->SUPER::v_name($partial);
|
||||
if ( defined $q_name and scalar( keys %$q_name ) ) {
|
||||
return $q_name;
|
||||
}
|
||||
|
||||
# Older devices
|
||||
return $hp->hp_v_name($partial);
|
||||
}
|
||||
|
||||
sub i_vlan {
|
||||
my $hp = shift;
|
||||
|
||||
# Newer devices use Q-BRIDGE-MIB
|
||||
my $qb_i_vlan = $hp->SUPER::i_vlan();
|
||||
if ( defined $qb_i_vlan and scalar( keys %$qb_i_vlan ) ) {
|
||||
return $qb_i_vlan;
|
||||
}
|
||||
|
||||
# HP4000 ... get it from HP-VLAN
|
||||
# the hpvlanmembertagged2 table has an entry in the form of
|
||||
# vlan.interface = /untagged/no/tagged/auto
|
||||
my $i_vlan = {};
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
my $hp_v_if_tag = $hp->hp_v_if_tag();
|
||||
foreach my $row ( keys %$hp_v_if_tag ) {
|
||||
my ( $index, $if ) = split( /\./, $row );
|
||||
|
||||
my $tag = $hp_v_if_tag->{$row};
|
||||
my $vlan = $hp_v_index->{$index};
|
||||
|
||||
next unless ( defined $tag and $tag =~ /untagged/ );
|
||||
|
||||
$i_vlan->{$if} = $vlan if defined $vlan;
|
||||
}
|
||||
|
||||
return $i_vlan;
|
||||
}
|
||||
|
||||
sub i_vlan_membership {
|
||||
my $hp = shift;
|
||||
|
||||
# Newer devices use Q-BRIDGE-MIB
|
||||
my $qb_i_vlan = $hp->SUPER::i_vlan_membership();
|
||||
if ( defined $qb_i_vlan and scalar( keys %$qb_i_vlan ) ) {
|
||||
return $qb_i_vlan;
|
||||
}
|
||||
|
||||
# Older get it from HP-VLAN
|
||||
my $i_vlan_membership = {};
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
my $hp_v_if_tag = $hp->hp_v_if_tag();
|
||||
foreach my $row ( keys %$hp_v_if_tag ) {
|
||||
my ( $index, $if ) = split( /\./, $row );
|
||||
|
||||
my $tag = $hp_v_if_tag->{$row};
|
||||
my $vlan = $hp_v_index->{$index};
|
||||
|
||||
next unless ( defined $tag );
|
||||
next if ( $tag eq 'no' );
|
||||
|
||||
push( @{ $i_vlan_membership->{$if} }, $vlan );
|
||||
}
|
||||
|
||||
return $i_vlan_membership;
|
||||
}
|
||||
|
||||
# Use CDP and/or LLDP
|
||||
|
||||
sub hasCDP {
|
||||
my $hp = shift;
|
||||
|
||||
@@ -639,6 +545,75 @@ sub peth_port_ifindex {
|
||||
return $peth_port_ifindex;
|
||||
}
|
||||
|
||||
sub set_i_vlan {
|
||||
my $hp = shift;
|
||||
my $rv;
|
||||
|
||||
my $qb_i_vlan = $hp->qb_i_vlan_t();
|
||||
if (defined $qb_i_vlan and scalar(keys %$qb_i_vlan)){
|
||||
my $vlan = shift;
|
||||
my $iid = shift;
|
||||
|
||||
my $qb_v_egress = $hp->qb_v_egress();
|
||||
if (defined $qb_v_egress and scalar($qb_v_egress->{$vlan})) {
|
||||
# store current untagged VLAN to remove it from the port list later
|
||||
my $old_untagged = $qb_i_vlan->{$iid};
|
||||
|
||||
# set new untagged / native VLAN
|
||||
$rv = $hp->set_qb_i_vlan($vlan, $iid);
|
||||
|
||||
# If change is successful, the old native VLAN will now be a tagged VLAN on the port. This is generally not what we want.
|
||||
# We'll have to remove this VLAN from the "egress list" on the port.
|
||||
if (defined $rv and $old_untagged != $vlan) {
|
||||
if (defined $old_untagged and defined $qb_v_egress and scalar($qb_v_egress->{$vlan})){
|
||||
|
||||
# First, get the egress list of the old native VLAN (arrayref structure)
|
||||
my $egressports = $qb_v_egress->{$old_untagged};
|
||||
|
||||
# Since arrays are zero-based, we have to change the element at Index - 1
|
||||
$egressports->[$iid-1] = "0";
|
||||
|
||||
# After changing, pack the array into a binary structure (expected by set_qb_v_egress) and set the new value on the device.
|
||||
my $new_egresslist = pack("B*", join('', @$egressports));
|
||||
|
||||
$rv = $hp->set_qb_v_egress($new_egresslist, $old_untagged);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hp->error_throw(sprintf("Requested VLAN %s doesn't seem to exist on device...", $vlan));
|
||||
}
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
|
||||
sub set_i_vlan_tagged {
|
||||
my $hp = shift;
|
||||
my $rv;
|
||||
|
||||
my $qb_i_vlan = $hp->qb_i_vlan_t();
|
||||
if (defined $qb_i_vlan and scalar(keys %$qb_i_vlan)){
|
||||
my $vlan = shift;
|
||||
my $iid = shift;
|
||||
|
||||
my $qb_v_egress = $hp->qb_v_egress();
|
||||
if (defined $qb_v_egress and scalar($qb_v_egress->{$vlan})) {
|
||||
|
||||
# First, get the egress list of the VLAN we want to add to the port.
|
||||
my $egressports = $qb_v_egress->{$vlan};
|
||||
|
||||
# Since arrays are zero-based, we have to change the element at Index - 1
|
||||
$egressports->[$iid-1] = "1";
|
||||
|
||||
# After changing, pack the array into a binary structure (expected by set_qb_v_egress) and set the new value on the device.
|
||||
my $new_egresslist = pack("B*", join('', @$egressports));
|
||||
$rv = $hp->set_qb_v_egress($new_egresslist, $vlan);
|
||||
return $rv;
|
||||
} else {
|
||||
$hp->error_throw(sprintf("Requested VLAN %s doesn't seem to exist on device...", $vlan));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -701,8 +676,6 @@ Included in V2 mibs from Cisco
|
||||
|
||||
=item F<HP-ICF-OID>
|
||||
|
||||
=item F<HP-VLAN>
|
||||
|
||||
(this MIB new with SNMP::Info 0.8)
|
||||
|
||||
=item F<STATISTICS-MIB>
|
||||
@@ -711,9 +684,13 @@ Included in V2 mibs from Cisco
|
||||
|
||||
=item F<CONFIG-MIB>
|
||||
|
||||
=item F<HP-ICF-BRIDGE>
|
||||
|
||||
=item F<HP-ICF-POE-MIB>
|
||||
|
||||
=back
|
||||
|
||||
The last five MIBs listed are from HP and can be found at
|
||||
The last four MIBs listed are from HP and can be found at
|
||||
L<http://www.hp.com/rnd/software> or
|
||||
L<http://www.hp.com/rnd/software/MIBs.htm>
|
||||
|
||||
@@ -754,66 +731,84 @@ Returns bytes of used memory
|
||||
Returns the model number of the HP Switch. Will translate between the HP Part
|
||||
number and the common model number with this map :
|
||||
|
||||
%MODEL_MAP = (
|
||||
'J4093A' => '2424M',
|
||||
'J4110A' => '8000M',
|
||||
'J4120A' => '1600M',
|
||||
'J4121A' => '4000M',
|
||||
'J4122A' => '2400M',
|
||||
'J4122B' => '2424M',
|
||||
'J4138A' => '9308M',
|
||||
'J4139A' => '9304M',
|
||||
'J4812A' => '2512',
|
||||
'J4813A' => '2524',
|
||||
'J4815A' => '3324XL',
|
||||
'J4819A' => '5308XL',
|
||||
'J4840A' => '6308M-SX',
|
||||
'J4841A' => '6208M-SX',
|
||||
'J4850A' => '5304XL',
|
||||
'J4851A' => '3124',
|
||||
'J4865A' => '4108GL',
|
||||
'J4874A' => '9315M',
|
||||
'J4887A' => '4104GL',
|
||||
'J4899A' => '2650',
|
||||
'J4899B' => '2650-CR',
|
||||
'J4900A' => '2626',
|
||||
'J4900B' => '2626-CR',
|
||||
'J4902A' => '6108',
|
||||
'J4903A' => '2824',
|
||||
'J4904A' => '2848',
|
||||
'J4905A' => '3400cl-24G',
|
||||
'J4906A' => '3400cl-48G',
|
||||
'J8130A' => 'WAP-420-NA',
|
||||
'J8131A' => 'WAP-420-WW',
|
||||
'J8133A' => 'AP520WL',
|
||||
'J8164A' => '2626-PWR',
|
||||
'J8165A' => '2650-PWR',
|
||||
'J8433A' => 'CX4-6400cl-6XG',
|
||||
'J8474A' => 'MF-6400cl-6XG',
|
||||
'J8680A' => '9608sl',
|
||||
'J8692A' => '3500yl-24G-PWR',
|
||||
'J8693A' => '3500yl-48G-PWR',
|
||||
'J8697A' => '5406zl',
|
||||
'J8698A' => '5412zl',
|
||||
'J8718A' => '5404yl',
|
||||
'J8719A' => '5408yl',
|
||||
'J8770A' => '4204vl',
|
||||
'J8771A' => '4202vl-48G',
|
||||
'J8772A' => '4202vl-72',
|
||||
'J8773A' => '4208vl',
|
||||
'J8762A' => '2600-8-PWR',
|
||||
'J8992A' => '6200yl-24G',
|
||||
'J9019A' => '2510-24A',
|
||||
'J9020A' => '2510-48A',
|
||||
'J9021A' => '2810-24G',
|
||||
'J9022A' => '2810-48G',
|
||||
'J9028A' => '1800-24G',
|
||||
'J9029A' => '1800-8G',
|
||||
'J9050A' => '2900-48G',
|
||||
'J9049A' => '2900-24G',
|
||||
'J9032A' => '4202vl-68G',
|
||||
'J9091A' => '8212zl',
|
||||
);
|
||||
%MODEL_MAP = (
|
||||
'J8131A' => 'WAP-420-WW',
|
||||
'J8130A' => 'WAP-420-NA',
|
||||
'J8133A' => 'AP520WL',
|
||||
'J8680A' => '9408sl',
|
||||
'J9091A' => '8212zl',
|
||||
'J9475A' => '8206zl',
|
||||
'J9265A' => '6600ml-24XG',
|
||||
'J9264A' => '6600ml-24G-4XG',
|
||||
'J9263A' => '6600ml-24G',
|
||||
'J9452A' => '6600-48G-4XG',
|
||||
'J9451A' => '6600-48G',
|
||||
'J8474A' => '6410cl-6XG',
|
||||
'J8433A' => '6400cl-6XG',
|
||||
'J8992A' => '6200yl-24G',
|
||||
'J4902A' => '6108',
|
||||
'J8698A' => '5412zl',
|
||||
'J8719A' => '5408yl',
|
||||
'J8697A' => '5406zl',
|
||||
'J8718A' => '5404yl',
|
||||
'J4819A' => '5308XL',
|
||||
'J4850A' => '5304XL',
|
||||
'J8773A' => '4208vl',
|
||||
'J8770A' => '4204vl',
|
||||
'J8772A' => '4202vl-72',
|
||||
'J9032A' => '4202vl-68G',
|
||||
'J9031A' => '4202vl-68',
|
||||
'J8771A' => '4202vl-48G',
|
||||
'J4865A' => '4108GL',
|
||||
'J4887A' => '4104GL',
|
||||
'J8693A' => '3500yl-48G-PWR',
|
||||
'J8692A' => '3500yl-24G-PWR',
|
||||
'J9473A' => '3500-48-PoE',
|
||||
'J9472A' => '3500-48',
|
||||
'J9471A' => '3500-24-PoE',
|
||||
'J9470A' => '3500-24',
|
||||
'J4906A' => '3400cl-48G',
|
||||
'J4905A' => '3400cl-24G',
|
||||
'J4815A' => '3324XL',
|
||||
'J4851A' => '3124',
|
||||
'J9148A' => '2910al-48G-PoE+',
|
||||
'J9147A' => '2910al-48G',
|
||||
'J9146A' => '2910al-24G-PoE+',
|
||||
'J9145A' => '2910al-24G',
|
||||
'J9050A' => '2900-48G',
|
||||
'J9049A' => '2900-24G',
|
||||
'J4904A' => '2848',
|
||||
'J4903A' => '2824',
|
||||
'J9022A' => '2810-48G',
|
||||
'J9021A' => '2810-24G',
|
||||
'J8165A' => '2650-PWR',
|
||||
'J4899B' => '2650-CR',
|
||||
'J4899C' => '2650C',
|
||||
'J4899A' => '2650',
|
||||
'J8164A' => '2626-PWR',
|
||||
'J4900B' => '2626-CR',
|
||||
'J4900C' => '2626C',
|
||||
'J4900A' => '2626',
|
||||
'J9089A' => '2610-48-PWR',
|
||||
'J9088A' => '2610-48',
|
||||
'J9087A' => '2610-24-PWR',
|
||||
'J9086A' => '2610-24/12PWR',
|
||||
'J9085A' => '2610-24',
|
||||
'J8762A' => '2600-8-PWR',
|
||||
'J4813A' => '2524',
|
||||
'J9137A' => '2520-8-PoE',
|
||||
'J9138A' => '2520-24-PoE',
|
||||
'J4812A' => '2512',
|
||||
'J9280A' => '2510G-48',
|
||||
'J9279A' => '2510G-24',
|
||||
'J9020A' => '2510-48A',
|
||||
'J9019B' => '2510-24B',
|
||||
'J9019A' => '2510-24A',
|
||||
'J4818A' => '2324',
|
||||
'J4817A' => '2312',
|
||||
'J9029A' => '1800-8G',
|
||||
'J9028A' => '1800-24G',
|
||||
);
|
||||
|
||||
=item $hp->os()
|
||||
|
||||
@@ -832,10 +827,6 @@ the description field.
|
||||
|
||||
C<hpSwitchOsVersion.0>
|
||||
|
||||
=item $hp->serial()
|
||||
|
||||
Returns serial number if available through SNMP
|
||||
|
||||
=item $hp->slots()
|
||||
|
||||
Returns number of entries in $hp->e_name that have 'slot' in them.
|
||||
@@ -856,6 +847,16 @@ Power supply 1 status
|
||||
|
||||
Power supply 2 status
|
||||
|
||||
=item $hp->peth_port_power()
|
||||
|
||||
Power supplied by PoE ports, in milliwatts
|
||||
("hpicfPoePethPsePortPower")
|
||||
|
||||
=item $hp->stp_ver()
|
||||
|
||||
Returns what version of STP the device is running.
|
||||
("hpicfBridgeRstpForceVersion" with fallback to inherited stp_ver())
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer2
|
||||
@@ -891,53 +892,14 @@ Returns reference to map of IIDs to current link duplex.
|
||||
|
||||
Returns reference to hash of IIDs to admin duplex setting.
|
||||
|
||||
=item $hp->vendor_i_type()
|
||||
|
||||
Returns reference to hash of IIDs to HP specific port type (hpSwitchPortType).
|
||||
|
||||
=item $hp->i_name()
|
||||
|
||||
Crosses i_name() with $hp->e_name() using $hp->e_port() and i_alias()
|
||||
|
||||
=item $hp->i_vlan()
|
||||
|
||||
Returns a mapping between C<ifIndex> and the PVID (default VLAN) or untagged
|
||||
port when using F<HP-VLAN>.
|
||||
|
||||
Looks in F<Q-BRIDGE-MIB> first (L<SNMP::Info::Bridge/"TABLE METHODS">) and for
|
||||
older devices looks in F<HP-VLAN>.
|
||||
|
||||
=item $hp->i_vlan_membership()
|
||||
|
||||
Returns reference to hash of arrays: key = C<ifIndex>, value = array of VLAN
|
||||
IDs. These are the VLANs which are members of the egress list for the port.
|
||||
It is the union of tagged, untagged, and auto ports when using F<HP-VLAN>.
|
||||
|
||||
Looks in F<Q-BRIDGE-MIB> first (L<SNMP::Info::Bridge/"TABLE METHODS">) and for
|
||||
older devices looks in F<HP-VLAN>.
|
||||
|
||||
Example:
|
||||
my $interfaces = $hp->interfaces();
|
||||
my $vlans = $hp->i_vlan_membership();
|
||||
|
||||
foreach my $iid (sort keys %$interfaces) {
|
||||
my $port = $interfaces->{$iid};
|
||||
my $vlan = join(',', sort(@{$vlans->{$iid}}));
|
||||
print "Port: $port VLAN: $vlan\n";
|
||||
}
|
||||
|
||||
=item $hp->v_index()
|
||||
|
||||
Returns VLAN IDs
|
||||
|
||||
=item $hp->v_name()
|
||||
|
||||
Returns VLAN names
|
||||
|
||||
=item $hp->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface
|
||||
identifier (iid)
|
||||
|
||||
Returns (C<ifIndex>) for both key and value for 1600, 2424, 4000, and 8000
|
||||
models since they seem to have problems with F<BRIDGE-MIB>
|
||||
|
||||
=item $hp->peth_port_ifindex()
|
||||
|
||||
Returns reference to hash of power Ethernet port table entries map back to
|
||||
@@ -1014,4 +976,17 @@ Munge for c_id which handles CDP and LLDP.
|
||||
|
||||
=back
|
||||
|
||||
=head1 SET METHODS
|
||||
|
||||
These are methods that provide SNMP set functionality for overridden methods
|
||||
or provide a simpler interface to complex set operations. See
|
||||
L<SNMP::Info/"SETTING DATA VIA SNMP"> for general information on set
|
||||
operations.
|
||||
|
||||
=over
|
||||
|
||||
=item set_i_vlan()
|
||||
|
||||
=item set_i_vlan_tagged()
|
||||
|
||||
=cut
|
||||
|
||||
721
Info/Layer2/HP4000.pm
Normal file
721
Info/Layer2/HP4000.pm
Normal file
@@ -0,0 +1,721 @@
|
||||
# SNMP::Info::Layer2::HP4000 - SNMP Interface to older HP ProCurve Switches (1600, 2400, 2424M, 4000 and 8000)
|
||||
#
|
||||
# Copyright (c) 2008 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# 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::Layer2::HP4000;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
use SNMP::Info::CDP;
|
||||
|
||||
@SNMP::Info::Layer2::HP4000::ISA
|
||||
= qw/SNMP::Info::Layer3 SNMP::Info::MAU
|
||||
SNMP::Info::CDP Exporter/;
|
||||
@SNMP::Info::Layer2::HP4000::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
'RFC1271-MIB' => 'logDescription',
|
||||
'HP-ICF-OID' => 'hpSwitch4000',
|
||||
'HP-VLAN' => 'hpVlanMemberIndex',
|
||||
'STATISTICS-MIB' => 'hpSwitchCpuStat',
|
||||
'NETSWITCH-MIB' => 'hpMsgBufFree',
|
||||
'CONFIG-MIB' => 'hpSwitchConfig',
|
||||
'SEMI-MIB' => 'hpHttpMgSerialNumber',
|
||||
'HP-ICF-CHASSIS' => 'hpicfSensorObjectId',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'serial1' => 'hpHttpMgSerialNumber.0',
|
||||
'hp_cpu' => 'hpSwitchCpuStat.0',
|
||||
'hp_mem_total' => 'hpGlobalMemTotalBytes.1',
|
||||
'mem_free' => 'hpGlobalMemFreeBytes.1',
|
||||
'mem_used' => 'hpGlobalMemAllocBytes.1',
|
||||
'os_version' => 'hpSwitchOsVersion.0',
|
||||
'os_bin' => 'hpSwitchRomVersion.0',
|
||||
'mac' => 'hpSwitchBaseMACAddress.0',
|
||||
'hp_vlans' => 'hpVlanNumber',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'bp_index2' => 'dot1dBasePortIfIndex',
|
||||
'i_type2' => 'ifType',
|
||||
|
||||
# RFC1271
|
||||
'l_descr' => 'logDescription',
|
||||
|
||||
# HP-VLAN-MIB
|
||||
'hp_v_index' => 'hpVlanDot1QID',
|
||||
'hp_v_name' => 'hpVlanIdentName',
|
||||
'hp_v_state' => 'hpVlanIdentState',
|
||||
'hp_v_type' => 'hpVlanIdentType',
|
||||
'hp_v_status' => 'hpVlanIdentStatus',
|
||||
'hp_v_mac' => 'hpVlanAddrPhysAddress',
|
||||
'hp_v_if_index' => 'hpVlanMemberIndex',
|
||||
'hp_v_if_tag' => 'hpVlanMemberTagged2',
|
||||
|
||||
# CONFIG-MIB::hpSwitchPortTable
|
||||
'hp_duplex' => 'hpSwitchPortEtherMode',
|
||||
'hp_duplex_admin' => 'hpSwitchPortFastEtherMode',
|
||||
'vendor_i_type' => 'hpSwitchPortType',
|
||||
|
||||
# HP-ICF-CHASSIS
|
||||
'hp_s_oid' => 'hpicfSensorObjectId',
|
||||
'hp_s_name' => 'hpicfSensorDescr',
|
||||
'hp_s_status' => 'hpicfSensorStatus',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE
|
||||
);
|
||||
|
||||
%MODEL_MAP = (
|
||||
'J4093A' => '2424M',
|
||||
'J4110A' => '8000M',
|
||||
'J4120A' => '1600M',
|
||||
'J4121A' => '4000M',
|
||||
'J4122A' => '2400M',
|
||||
'J4122B' => '2424M',
|
||||
);
|
||||
|
||||
# Method Overrides
|
||||
|
||||
sub cpu {
|
||||
my $hp = shift;
|
||||
return $hp->hp_cpu();
|
||||
}
|
||||
|
||||
sub mem_total {
|
||||
my $hp = shift;
|
||||
return $hp->hp_mem_total();
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'hp';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $hp = shift;
|
||||
my $os_version = $hp->os_version();
|
||||
return $os_version if defined $os_version;
|
||||
|
||||
# Some older ones don't have this value,so we cull it from the description
|
||||
my $descr = $hp->description();
|
||||
if ( $descr =~ m/revision ([A-Z]{1}\.\d{2}\.\d{2})/ ) {
|
||||
return $1;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
# Lookup model number, and translate the part number to the common number
|
||||
sub model {
|
||||
my $hp = shift;
|
||||
my $id = $hp->id();
|
||||
return unless defined $id;
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^hpswitch//i;
|
||||
|
||||
return defined $MODEL_MAP{$model} ? $MODEL_MAP{$model} : $model;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $hp = shift;
|
||||
my $interfaces = $hp->i_index();
|
||||
my $i_descr = $hp->i_description();
|
||||
|
||||
my %if;
|
||||
foreach my $iid ( keys %$interfaces ) {
|
||||
my $descr = $i_descr->{$iid};
|
||||
next unless defined $descr;
|
||||
$if{$iid} = $descr if ( defined $descr and length $descr );
|
||||
}
|
||||
|
||||
return \%if
|
||||
}
|
||||
|
||||
sub i_name {
|
||||
my $hp = shift;
|
||||
my $i_alias = $hp->i_alias();
|
||||
my $e_name = $hp->e_name();
|
||||
my $e_port = $hp->e_port();
|
||||
|
||||
my %i_name;
|
||||
|
||||
foreach my $port ( keys %$e_name ) {
|
||||
my $iid = $e_port->{$port};
|
||||
next unless defined $iid;
|
||||
my $alias = $i_alias->{$iid};
|
||||
next unless defined $iid;
|
||||
$i_name{$iid} = $e_name->{$port};
|
||||
|
||||
# Check for alias
|
||||
$i_name{$iid} = $alias if ( defined $alias and length($alias) );
|
||||
}
|
||||
|
||||
return \%i_name;
|
||||
}
|
||||
|
||||
sub i_duplex {
|
||||
my $hp = shift;
|
||||
|
||||
return $hp->mau_i_duplex();
|
||||
}
|
||||
|
||||
sub i_duplex_admin {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
# Try HP MIB first
|
||||
my $hp_duplex = $hp->hp_duplex_admin($partial);
|
||||
if ( defined $hp_duplex and scalar( keys %$hp_duplex ) ) {
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $if ( keys %$hp_duplex ) {
|
||||
my $duplex = $hp_duplex->{$if};
|
||||
next unless defined $duplex;
|
||||
|
||||
$duplex = 'half' if $duplex =~ /half/i;
|
||||
$duplex = 'full' if $duplex =~ /full/i;
|
||||
$duplex = 'auto' if $duplex =~ /auto/i;
|
||||
$i_duplex{$if} = $duplex;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
else {
|
||||
return $hp->mau_i_duplex_admin();
|
||||
}
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'hp';
|
||||
}
|
||||
|
||||
sub log {
|
||||
my $hp = shift;
|
||||
|
||||
my $log = $hp->l_descr();
|
||||
|
||||
my $logstring = undef;
|
||||
|
||||
foreach my $val ( values %$log ) {
|
||||
next if $val =~ /^Link\s+(Up|Down)/;
|
||||
$logstring .= "$val\n";
|
||||
}
|
||||
|
||||
return $logstring;
|
||||
}
|
||||
|
||||
sub slots {
|
||||
my $hp = shift;
|
||||
|
||||
my $e_name = $hp->e_name();
|
||||
|
||||
return unless defined $e_name;
|
||||
|
||||
my $slots;
|
||||
foreach my $slot ( keys %$e_name ) {
|
||||
$slots++ if $e_name->{$slot} =~ /slot/i;
|
||||
}
|
||||
|
||||
return $slots;
|
||||
}
|
||||
|
||||
sub fan {
|
||||
my $hp = shift;
|
||||
return &_sensor( $hp, 'fan' );
|
||||
}
|
||||
|
||||
sub ps1_status {
|
||||
my $hp = shift;
|
||||
return &_sensor( $hp, 'power', '^power supply 1' )
|
||||
|| &_sensor( $hp, 'power', '^power supply sensor' );
|
||||
}
|
||||
|
||||
sub ps2_status {
|
||||
my $hp = shift;
|
||||
return &_sensor( $hp, 'power', '^power supply 2' )
|
||||
|| &_sensor( $hp, 'power', '^redundant' );
|
||||
}
|
||||
|
||||
sub _sensor {
|
||||
my $hp = shift;
|
||||
my $search_type = shift || 'fan';
|
||||
my $search_name = shift || '';
|
||||
my $hp_s_oid = $hp->hp_s_oid();
|
||||
my $result;
|
||||
foreach my $sensor ( keys %$hp_s_oid ) {
|
||||
my $sensortype = &SNMP::translateObj( $hp_s_oid->{$sensor} );
|
||||
if ( $sensortype =~ /$search_type/i ) {
|
||||
my $sensorname = $hp->hp_s_name()->{$sensor};
|
||||
my $sensorstatus = $hp->hp_s_status()->{$sensor};
|
||||
if ( $sensorname =~ /$search_name/i ) {
|
||||
$result = $sensorstatus;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
|
||||
# Bridge MIB does not map Bridge Port to ifIndex correctly on older models, but Bridge Port equals ifIndex in these devices
|
||||
sub bp_index {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $if_index = $hp->i_index($partial);
|
||||
my %mod_bp_index;
|
||||
foreach my $iid ( keys %$if_index ) {
|
||||
$mod_bp_index{$iid} = $iid;
|
||||
}
|
||||
return \%mod_bp_index;
|
||||
}
|
||||
|
||||
# VLAN methods. Devices in this class use the proprietary HP-VLAN-MIB.
|
||||
|
||||
sub v_index {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $hp->hp_v_index($partial);
|
||||
}
|
||||
|
||||
sub v_name {
|
||||
my $hp = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $hp->hp_v_name($partial);
|
||||
}
|
||||
|
||||
sub i_vlan {
|
||||
my $hp = shift;
|
||||
|
||||
# the hpvlanmembertagged2 table has an entry in the form of
|
||||
# vlan.interface = /untagged/no/tagged/auto
|
||||
my $i_vlan = {};
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
my $hp_v_if_tag = $hp->hp_v_if_tag();
|
||||
foreach my $row ( keys %$hp_v_if_tag ) {
|
||||
my ( $index, $if ) = split( /\./, $row );
|
||||
|
||||
my $tag = $hp_v_if_tag->{$row};
|
||||
my $vlan = $hp_v_index->{$index};
|
||||
|
||||
next unless ( defined $tag and $tag =~ /untagged/ );
|
||||
|
||||
$i_vlan->{$if} = $vlan if defined $vlan;
|
||||
}
|
||||
|
||||
return $i_vlan;
|
||||
}
|
||||
|
||||
sub i_vlan_membership {
|
||||
my $hp = shift;
|
||||
|
||||
my $i_vlan_membership = {};
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
my $hp_v_if_tag = $hp->hp_v_if_tag();
|
||||
foreach my $row ( keys %$hp_v_if_tag ) {
|
||||
my ( $index, $if ) = split( /\./, $row );
|
||||
|
||||
my $tag = $hp_v_if_tag->{$row};
|
||||
my $vlan = $hp_v_index->{$index};
|
||||
|
||||
next unless ( defined $tag );
|
||||
next if ( $tag eq 'no' );
|
||||
|
||||
push( @{ $i_vlan_membership->{$if} }, $vlan );
|
||||
}
|
||||
|
||||
return $i_vlan_membership;
|
||||
}
|
||||
|
||||
sub set_i_vlan {
|
||||
my $hp = shift;
|
||||
my $rv;
|
||||
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
my $hp_v_if_tag = $hp->hp_v_if_tag();
|
||||
if (defined $hp_v_index and scalar(keys %$hp_v_index)){
|
||||
my $vlan = shift;
|
||||
my $iid = shift;
|
||||
my $old_untagged;
|
||||
# Hash to lookup VLAN index of the VID (dot1q tag)
|
||||
my %vl_trans = reverse %$hp_v_index;
|
||||
|
||||
# Translate the VLAN identifier (tag) value to the index used by the HP-VLAN MIB
|
||||
my $vlan_index = $vl_trans{$vlan};
|
||||
if (defined $vlan_index) {
|
||||
|
||||
# First, loop through table to determine current untagged vlan for the port we're about to change
|
||||
foreach my $row (keys %$hp_v_if_tag){
|
||||
my ($index,$if) = split(/\./,$row);
|
||||
if ($if == $iid and $hp_v_if_tag->{$row} =~ /untagged/) {
|
||||
# Store the row information of the current untagged VLAN and temporarily set it to tagged
|
||||
$old_untagged = $row;
|
||||
$rv = $hp->set_hp_v_if_tag(1, $row);
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
# Then set our port untagged in the desired VLAN
|
||||
my $rv = $hp->set_hp_v_if_tag(2, "$vlan_index.$iid");
|
||||
if (defined $rv) {
|
||||
# If vlan change is successful, remove VLAN that used to be untagged from the port
|
||||
if (defined $old_untagged) {
|
||||
$rv = $hp->set_hp_v_if_tag(3, $old_untagged);
|
||||
$hp->error_throw("Error removing previous untagged vlan from port, should never happen...\n") unless defined $rv;
|
||||
}
|
||||
} else {
|
||||
# If vlan change was not succesful, try to revert to the old situation.
|
||||
if (defined $old_untagged) {
|
||||
$rv = $hp->set_hp_v_if_tag(2, $old_untagged) if defined $old_untagged;
|
||||
if (defined $rv) {
|
||||
$hp->error_throw("VLAN change failed, restored port to previous configuration.\n");
|
||||
} else {
|
||||
$hp->error_throw("VLAN change failed, unable to restore old configuration. Check device.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$hp->error_throw("Requested VLAN (VLAN ID: $vlan) not available on device.\n");
|
||||
}
|
||||
} else {
|
||||
$hp->error_throw("Error retrieving VLAN information from device.\n");
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
|
||||
sub set_i_vlan_tagged {
|
||||
my $hp = shift;
|
||||
my $vlan = shift;
|
||||
my $iid = shift;
|
||||
my $rv;
|
||||
|
||||
my $hp_v_index = $hp->hp_v_index();
|
||||
if (defined $hp_v_index and scalar(keys %$hp_v_index)){
|
||||
# Hash to lookup VLAN index of the VID (dot1q tag)
|
||||
my %vl_trans = reverse %$hp_v_index;
|
||||
|
||||
# Translate the VLAN identifier (tag) value to the index used by the HP-VLAN MIB
|
||||
my $vlan_index = $vl_trans{$vlan};
|
||||
if (defined $vlan_index) {
|
||||
# Set our port tagged in the desired VLAN
|
||||
$rv = $hp->set_hp_v_if_tag(1, "$vlan_index.$iid");
|
||||
} else {
|
||||
$hp->error_throw("Requested VLAN (VLAN ID: $vlan) not available on device.\n");
|
||||
}
|
||||
}
|
||||
return $rv;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::HP4000 - SNMP Interface to older HP ProCurve Switches (1600, 2400, 2424M, 4000 and 8000)
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $hp = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $hp->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a
|
||||
HP ProCurve Switch via SNMP.
|
||||
|
||||
Note: Some HP Switches will connect via SNMP version 1, but a lot of config
|
||||
data will not be available. Make sure you try and connect with Version 2
|
||||
first, and then fail back to version 1.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not
|
||||
after determining a more specific class using the method above.
|
||||
|
||||
my $hp = new SNMP::Info::Layer2::HP4000(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer2
|
||||
|
||||
|
||||
=item SNMP::Info::MAU
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<RFC1271-MIB>
|
||||
|
||||
Included in V2 mibs from Cisco
|
||||
|
||||
=item F<HP-ICF-OID>
|
||||
|
||||
=item F<HP-VLAN>
|
||||
|
||||
(this MIB new with SNMP::Info 0.8)
|
||||
|
||||
=item F<STATISTICS-MIB>
|
||||
|
||||
=item F<NETSWITCH-MIB>
|
||||
|
||||
=item F<CONFIG-MIB>
|
||||
|
||||
=back
|
||||
|
||||
The last five MIBs listed are from HP and can be found at
|
||||
L<http://www.hp.com/rnd/software> or
|
||||
L<http://www.hp.com/rnd/software/MIBs.htm>
|
||||
|
||||
=head1 Change Log
|
||||
|
||||
Version 0.4 - Removed F<ENTITY-MIB> e_*() methods to separate sub-class -
|
||||
SNMP::Info::Entity
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $hp->cpu()
|
||||
|
||||
Returns CPU Utilization in percentage.
|
||||
|
||||
=item $hp->log()
|
||||
|
||||
Returns all the log entries from the switch's log that are not Link up or
|
||||
down messages.
|
||||
|
||||
=item $hp->mem_free()
|
||||
|
||||
Returns bytes of free memory
|
||||
|
||||
=item $hp->mem_total()
|
||||
|
||||
Return bytes of total memory
|
||||
|
||||
=item $hp->mem_used()
|
||||
|
||||
Returns bytes of used memory
|
||||
|
||||
=item $hp->model()
|
||||
|
||||
Returns the model number of the HP Switch. Will translate between the HP Part
|
||||
number and the common model number with this map :
|
||||
|
||||
%MODEL_MAP = (
|
||||
'J4093A' => '2424M',
|
||||
'J4110A' => '8000M',
|
||||
'J4120A' => '1600M',
|
||||
'J4121A' => '4000M',
|
||||
'J4122A' => '2400M',
|
||||
'J4122B' => '2424M',
|
||||
);
|
||||
|
||||
=item $hp->os()
|
||||
|
||||
Returns hp
|
||||
|
||||
=item $hp->os_bin()
|
||||
|
||||
C<hpSwitchRomVersion.0>
|
||||
|
||||
=item $hp->os_ver()
|
||||
|
||||
Tries to use os_version() and if that fails will try and cull the version from
|
||||
the description field.
|
||||
|
||||
=item $hp->os_version()
|
||||
|
||||
C<hpSwitchOsVersion.0>
|
||||
|
||||
=item $hp->serial()
|
||||
|
||||
Returns serial number if available through SNMP
|
||||
|
||||
=item $hp->slots()
|
||||
|
||||
Returns number of entries in $hp->e_name that have 'slot' in them.
|
||||
|
||||
=item $hp->vendor()
|
||||
|
||||
hp
|
||||
|
||||
=item $hp->fan()
|
||||
|
||||
Returns fan status
|
||||
|
||||
=item $hp->ps1_status()
|
||||
|
||||
Power supply 1 status
|
||||
|
||||
=item $hp->ps2_status()
|
||||
|
||||
Power supply 2 status
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2/"GLOBALS"> for details.
|
||||
|
||||
=head2 Globals 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.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $hp->interfaces()
|
||||
|
||||
Uses $hp->i_description()
|
||||
|
||||
=item $hp->i_duplex()
|
||||
|
||||
Returns reference to map of IIDs to current link duplex.
|
||||
|
||||
=item $hp->i_duplex_admin()
|
||||
|
||||
Returns reference to hash of IIDs to admin duplex setting.
|
||||
|
||||
=item $hp->vendor_i_type()
|
||||
|
||||
Returns reference to hash of IIDs to HP specific port type (hpSwitchPortType).
|
||||
|
||||
=item $hp->i_name()
|
||||
|
||||
Crosses i_name() with $hp->e_name() using $hp->e_port() and i_alias()
|
||||
|
||||
=item $hp->i_vlan()
|
||||
|
||||
Returns a mapping between C<ifIndex> and the PVID (default VLAN) or untagged
|
||||
port when using F<HP-VLAN>.
|
||||
|
||||
=item $hp->i_vlan_membership()
|
||||
|
||||
Returns reference to hash of arrays: key = C<ifIndex>, value = array of VLAN
|
||||
IDs. These are the VLANs which are members of the egress list for the port.
|
||||
It is the union of tagged, untagged, and auto ports.
|
||||
|
||||
Example:
|
||||
my $interfaces = $hp->interfaces();
|
||||
my $vlans = $hp->i_vlan_membership();
|
||||
|
||||
foreach my $iid (sort keys %$interfaces) {
|
||||
my $port = $interfaces->{$iid};
|
||||
my $vlan = join(',', sort(@{$vlans->{$iid}}));
|
||||
print "Port: $port VLAN: $vlan\n";
|
||||
}
|
||||
|
||||
=item $hp->v_index()
|
||||
|
||||
Returns VLAN IDs
|
||||
|
||||
=item $hp->v_name()
|
||||
|
||||
Returns VLAN names
|
||||
|
||||
=item $hp->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface
|
||||
identifier (iid)
|
||||
|
||||
Returns (C<ifIndex>) for both key and value for 1600, 2424, 4000, and 8000
|
||||
models since they seem to have problems with F<BRIDGE-MIB>
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in L<SNMP::Info::Layer2/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in L<SNMP::Info::MAU/"TABLE METHODS"> for details.
|
||||
|
||||
=head1 SET METHODS
|
||||
|
||||
These are methods that provide SNMP set functionality for overridden methods
|
||||
or provide a simpler interface to complex set operations. See
|
||||
L<SNMP::Info/"SETTING DATA VIA SNMP"> for general information on set
|
||||
operations.
|
||||
|
||||
=over
|
||||
|
||||
=item set_i_vlan()
|
||||
|
||||
=item set_i_vlan_tagged()
|
||||
|
||||
=cut
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Airespace;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS, %SNMP::Info::IEEE802dot11::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS, );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
@@ -114,6 +114,8 @@ sub model {
|
||||
|
||||
return $1 if ( $descr =~ /(AP-\d+)/ );
|
||||
return 'WavePOINT-II' if ( $descr =~ /WavePOINT-II/ );
|
||||
return 'Outdoor Router' if ( $descr =~ /Wireless Router/ );
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer2;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS );
|
||||
|
||||
@@ -39,15 +39,17 @@ use SNMP::Info::Bridge;
|
||||
use SNMP::Info::EtherLike;
|
||||
use SNMP::Info::Entity;
|
||||
use SNMP::Info::PowerEthernet;
|
||||
use SNMP::Info::IPv6;
|
||||
|
||||
@SNMP::Info::Layer3::ISA = qw/SNMP::Info::PowerEthernet
|
||||
@SNMP::Info::Layer3::ISA = qw/
|
||||
SNMP::Info::PowerEthernet SNMP::Info::IPv6
|
||||
SNMP::Info::Entity SNMP::Info::EtherLike
|
||||
SNMP::Info::Bridge SNMP::Info Exporter/;
|
||||
@SNMP::Info::Layer3::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
@@ -55,6 +57,7 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::EtherLike::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
%SNMP::Info::PowerEthernet::MIBS,
|
||||
%SNMP::Info::IPv6::MIBS,
|
||||
'IP-MIB' => 'ipNetToMediaIfIndex',
|
||||
'OSPF-MIB' => 'ospfRouterId',
|
||||
'BGP4-MIB' => 'bgpIdentifier',
|
||||
@@ -68,6 +71,7 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::EtherLike::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
%SNMP::Info::PowerEthernet::GLOBALS,
|
||||
%SNMP::Info::IPv6::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
'serial1' =>
|
||||
'.1.3.6.1.4.1.9.3.6.3.0', # OLD-CISCO-CHASSIS-MIB::chassisId.0
|
||||
@@ -82,6 +86,7 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::EtherLike::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
%SNMP::Info::PowerEthernet::FUNCS,
|
||||
%SNMP::Info::IPv6::FUNCS,
|
||||
|
||||
# Obsolete Address Translation Table (ARP Cache)
|
||||
'old_at_index' => 'atIfIndex',
|
||||
@@ -120,6 +125,14 @@ $VERSION = '2.01';
|
||||
'bgp_peer_in_upd' => 'bgpPeerInUpdates',
|
||||
'bgp_peer_out_tot_msgs' => 'bgpPeerOutTotalMessages',
|
||||
'bgp_peer_out_upd' => 'bgpPeerOutUpdates',
|
||||
|
||||
# IP-MIB Net to Physical Table (ARP Cache)
|
||||
'n2p_paddr' => 'ipNetToPhysicalPhysAddress',
|
||||
'n2p_lastupdate' => 'ipNetToPhysicalLastUpdated',
|
||||
'n2p_ptype' => 'ipNetToPhysicalType',
|
||||
'n2p_pstate' => 'ipNetToPhysicalState',
|
||||
'n2p_pstatus' => 'ipNetToPhysicalRowStatus',
|
||||
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -130,8 +143,10 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::EtherLike::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
%SNMP::Info::PowerEthernet::MUNGE,
|
||||
%SNMP::Info::IPv6::MUNGE,
|
||||
'old_at_paddr' => \&SNMP::Info::munge_mac,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
'n2p_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
# Method OverRides
|
||||
@@ -385,6 +400,10 @@ after determining a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::Entity
|
||||
|
||||
=item SNMP::Info::PowerEthernet
|
||||
|
||||
=item SNMP::Info::IPv6
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -409,6 +428,10 @@ See L<SNMP::Info::EtherLike/"Required MIBs"> for its MIB requirements.
|
||||
|
||||
See L<SNMP::Info::Entity/"Required MIBs"> for its MIB requirements.
|
||||
|
||||
See L<SNMP::Info::PowerEthernet/"Required MIBs"> for its MIB requirements.
|
||||
|
||||
See L<SNMP::Info::IPv6/"Required MIBs"> for its MIB requirements.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
@@ -749,4 +772,12 @@ See L<SNMP::Info::EtherLike/"TABLE METHODS"> for details.
|
||||
|
||||
See L<SNMP::Info::Entity/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::PowerEthernet
|
||||
|
||||
See L<SNMP::Info::PowerEthernet/"TABLE METHODS"> for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::IPv6
|
||||
|
||||
See L<SNMP::Info::IPv6/"TABLE METHODS"> for details.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SNMP::Info::Layer2::Aruba
|
||||
# SNMP::Info::Layer3::Aruba
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2008 Eric Miller
|
||||
@@ -28,31 +28,31 @@
|
||||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
# POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Aruba;
|
||||
package SNMP::Info::Layer3::Aruba;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::Layer3;
|
||||
|
||||
@SNMP::Info::Layer2::Aruba::ISA = qw/SNMP::Info::Layer2 Exporter/;
|
||||
@SNMP::Info::Layer2::Aruba::EXPORT_OK = qw//;
|
||||
@SNMP::Info::Layer3::Aruba::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Aruba::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'WLSX-SWITCH-MIB' => 'wlsxHostname',
|
||||
'WLSX-WLAN-MIB' => 'wlanAPFQLN',
|
||||
'WLSR-AP-MIB' => 'wlsrHideSSID',
|
||||
#'ALCATEL-IND1-TP-DEVICES' => 'familyOmniAccessWireless',
|
||||
);
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, );
|
||||
%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, );
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
|
||||
# WLSX-SWITCH-MIB::wlsxSwitchAccessPointTable
|
||||
# Table index leafs do not return information
|
||||
@@ -79,10 +79,10 @@ $VERSION = '2.01';
|
||||
'fw_user' => 'staUserName',
|
||||
);
|
||||
|
||||
%MUNGE = ( %SNMP::Info::Layer2::MUNGE, );
|
||||
%MUNGE = ( %SNMP::Info::Layer3::MUNGE, );
|
||||
|
||||
sub layers {
|
||||
return '00000011';
|
||||
return '00000111';
|
||||
}
|
||||
|
||||
sub os {
|
||||
@@ -421,7 +421,7 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::Aruba - SNMP Interface to Aruba wireless switches
|
||||
SNMP::Info::Layer3::Aruba - SNMP Interface to Aruba wireless switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
@@ -444,7 +444,7 @@ Eric Miller
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::Layer2::Aruba is a subclass of SNMP::Info that provides an
|
||||
SNMP::Info::Layer3::Aruba is a subclass of SNMP::Info that provides an
|
||||
interface to Aruba wireless switches. The Aruba platform utilizes
|
||||
intelligent wireless switches which control thin access points. The thin
|
||||
access points themselves are unable to be polled for end station information.
|
||||
@@ -456,13 +456,13 @@ the end station is using for communication.
|
||||
For speed or debugging purposes you can call the subclass directly, but not
|
||||
after determining a more specific class using the method above.
|
||||
|
||||
my $aruba = new SNMP::Info::Layer2::Aruba(...);
|
||||
my $aruba = new SNMP::Info::Layer3::Aruba(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer2
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=back
|
||||
|
||||
@@ -478,7 +478,7 @@ after determining a more specific class using the method above.
|
||||
|
||||
=head2 Inherited MIBs
|
||||
|
||||
See L<SNMP::Info::Layer2/"Required MIBs"> for its MIB requirements.
|
||||
See L<SNMP::Info::Layer3/"Required MIBs"> for its MIB requirements.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
@@ -516,9 +516,9 @@ proprietary MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer2
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See L<SNMP::Info::Layer2/"GLOBALS"> for details.
|
||||
See L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
@@ -641,8 +641,8 @@ Returns F<aruba_perap_fqln> indexed by BSSID instead of by AP.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See L<SNMP::Info::Layer2/"TABLE METHODS"> for details.
|
||||
See L<SNMP::Info::Layer3/"TABLE METHODS"> for details.
|
||||
|
||||
=cut
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Bridge;
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE %MODEL_MAP
|
||||
%MODID_MAP %PROCID_MAP/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
|
||||
@@ -35,6 +35,7 @@ use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CiscoStack;
|
||||
use SNMP::Info::LLDP;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoConfig;
|
||||
use SNMP::Info::CiscoStats;
|
||||
@@ -51,6 +52,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CiscoStpExtensions
|
||||
SNMP::Info::CiscoStack
|
||||
SNMP::Info::LLDP
|
||||
SNMP::Info::CDP
|
||||
SNMP::Info::CiscoStats
|
||||
SNMP::Info::CiscoImage
|
||||
@@ -62,7 +64,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# NOTE: Order creates precedence
|
||||
# Example: v_name exists in Bridge.pm and CiscoVTP.pm
|
||||
@@ -74,8 +76,9 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::CiscoPower::MIBS,
|
||||
%SNMP::Info::CiscoConfig::MIBS, %SNMP::Info::CiscoPortSecurity::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS, %SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CDP::MIBS, %SNMP::Info::CiscoStack::MIBS,
|
||||
%SNMP::Info::CiscoStpExtensions::MIBS, %SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS, %SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS, %SNMP::Info::CiscoStpExtensions::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
);
|
||||
|
||||
|
||||
@@ -86,6 +89,7 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::CiscoPortSecurity::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStack::GLOBALS,
|
||||
%SNMP::Info::CiscoStpExtensions::GLOBALS,
|
||||
@@ -96,16 +100,18 @@ $VERSION = '2.01';
|
||||
%SNMP::Info::Layer3::FUNCS, %SNMP::Info::CiscoPower::FUNCS,
|
||||
%SNMP::Info::CiscoConfig::FUNCS, %SNMP::Info::CiscoPortSecurity::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS, %SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS, %SNMP::Info::CiscoStack::FUNCS,
|
||||
%SNMP::Info::CiscoStpExtensions::FUNCS, %SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS, %SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStack::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::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE, %SNMP::Info::CiscoStack::MUNGE,
|
||||
%SNMP::Info::CiscoStpExtensions::MUNGE, %SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE, %SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStack::MUNGE, %SNMP::Info::CiscoStpExtensions::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
@@ -230,6 +236,141 @@ sub cisco_comm_indexing {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Use CDP and/or LLDP
|
||||
sub hasCDP {
|
||||
my $c3550 = shift;
|
||||
return $c3550->hasLLDP() || $c3550->SUPER::hasCDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $c3550 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $cdp = $c3550->SUPER::c_ip($partial) || {};
|
||||
my $lldp = $c3550->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 $c3550 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $cdp = $c3550->SUPER::c_if($partial) || {};
|
||||
|
||||
my %c_if;
|
||||
foreach my $iid ( keys %$cdp ) {
|
||||
my $if = $cdp->{$iid};
|
||||
next unless defined $if;
|
||||
|
||||
$c_if{$iid} = $if;
|
||||
}
|
||||
|
||||
# We need to match the lldp key with the ifIndex
|
||||
# via lldpLocPortId and ifName
|
||||
my $i_name = $c3550->ifName($partial) || {};
|
||||
my $i_name_rev = {};
|
||||
while ( my($key,$val) = each %$i_name ){
|
||||
$i_name_rev->{$val} = $key;
|
||||
}
|
||||
my $loc_port_id = $c3550->lldpLocPortId($partial) || {};
|
||||
my $lldp = $c3550->lldp_if($partial) || {};
|
||||
|
||||
foreach my $iid ( keys %$lldp ) {
|
||||
my $if = $lldp->{$iid} || next;
|
||||
my $name = $loc_port_id->{$if} || next;
|
||||
my $i_index = $i_name_rev->{$name} || next;
|
||||
$c_if{$iid} = $i_index;
|
||||
}
|
||||
return \%c_if;
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $c3550 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $c3550->lldp_port($partial) || {};
|
||||
my $cdp = $c3550->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 $c3550 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $c3550->lldp_id($partial) || {};
|
||||
my $cdp = $c3550->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 $c3550 = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $lldp = $c3550->lldp_rem_sysdesc($partial) || {};
|
||||
my $cdp = $c3550->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__
|
||||
|
||||
@@ -289,6 +430,8 @@ after determining a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::LLDP
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
@@ -320,6 +463,8 @@ See L<SNMP::Info::CiscoImage/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::CDP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::LLDP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -349,6 +494,23 @@ Returns 1. Use vlan indexing.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Topology information
|
||||
|
||||
Based upon the firmware version Cisco devices may support Link Layer Discovery
|
||||
Protocol (LLDP) in addition to Cisco Discovery Protocol (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 $c3550->hasCDP()
|
||||
|
||||
Returns true if the device is running either CDP or LLDP.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
@@ -377,6 +539,10 @@ See documentation in L<SNMP::Info::CiscoStack/"GLOBALS"> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::CDP/"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::CiscoStats
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoStats/"GLOBALS"> for details.
|
||||
@@ -390,6 +556,40 @@ See documentation in L<SNMP::Info::CiscoImage/"GLOBALS"> for details.
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=item $c3550->c_if()
|
||||
|
||||
Returns reference to hash. Key: iid Value: local device port (interfaces)
|
||||
|
||||
=item $c3550->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 $c3550->c_port()
|
||||
|
||||
Returns reference to hash. Key: iid Value: remote port (interfaces)
|
||||
|
||||
=item $c3550->c_id()
|
||||
|
||||
Returns reference to hash. Key: iid Value: string value used to identify the
|
||||
chassis component associated with the remote system.
|
||||
|
||||
=item $c3550->c_platform()
|
||||
|
||||
Returns reference to hash. Key: iid Value: Remote Device Type
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
@@ -459,6 +659,10 @@ See documentation in L<SNMP::Info::CiscoStack/"TABLE METHODS"> for details.
|
||||
|
||||
See documentation in L<SNMP::Info::CDP/"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::CiscoStats
|
||||
|
||||
See documentation in L<SNMP::Info::CiscoStats/"TABLE METHODS"> for details.
|
||||
|
||||
@@ -50,7 +50,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -64,7 +64,7 @@ use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
# 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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
223
Info/Layer3/CiscoFWSM.pm
Normal file
223
Info/Layer3/CiscoFWSM.pm
Normal file
@@ -0,0 +1,223 @@
|
||||
# SNMP::Info::Layer3::CiscoFWSM
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2010 Brian De Wolf
|
||||
# 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::CiscoFWSM;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3::Cisco;
|
||||
|
||||
@SNMP::Info::Layer3::CiscoFWSM::ISA = qw/SNMP::Info::Layer3::Cisco
|
||||
Exporter/;
|
||||
@SNMP::Info::Layer3::CiscoFWSM::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::Cisco::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::Cisco::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::Cisco::FUNCS,
|
||||
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::Cisco::MUNGE,
|
||||
);
|
||||
|
||||
|
||||
# For FWSMs, the ipNetToPhysicalPhysAddress table appears to be of the form:
|
||||
# $ifindex.$inetaddresstype.$proto.$ip_address -> $mac_address
|
||||
#
|
||||
# Using the output of ipNetToPhysicalPhysAddress, we can emulate the other
|
||||
# functions.
|
||||
#
|
||||
# This doesn't really line up to what at_* return, so we munge it
|
||||
|
||||
sub at_paddr {
|
||||
my ($fwsm) = shift;
|
||||
my ($partial) = shift;
|
||||
|
||||
my $paddrs = $fwsm->n2p_paddr($partial);
|
||||
my $n_paddrs = {};
|
||||
|
||||
foreach my $key (keys %$paddrs) {
|
||||
my $paddr = $paddrs->{$key};
|
||||
my @parts = split /\./, $key;
|
||||
my ($ifindex, $addrtype, $proto) = splice @parts, 0, 3;
|
||||
my $ip = join ".", @parts;
|
||||
|
||||
next if($proto != 4); # at_paddr doesn't support non-IPv4
|
||||
|
||||
$n_paddrs->{"$ifindex.$ip"} = $paddr;
|
||||
}
|
||||
return $n_paddrs;
|
||||
}
|
||||
|
||||
sub at_netaddr {
|
||||
my ($fwsm) = shift;
|
||||
my ($partial) = shift;
|
||||
|
||||
my $paddrs = $fwsm->n2p_paddr($partial);
|
||||
|
||||
my $netaddrs = {};
|
||||
|
||||
foreach my $key (keys %$paddrs) {
|
||||
my $paddr = $paddrs->{$key};
|
||||
my @parts = split /\./, $key;
|
||||
my ($ifindex, $addrtype, $proto) = splice @parts, 0, 3;
|
||||
my $ip = join ".", @parts;
|
||||
|
||||
next if($proto != 4); # at_netaddr doesn't support non-IPv4
|
||||
|
||||
$netaddrs->{"$ifindex.$ip"} = $ip;
|
||||
}
|
||||
return $netaddrs;
|
||||
}
|
||||
|
||||
sub at_ifaddr {
|
||||
my ($fwsm) = shift;
|
||||
my ($partial) = shift;
|
||||
|
||||
my $paddrs = $fwsm->n2p_paddr($partial);
|
||||
|
||||
my $ifaddrs = {};
|
||||
|
||||
foreach my $key (keys %$paddrs) {
|
||||
my $paddr = $paddrs->{$key};
|
||||
my @parts = split /\./, $key;
|
||||
my ($ifindex, $addrtype, $proto) = splice @parts, 0, 3;
|
||||
my $ip = join ".", @parts;
|
||||
|
||||
next if($proto != 4); # at_ifaddr doesn't support non-IPv4
|
||||
|
||||
$ifaddrs->{"$ifindex.$ip"} = $ip;
|
||||
}
|
||||
return $ifaddrs;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::CiscoFWSM - SNMP Interface to Firewall Services Modules for
|
||||
features not covered elsewhere.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Brian De Wolf
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $fwsm = 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 = $fwsm->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Cisco Firewall Services Modules
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3::Cisco
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3::Cisco/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::Layer3::Cisco
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Cisco/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $fwsm->at_paddr()
|
||||
|
||||
This function derives the at_paddr information from the n2p_paddr() table as
|
||||
the MIB to provide that information isn't supported on FWSMs.
|
||||
|
||||
=item $fwsm->at_netaddr()
|
||||
|
||||
This function derives the at_netaddr information from the n2p_paddr() table as
|
||||
the MIB to provide that information isn't supported on FWSMs.
|
||||
|
||||
=item $fwsm->at_ifaddr()
|
||||
|
||||
This function derives the at_ifaddr information from the n2p_paddr() table as
|
||||
the MIB to provide that information isn't supported on FWSMs.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3::Cisco
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3::Cisco/"TABLE METHODS"> for details.
|
||||
|
||||
=cut
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer3::Contivity
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2008 Eric Miller
|
||||
# Copyright (c) 2010 Eric Miller
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, %SNMP::Info::Entity::MIBS,
|
||||
@@ -77,7 +77,7 @@ sub model {
|
||||
|
||||
my $model = $e_model->{1} || undef;
|
||||
|
||||
return $1 if ( defined $model and $model =~ /(CES\d+)/i );
|
||||
return $1 if ( defined $model and $model =~ /(CES\d+|NVR\d+)/i );
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::CDP::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
@@ -52,6 +52,7 @@ $VERSION = '2.01';
|
||||
'EXTREME-SYSTEM-MIB' => 'extremeSystem',
|
||||
'EXTREME-FDB-MIB' => 'extremeSystem',
|
||||
'EXTREME-VLAN-MIB' => 'extremeVlan',
|
||||
'EXTREME-POE-MIB' => 'extremePethSystemAdminEnable',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -82,6 +83,8 @@ $VERSION = '2.01';
|
||||
|
||||
# EXTREME-VLAN-MIB:extremeVlanEncapsIfTable
|
||||
'ex_vlan_encap_tag' => 'extremeVlanEncapsIfTag',
|
||||
|
||||
'peth_port_power' => 'extremePethPortMeasuredPower',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -587,6 +590,8 @@ my $extreme = new SNMP::Info::Layer3::Extreme(...);
|
||||
|
||||
=item F<EXTREME-VLAN-MIB>
|
||||
|
||||
=item F<EXTREME-POE-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See classes listed above for their required MIBs.
|
||||
@@ -748,6 +753,11 @@ identifier (iid)
|
||||
Returns (C<ifIndex>) for both key and value since we're using
|
||||
F<EXTREME-FDB-MIB> rather than F<BRIDGE-MIB>.
|
||||
|
||||
=item $extreme->peth_port_power()
|
||||
|
||||
Power supplied by PoE ports, in milliwatts
|
||||
("extremePethPortMeasuredPower")
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
@@ -808,6 +818,7 @@ 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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -42,7 +42,7 @@ use SNMP::Info::LLDP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -33,25 +33,33 @@ package SNMP::Info::Layer3::Juniper;
|
||||
use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::LLDP;
|
||||
|
||||
@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 SNMP::Info::LLDP Exporter/;
|
||||
@SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
'JUNIPER-CHASSIS-DEFINES-MIB' => 'jnxChassisDefines',
|
||||
'JUNIPER-MIB' => 'jnxBoxAnatomy',
|
||||
);
|
||||
|
||||
%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, 'serial' => 'jnxBoxSerialNo.0', );
|
||||
%GLOBALS = ( %SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
'serial' => 'jnxBoxSerialNo.0', );
|
||||
|
||||
%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 'juniper';
|
||||
@@ -115,6 +123,65 @@ sub i_vlan {
|
||||
return \%i_vlan;
|
||||
}
|
||||
|
||||
# Use Q-BRIDGE-MIB for bridge forwarding tables
|
||||
sub fw_mac {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->qb_fw_mac($partial);
|
||||
}
|
||||
|
||||
sub fw_port {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->qb_fw_port($partial);
|
||||
}
|
||||
|
||||
# Use LLDP
|
||||
|
||||
sub hasCDP {
|
||||
my $juniper = shift;
|
||||
|
||||
return $juniper->hasLLDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->lldp_ip($partial);
|
||||
}
|
||||
|
||||
sub c_if {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->lldp_if($partial);
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->lldp_port($partial);
|
||||
}
|
||||
|
||||
sub c_id {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->lldp_id($partial);
|
||||
}
|
||||
|
||||
sub c_platform {
|
||||
my $juniper = shift;
|
||||
my $partial = shift;
|
||||
|
||||
return $juniper->lldp_rem_sysdesc($partial);
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -151,6 +218,8 @@ Subclass for Generic Juniper Routers running JUNOS
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::LLDP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -161,6 +230,8 @@ Subclass for Generic Juniper Routers running JUNOS
|
||||
|
||||
See L<SNMP::Info::Layer3/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
See L<SNMP::Info::LLDP/"Required MIBs"> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -192,12 +263,20 @@ Returns serial number
|
||||
|
||||
(C<jnxBoxSerialNo.0>)
|
||||
|
||||
=item $juniper->hasCDP()
|
||||
|
||||
Returns whether LLDP is enabled.
|
||||
|
||||
=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::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
|
||||
@@ -210,10 +289,53 @@ to a hash.
|
||||
Returns the list of interfaces whose C<ifType> is l2vlan(135), and
|
||||
the VLAN ID extracted from the interface description.
|
||||
|
||||
=item $juniper->c_id()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $juniper->c_if()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $juniper->c_ip()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $juniper->c_platform()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $juniper->c_port()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Forwarding Table (C<dot1dTpFdbEntry>)
|
||||
|
||||
=over
|
||||
|
||||
=item $juniper->fw_mac()
|
||||
|
||||
Returns reference to hash of forwarding table MAC Addresses
|
||||
|
||||
(C<dot1dTpFdbAddress>)
|
||||
|
||||
=item $juniper->fw_port()
|
||||
|
||||
Returns reference to hash of forwarding table entries port interface
|
||||
identifier (iid)
|
||||
|
||||
(C<dot1dTpFdbPort>)
|
||||
|
||||
=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::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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
|
||||
@@ -43,7 +43,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %FUNCS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS,
|
||||
|
||||
294
Info/Layer3/Pf.pm
Normal file
294
Info/Layer3/Pf.pm
Normal file
@@ -0,0 +1,294 @@
|
||||
# SNMP::Info::Layer3::Pf
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2010 Max Baker
|
||||
# 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 Pf Networks, Inc. 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::Pf;
|
||||
|
||||
use strict;
|
||||
use Exporter;
|
||||
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::LLDP;
|
||||
|
||||
@SNMP::Info::Layer3::Pf::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Pf::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::LLDP::MIBS,
|
||||
# Enterprise container where BEGEMOT-* lives
|
||||
'FOKUS-MIB' => 'fokus',
|
||||
# MIBs used included in Layer3 and above:
|
||||
# UDP-MIB
|
||||
# TCP-MIB
|
||||
# IF-MIB
|
||||
#
|
||||
# Stuff in these MIBs but not used for Netdisco yet for my test device:
|
||||
#
|
||||
#'BEGEMOT-SNMPD-MIB',
|
||||
#'BEGEMOT-PF-MIB',
|
||||
#'BEGEMOT-NETGRAPH-MIB',
|
||||
#'BEGEMOT-MIB2-MIB',
|
||||
#'BEGEMOT-HOSTRES-MIB',
|
||||
# HOST-RESOURCES-MIB
|
||||
# IP-FORWARD-MIB
|
||||
#
|
||||
# Nothing in these MIBs for my test device:
|
||||
#
|
||||
#'BEGEMOT-IP-MIB',
|
||||
#'BEGEMOT-MIB',
|
||||
#'BEGEMOT-BRIDGE-MIB',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::LLDP::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::LLDP::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::LLDP::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
return 'FreeBSD';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $pf = shift;
|
||||
my $descr = $pf->description() || '';
|
||||
my $model = undef;
|
||||
$model = $1 if ( $descr =~ /FreeBSD\s+(\S+)/ );
|
||||
return $model if defined $model;
|
||||
return $pf->os_ver();
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'Pf';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $pf = shift;
|
||||
my $id = $pf->id();
|
||||
|
||||
my $os_ver = &SNMP::translateObj($id);
|
||||
return $id unless defined $os_ver;
|
||||
|
||||
# From /usr/share/snmp/defs/tree.def on a Pf Machine
|
||||
# (2 begemotSnmpdDefs
|
||||
# (1 begemotSnmpdAgent
|
||||
# (1 begemotSnmpdAgentFreeBSD OID op_dummy)
|
||||
# We're leaving the 1.1 and trimming off up to the 2
|
||||
$os_ver =~ s/fokus.1.1.2.//;
|
||||
return $os_ver;
|
||||
}
|
||||
|
||||
# Use LLDP
|
||||
sub hasCDP {
|
||||
my $pf = shift;
|
||||
return $pf->hasLLDP();
|
||||
}
|
||||
|
||||
sub c_ip {
|
||||
my $pf = shift;
|
||||
my $partial = shift;
|
||||
return $pf->lldp_ip($partial);
|
||||
}
|
||||
|
||||
sub c_if {
|
||||
my $pf = shift;
|
||||
my $partial = shift;
|
||||
return $pf->lldp_if($partial);
|
||||
}
|
||||
|
||||
sub c_port {
|
||||
my $pf = shift;
|
||||
my $partial = shift;
|
||||
return $pf->lldp_port($partial);
|
||||
}
|
||||
|
||||
sub c_id {
|
||||
my $pf = shift;
|
||||
my $partial = shift;
|
||||
return $pf->lldp_id($partial);
|
||||
}
|
||||
|
||||
sub c_platform {
|
||||
my $pf = shift;
|
||||
my $partial = shift;
|
||||
return $pf->lldp_rem_sysdesc($partial);
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Pf - SNMP Interface to FreeBSD-Based Firewalls using Pf /Pf Sense
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $pf = 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 = $pf->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Free-BSD PF-Based devices
|
||||
|
||||
=head1 LLDP Support
|
||||
|
||||
LLDP Support is included but untested in this Device Class. It is reported
|
||||
that the available CDP/LLDP modules for net-snmp don't work on FreeBSD (on
|
||||
which pfSense is based) as they assume certain Linux specific Ethernet
|
||||
structures. This problem is apparently solved on PF based firewall appliances
|
||||
by using the ladvd package, for which a port may be found here:
|
||||
L<http://www.freshports.org/net/ladvd/>. I'm not sure if this module ties into
|
||||
Net-SNMP or not.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::LLDP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item F<FOKUS-MIB>
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3/"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 scalar values from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $pf->vendor()
|
||||
|
||||
Returns 'FreeBSD'
|
||||
|
||||
=item $pf->hasCDP()
|
||||
|
||||
Returns whether LLDP is enabled.
|
||||
|
||||
=item $pf->model()
|
||||
|
||||
Grabs the os version from C<sysDescr>
|
||||
|
||||
=item $pf->os()
|
||||
|
||||
Returns 'Pf'
|
||||
|
||||
=item $pf->os_ver()
|
||||
|
||||
Tries to reference $pf->id() to one of the product MIBs listed above.
|
||||
Will probably return a truncation of the default OID for pf-based systems
|
||||
C<enterprises.12325.1.1.2.1.1>.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3/"GLOBALS"> for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=item $pf->c_id()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $pf->c_if()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $pf->c_ip()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $pf->c_platform()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=item $pf->c_port()
|
||||
|
||||
Returns LLDP information.
|
||||
|
||||
=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::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.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, );
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ use SNMP::Info::Layer3;
|
||||
|
||||
use vars qw/$VERSION %GLOBALS %MIBS %FUNCS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS, 'TIMETRA-GLOBAL-MIB' => 'timetraReg', );
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'MAU-MIB' => 'mauMod' );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %MIBS %FUNCS %GLOBALS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'POWER-ETHERNET-MIB' => 'pethPsePortDetectionStatus' );
|
||||
|
||||
@@ -89,6 +89,28 @@ sub peth_port_ifindex {
|
||||
return $peth_port_ifindex;
|
||||
}
|
||||
|
||||
# Subclasses are encouraged to override this method to report
|
||||
# what has actually been negotiated with the device, if a
|
||||
# protocol with more values (e.g., CDP) has been used.
|
||||
sub peth_port_neg_power {
|
||||
my $peth = shift;
|
||||
my $partial = shift;
|
||||
|
||||
my $peth_port_status = $peth->peth_port_status($partial);
|
||||
my $peth_port_class = $peth->peth_port_class($partial);
|
||||
|
||||
my $poemax = { 'class0' => 12950, 'class1' => 3840, 'class2' => 6490, 'class3' => 12950,
|
||||
'class4' => 25500 };
|
||||
|
||||
my $peth_port_neg_power = {};
|
||||
foreach my $i ( keys %$peth_port_status ) {
|
||||
if ($peth_port_status->{$i} eq 'deliveringPower') {
|
||||
$peth_port_neg_power->{$i} = $poemax->{ $peth_port_class->{$i} };
|
||||
}
|
||||
}
|
||||
return $peth_port_neg_power;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
@@ -187,6 +209,14 @@ implement; the MIB gives only very weak guidance.
|
||||
A given device class may implement its own version
|
||||
of this function (e.g., see Info::CiscoPower).
|
||||
|
||||
=item $poe->peth_port_neg_power()
|
||||
|
||||
The power, in milliwatts, that has been committed to this port.
|
||||
This value is derived from the 802.3af class of the device being
|
||||
powered, but may be overridden by a subclass that has information
|
||||
from another source (e.g., if a different protocol, such as CDP,
|
||||
was used to negotiate the power level.)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Power Supply Table
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = ( 'RAPID-CITY' => 'rapidCity', );
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '2.01';
|
||||
$VERSION = '2.05';
|
||||
|
||||
%MIBS = (
|
||||
'SYNOPTICS-ROOT-MIB' => 'synoptics',
|
||||
|
||||
7
MANIFEST
7
MANIFEST
@@ -1,5 +1,6 @@
|
||||
ChangeLog
|
||||
COPYRIGHT
|
||||
DEVELOP
|
||||
DeviceMatrix.txt
|
||||
Info.pm
|
||||
Info/Airespace.pm
|
||||
@@ -19,6 +20,7 @@ Info/Entity.pm
|
||||
Info/EtherLike.pm
|
||||
Info/FDP.pm
|
||||
Info/IEEE802dot11.pm
|
||||
Info/IPv6.pm
|
||||
Info/Layer1.pm
|
||||
Info/Layer1/Allied.pm
|
||||
Info/Layer1/Asante.pm
|
||||
@@ -29,7 +31,6 @@ Info/Layer2.pm
|
||||
Info/Layer2/Airespace.pm
|
||||
Info/Layer2/Aironet.pm
|
||||
Info/Layer2/Allied.pm
|
||||
Info/Layer2/Aruba.pm
|
||||
Info/Layer2/Bay.pm
|
||||
Info/Layer2/Baystack.pm
|
||||
Info/Layer2/C1900.pm
|
||||
@@ -39,6 +40,7 @@ Info/Layer2/Centillion.pm
|
||||
Info/Layer2/Cisco.pm
|
||||
Info/Layer2/Foundry.pm
|
||||
Info/Layer2/HP.pm
|
||||
Info/Layer2/HP4000.pm
|
||||
Info/Layer2/N2270.pm
|
||||
Info/Layer2/NAP222x.pm
|
||||
Info/Layer2/Netgear.pm
|
||||
@@ -50,11 +52,13 @@ Info/Layer3/AlcatelLucent.pm
|
||||
Info/Layer3/AlteonAD.pm
|
||||
Info/Layer3/Altiga.pm
|
||||
Info/Layer3/Arista.pm
|
||||
Info/Layer3/Aruba.pm
|
||||
Info/Layer3/BayRS.pm
|
||||
Info/Layer3/C3550.pm
|
||||
Info/Layer3/C4000.pm
|
||||
Info/Layer3/C6500.pm
|
||||
Info/Layer3/Cisco.pm
|
||||
Info/Layer3/CiscoFWSM.pm
|
||||
Info/Layer3/Contivity.pm
|
||||
Info/Layer3/Dell.pm
|
||||
Info/Layer3/Enterasys.pm
|
||||
@@ -67,6 +71,7 @@ Info/Layer3/N1600.pm
|
||||
Info/Layer3/Netscreen.pm
|
||||
Info/Layer3/NetSNMP.pm
|
||||
Info/Layer3/Passport.pm
|
||||
Info/Layer3/Pf.pm
|
||||
Info/Layer3/Sun.pm
|
||||
Info/Layer3/Timetra.pm
|
||||
Info/LLDP.pm
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
\bCVS\b
|
||||
,v$
|
||||
\B\.svn\b
|
||||
\B\.git\b
|
||||
|
||||
# Makemaker generated files and dirs.
|
||||
^MANIFEST\.
|
||||
|
||||
52
README
52
README
@@ -5,12 +5,12 @@ NAME
|
||||
|
||||
VERSION
|
||||
|
||||
SNMP::Info - Version 2.01
|
||||
SNMP::Info - Version 2.05
|
||||
|
||||
AUTHOR
|
||||
|
||||
SNMP::Info is maintained by team of Open Source authors headed by Eric
|
||||
Miller and Bill Fenner.
|
||||
Miller, Bill Fenner, Max Baker, Jeroen van Ingen and Oliver Gorwits.
|
||||
|
||||
Please visit <http://sourceforge.net/projects/snmp-info/> for most
|
||||
up-to-date list of developers.
|
||||
@@ -154,11 +154,13 @@ DESIGN GOALS
|
||||
|
||||
1. Use of textual MIB leaf identifier and enumerated values
|
||||
|
||||
* All values are retrieved via MIB Leaf node names
|
||||
* All values are retrieved via MIB Leaf node names
|
||||
|
||||
For example SNMP::Info has an entry in its %GLOBALS hash for
|
||||
``sysName'' instead of 1.3.6.1.2.1.1.5.
|
||||
|
||||
* Data returned is in the enumerated value form.
|
||||
* Data returned is in the enumerated value form.
|
||||
|
||||
For Example instead of looking up 1.3.6.1.2.1.2.2.1.3 and
|
||||
getting back 23
|
||||
|
||||
@@ -283,6 +285,13 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::FDP for details.
|
||||
|
||||
SNMP::Info::IPv6
|
||||
SNMP Interface for obtaining configured IPv6 addresses and mapping
|
||||
IPv6 addresses to MACs and interfaces, using information from
|
||||
IP-MIB, IPV6-MIB and/or CISCO-IETF-IP-MIB.
|
||||
|
||||
See documentation in SNMP::Info::IPv6 for details.
|
||||
|
||||
SNMP::Info::IEEE802dot11
|
||||
IEEE802dot11-MIB. A collection of OIDs providing information about
|
||||
standards based 802.11 wireless devices.
|
||||
@@ -389,11 +398,6 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer2::Allied for details.
|
||||
|
||||
SNMP::Info::Layer2::Aruba
|
||||
Subclass for Aruba wireless switches.
|
||||
|
||||
See documentation in SNMP::Info::Layer2::Aruba for details.
|
||||
|
||||
SNMP::Info::Layer2::Bay
|
||||
Depreciated. Use BayStack.
|
||||
|
||||
@@ -440,12 +444,19 @@ SUBCLASSES
|
||||
Depreciated. Use SNMP::Info::Layer3::Foundry.
|
||||
|
||||
SNMP::Info::Layer2::HP
|
||||
Subclass for HP Procurve Switches
|
||||
Subclass for more recent HP Procurve Switches
|
||||
|
||||
Requires HP-ICF-OID and ENTITY-MIB downloaded from HP.
|
||||
|
||||
See documentation in SNMP::Info::Layer2::HP for details.
|
||||
|
||||
SNMP::Info::Layer2::HP4000
|
||||
Subclass for older HP Procurve Switches
|
||||
|
||||
Requires HP-ICF-OID and ENTITY-MIB downloaded from HP.
|
||||
|
||||
See documentation in SNMP::Info::Layer2::HP4000 for details.
|
||||
|
||||
SNMP::Info::Layer2::N2270
|
||||
Subclass for Nortel 2270 wireless switches.
|
||||
|
||||
@@ -506,6 +517,11 @@ SUBCLASSES
|
||||
SNMP::Info::Layer3::Arista
|
||||
See documentation in SNMP::Info::Layer3::Arista for details.
|
||||
|
||||
SNMP::Info::Layer3::Aruba
|
||||
Subclass for Aruba wireless switches.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Aruba for details.
|
||||
|
||||
SNMP::Info::Layer3::BayRS
|
||||
Subclass for Nortel Multiprotocol/BayRS routers. This includes
|
||||
BCN, BLN, ASN, ARN, AN, 2430, and 5430 routers.
|
||||
@@ -535,6 +551,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Cisco for details.
|
||||
|
||||
SNMP::Info::Layer3::CiscoFWSM
|
||||
Subclass for Cisco Firewall Services Modules.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::CiscoFWSM for details.
|
||||
|
||||
SNMP::Info::Layer3::Contivity
|
||||
Subclass for Nortel Contivity/VPN Routers.
|
||||
|
||||
@@ -565,7 +586,7 @@ SUBCLASSES
|
||||
SNMP::Info::Layer3::HP9300
|
||||
Subclass for HP network devices which Foundry Networks was the
|
||||
Original Equipment Manufacturer (OEM) such as the HP ProCurve
|
||||
9300 series.
|
||||
9300 and 6300 series.
|
||||
|
||||
See documentation in SNMP::Info::Layer3::HP9300 for details.
|
||||
|
||||
@@ -601,6 +622,11 @@ SUBCLASSES
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Passport for details.
|
||||
|
||||
SNMP::Info::Layer3::Pf
|
||||
Subclass for FreeBSD-Based Firewalls using Pf /Pf Sense
|
||||
|
||||
See documentation in SNMP::Info::Layer3::Pf for details.
|
||||
|
||||
SNMP::Info::Layer3::Sun
|
||||
Subclass for Generic Sun Routers running SunOS.
|
||||
|
||||
@@ -1174,6 +1200,7 @@ USAGE
|
||||
-- route to a non-local
|
||||
indirect(4) -- host/network/sub-network
|
||||
|
||||
|
||||
"The type of route. Note that the values
|
||||
direct(3) and indirect(4) refer to the notion of
|
||||
direct and indirect routing in the IP
|
||||
@@ -1386,6 +1413,7 @@ EXTENDING SNMP::INFO
|
||||
'super_hero_powers' => 'SuperHeroIfPowers'
|
||||
);
|
||||
|
||||
|
||||
%MUNGE = (%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
'super_hero_powers' => \&munge_powers
|
||||
@@ -1726,7 +1754,7 @@ SNMP::INFO INTERNALS
|
||||
|
||||
COPYRIGHT AND LICENSE
|
||||
|
||||
Changes from SNMP::Info Version 0.7 and on are: Copyright (c) 2003-2009
|
||||
Changes from SNMP::Info Version 0.7 and on are: Copyright (c) 2003-2010
|
||||
Max Baker and SNMP::Info Developers All rights reserved.
|
||||
|
||||
Original Code is: Copyright (c) 2002-2003, Regents of the University of
|
||||
|
||||
@@ -5,7 +5,7 @@ use File::Glob qw/bsd_glob/;
|
||||
|
||||
my @pms = glob_rec("../Info");
|
||||
|
||||
$new_version = shift @ARGV || '2.01';
|
||||
$new_version = shift @ARGV || '2.05';
|
||||
|
||||
foreach my $p (@pms) {
|
||||
print "$p\n";
|
||||
|
||||
Reference in New Issue
Block a user