Compare commits
142 Commits
ver_0_9
...
ver_1_0_1_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bfc36df82b | ||
|
|
5134f4163c | ||
|
|
4939a18a6c | ||
|
|
8aee915872 | ||
|
|
eeac8fd9a2 | ||
|
|
07db467827 | ||
|
|
8bed2081b9 | ||
|
|
f0e0b9063c | ||
|
|
41907297f8 | ||
|
|
2e0392a6db | ||
|
|
3c4b8911f5 | ||
|
|
3db7164f9f | ||
|
|
cfe3c34ab6 | ||
|
|
ceac50e33e | ||
|
|
b71ba01d32 | ||
|
|
5cc00d443c | ||
|
|
4edb3115e5 | ||
|
|
33435d89e4 | ||
|
|
f5c93b3413 | ||
|
|
59fbe71c56 | ||
|
|
4f6b5f0883 | ||
|
|
23eb3b596d | ||
|
|
55b2a27f40 | ||
|
|
5e46120b52 | ||
|
|
4b70bfa7c8 | ||
|
|
c530e25e02 | ||
|
|
409065375e | ||
|
|
32ccc2857f | ||
|
|
c1025cb76f | ||
|
|
1f6a738cda | ||
|
|
8f10a4f16e | ||
|
|
50d9fdefb3 | ||
|
|
d777d98396 | ||
|
|
75e7b0c6b0 | ||
|
|
9fc965d095 | ||
|
|
10b4611e81 | ||
|
|
f416f7cc49 | ||
|
|
50d9070f36 | ||
|
|
14db80441c | ||
|
|
6193e661f5 | ||
|
|
3e69394cca | ||
|
|
88cdcebe2d | ||
|
|
20024f8c50 | ||
|
|
40caf6cc0e | ||
|
|
2d3b28b973 | ||
|
|
325b087bd1 | ||
|
|
0703a5f777 | ||
|
|
c4a4749bcf | ||
|
|
1fd0facbe0 | ||
|
|
bc9ab17f2d | ||
|
|
22fd4f73a9 | ||
|
|
4de346fa39 | ||
|
|
e14c749f66 | ||
|
|
c0f1872f04 | ||
|
|
70944f0589 | ||
|
|
d2b4c85d37 | ||
|
|
a4cc2f5514 | ||
|
|
fa8f91d508 | ||
|
|
7966400cf2 | ||
|
|
3227540322 | ||
|
|
183f8bde3a | ||
|
|
62133dfedf | ||
|
|
eb833c69e3 | ||
|
|
53d96a2e32 | ||
|
|
efc1682877 | ||
|
|
8846bb2f0f | ||
|
|
558c80aa84 | ||
|
|
f905638e5b | ||
|
|
d1636f0fe9 | ||
|
|
1d1193c459 | ||
|
|
4a2e62be2d | ||
|
|
137cc84ca6 | ||
|
|
e744df1dca | ||
|
|
378dc6bc19 | ||
|
|
3f2f722dab | ||
|
|
25f57d65a5 | ||
|
|
f5dba96839 | ||
|
|
3a1d04eb38 | ||
|
|
adac25b3dd | ||
|
|
9b2229e3eb | ||
|
|
bf040dffa9 | ||
|
|
86a12cd2a6 | ||
|
|
bfcb56f06d | ||
|
|
9a4a336c78 | ||
|
|
6696eeeb9d | ||
|
|
4da90c4f9b | ||
|
|
88f31110a7 | ||
|
|
afab6191b2 | ||
|
|
7ce87ebd3d | ||
|
|
d8e1e932ae | ||
|
|
089430de17 | ||
|
|
dce0a40ebb | ||
|
|
2347edad82 | ||
|
|
0ab5eb2bf1 | ||
|
|
d314ffe897 | ||
|
|
1162dc3a7b | ||
|
|
0967634043 | ||
|
|
133355bc9d | ||
|
|
76c734dc01 | ||
|
|
3128e3e5f6 | ||
|
|
c9ebd5ae28 | ||
|
|
b6efcd86dd | ||
|
|
a0323aacd2 | ||
|
|
258b7551ff | ||
|
|
7a023554eb | ||
|
|
b557c9d890 | ||
|
|
8dae0aad96 | ||
|
|
902383cab7 | ||
|
|
a1eb6e5831 | ||
|
|
3656d4c514 | ||
|
|
e899f76249 | ||
|
|
d38bfcbbf7 | ||
|
|
0f654f5aaa | ||
|
|
6cab3ad6b3 | ||
|
|
6685e4dd77 | ||
|
|
2b42f25d1e | ||
|
|
85359ddf59 | ||
|
|
1e198a8d8e | ||
|
|
6bd545d307 | ||
|
|
bc53167731 | ||
|
|
9a5135b9e1 | ||
|
|
8193143459 | ||
|
|
61ac00d7fb | ||
|
|
7944613d42 | ||
|
|
ff07325a05 | ||
|
|
afe5436749 | ||
|
|
ade9d7ef32 | ||
|
|
6a397d7c72 | ||
|
|
933bbaf00b | ||
|
|
1bd53dda51 | ||
|
|
5595fea427 | ||
|
|
31661b1374 | ||
|
|
780965728e | ||
|
|
a7570d9e58 | ||
|
|
b6989e8ada | ||
|
|
f9f4daea94 | ||
|
|
ab175a747c | ||
|
|
2a10991980 | ||
|
|
95d3d45e66 | ||
|
|
d808fc1e6f | ||
|
|
e8f81b17fa | ||
|
|
db871c590c |
64
ChangeLog
64
ChangeLog
@@ -1,6 +1,68 @@
|
||||
SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
|
||||
ChangeLog $Id$
|
||||
|
||||
version 1.01 (04/08/06) - Beta/developer release
|
||||
+ Change version numbers to X.XX format. Odd releases are beta
|
||||
or developer only releases. Even are official releases.
|
||||
|
||||
version 1.0 (04/07/06) - CVS only. No official release
|
||||
+ Added Interface FlowControl status to CiscoStack (Nicolai Petri)
|
||||
+ Added CiscoImage class (Matthew Tuttle)
|
||||
+ Added C1200 and C350 IOS devices to L2::Aironet (Matthew Tuttle)
|
||||
+ Added support for Foundry IronWare and gave L3::Foundry CPR
|
||||
+ Added support for Foundry EdgeIrons as new class L2::Foundry
|
||||
+ Added BulkWalk and BulkRepeaters options to new()
|
||||
+ Added DebugSNMP option to new()
|
||||
+ Added CISCO-ENTITY-VENDORTYPE-OID-MIB,CISCO-PRODUCTS-MIB,CISCO-STACK-MIB
|
||||
to CiscoStats.pm for model()
|
||||
+ Check for bulkwalk_no() method
|
||||
+ Added Entity.pm to L3 and L2 classes per N. Petri's suggestion.
|
||||
+ Added support for Passport/Accelar 1100 and 1200 series in L3::Passport
|
||||
+ Added support for Passport/Accelar 8100 series in L3::Passport
|
||||
+ Added support for Passport 1600 series as new class, L3::N1600
|
||||
+ Added support for Extreme Alpine and Summit switches as new class
|
||||
L3:Extreme (Mike Hunter and Eric Miller)
|
||||
+ Added support for Aruba wireless switches (Eric Miller and Brian Chow)
|
||||
+ Added support for Nortel 2700 series (Airespace) wireless switches
|
||||
+ Added support for Synoptics hubs as new class L1:S3000
|
||||
+ Added Cisco QOS and RTT classes (Alexander Hartmaier)
|
||||
+ Added BGP Peer Table to L3 class (Carlos Vicente)
|
||||
+ Added ipforwarding status to Info base class (Carlos Vicente)
|
||||
+ Added STP port state to Bridge class (Alexander Barthel)
|
||||
+ Added L3 support (arpnip) to Baystack class for routing capable switches
|
||||
+ Added set_i_duplex_admin() and set_i_speed_admin() to C2900 class (Justin Hunter)
|
||||
+ Added set_i_duplex_admin() and set_i_speed_admin() to CiscoStack class
|
||||
+ CDP added to Aironet class
|
||||
+ Added Juniper class
|
||||
+ Added support for Catalyst 4000 and 4500, get admin. duplex
|
||||
and speed properly
|
||||
+ Added i_speed_high(), which i_speed() uses if needed to support
|
||||
interfaces >4Gbps
|
||||
|
||||
* More error checking in _load_attr() around bulkwalk code
|
||||
* Minor warning fix in L3::Aironet::os_ver()
|
||||
* Abstracted remaining Cisco stuff from L3 to L3::Cisco
|
||||
* Removed all Cisco stuff from L2
|
||||
* Expanded Entity.pm to cover the whole ENTITY-MIB and improved docs.
|
||||
* changed all refs to $DEBUG to $self->debug() for reentrant code
|
||||
* [ 1111284 ] Parameters not being set with AutoSpecify - fixed.
|
||||
* Turned off BULKWALK for C1900 and C6500 classes.
|
||||
* Added exception handling for V2 ENDOFMIBVIEW
|
||||
* Fix in SONMP when topology not enabled
|
||||
* Fix in L3::Passport root_ip()
|
||||
* Fix in L3::Passport bp_index() some devices not returning complete index.
|
||||
* Enable set_i_up_admin() in Bayhub
|
||||
* Recognize new Nortel model names in Baystack and Passport classes
|
||||
* Orinoco class should now recognize more models
|
||||
* Cleanup model recognition in Baystack class, recognize more models
|
||||
* Modify Catalyst class to use CISCO-STACK-MIB for brige port index mapping
|
||||
some devices having problems returning complete index from BRIDGE-MIB
|
||||
* Check root ip for reachability before assignment
|
||||
* HP class should recognize more models
|
||||
* Fix in HP class for models not returning full bp_index
|
||||
* [ 1436103 ] L2::Aironet devices weren't getting their model
|
||||
translated properly
|
||||
|
||||
verison 0.9 (11/15/04)
|
||||
+ ** Added full Nortel/Bay/BayStack support
|
||||
by new developer Eric Miller.
|
||||
@@ -22,7 +84,7 @@ verison 0.9 (11/15/04)
|
||||
* Changed so a failed _global() call is cached so it won't retry
|
||||
an error over and over again if the same global is used.
|
||||
* Added check in _set() to see if data came from sub or FUNCS/GLOBALS
|
||||
Fails if came from sub.
|
||||
Fails if came from sub.
|
||||
|
||||
version 0.8 (03/21/04)
|
||||
+ Added Q-BRIDGE-MIB support to SNMP::Info::Bridge
|
||||
|
||||
206
DeviceMatrix.txt
206
DeviceMatrix.txt
@@ -4,7 +4,7 @@
|
||||
# This file is meant to detail the cababilities
|
||||
# of network devices to supply data via SNMP.
|
||||
|
||||
# $Id: DeviceMatrix.txt,Modified by Eric Miller 10/17/2004
|
||||
# $Id$
|
||||
|
||||
# Allied
|
||||
device-vendor: Allied Telesyn
|
||||
@@ -24,6 +24,19 @@ class: Layer2::Allied
|
||||
ver: 2
|
||||
macsuck: yes
|
||||
|
||||
# Aruba
|
||||
device-vendor: Aruba
|
||||
|
||||
device-family: Aruba Wireless Controllers
|
||||
arpnip: no
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: no
|
||||
class: Layer2::Aruba
|
||||
note: Uses proprietary MIBs to provide MAC to port mapping. APs appear as switch ports.
|
||||
|
||||
device: 5000
|
||||
|
||||
# Asante
|
||||
device-vendor: Asante
|
||||
|
||||
@@ -134,6 +147,8 @@ device-family: Catalyst 1900
|
||||
note: !Upgrade older (pre 9.0) versions of CatOS
|
||||
note: !CatOS ver 9.00.03 through 9.00.06 have problems when trunking. Upgrade to 9.00.07 or higher.
|
||||
ver: 1
|
||||
duplex: both
|
||||
vlan: write
|
||||
class: Layer2::C1900
|
||||
|
||||
device: wsc1900c
|
||||
@@ -145,7 +160,9 @@ device-family: Catalyst 1900
|
||||
device-family: Catalyst 2900
|
||||
note: IOS
|
||||
macsuck: vlan
|
||||
class: Layer3::C2900
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer2::C2900
|
||||
portmac: yes
|
||||
note: !Pre IOS 11.2 (8) SA3 - PortMAC shows up in CAM table.
|
||||
|
||||
@@ -156,22 +173,35 @@ device: 2912MfXL
|
||||
|
||||
device: 2924MXL
|
||||
ver: 1
|
||||
portmac: yes
|
||||
|
||||
device: 2924CXL
|
||||
|
||||
device: 2924CXLv
|
||||
|
||||
device-family: Catlayst 2940
|
||||
device-family: Catalyst 2940
|
||||
note: IOS
|
||||
macsuck: vlan
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer2::C2900
|
||||
portmac: yes
|
||||
|
||||
device: 2940-8TT
|
||||
|
||||
device-family: Catalyst 2950
|
||||
note: IOS
|
||||
macsuck: vlan
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer2::C2900
|
||||
portmac: yes
|
||||
|
||||
device: 2950-t24
|
||||
|
||||
device-family: Catalyst 2970
|
||||
macsuck:vlan
|
||||
duplex: write
|
||||
vlan: write
|
||||
note: Acts just like IOS Catalyst 6500 series
|
||||
class: Layer3::C6500
|
||||
|
||||
@@ -180,6 +210,8 @@ device: 2970G-24T-E
|
||||
device-family: Catalyst 3500 XL
|
||||
portmac: yes
|
||||
macsuck: vlan
|
||||
duplex: write
|
||||
vlan: write
|
||||
note: L2 only IOS devices - Just like Catalyst 2900 series from SNMP
|
||||
note: IOS Version 12.0(5)XP is buggy and doesn't do VLAN Community indexing correctly.
|
||||
class: Layer2::C2900
|
||||
@@ -192,7 +224,8 @@ device: 3548XL
|
||||
|
||||
device-family: Catalyst 3550
|
||||
macsuck: vlan
|
||||
duplex: both
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer3::C3550
|
||||
note: Run IOS
|
||||
note: Has VLANs that don't accept SNMP connections. Don't know if they are standard (by name or number).
|
||||
@@ -214,7 +247,8 @@ class: Layer3::C6500
|
||||
device-family: Catalyst 4000
|
||||
duplex: both
|
||||
macsuck: vlan
|
||||
class: Layer3::C6500
|
||||
vlan: write
|
||||
class: Layer3::C4000
|
||||
note: Comes in IOS and CatOS versions like the 6k series.
|
||||
note: CatOS versions like L2::Catalyst just fine.
|
||||
note: !Reported problems with SNMP taking up all the CPU. Requests take significantly longer.
|
||||
@@ -230,7 +264,8 @@ device: wsc4912g
|
||||
note: Dedicated 12 port gig-e switch
|
||||
|
||||
device-family: Catalyst 5000
|
||||
duplex: both
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer2::Catalyst
|
||||
note: Port info in CISCO-STACK-MIB
|
||||
|
||||
@@ -258,11 +293,14 @@ note: Router blade that runs IOS
|
||||
|
||||
device-family: Catalyst 6500
|
||||
macsuck:vlan
|
||||
duplex: write
|
||||
vlan: write
|
||||
class: Layer3::C6500
|
||||
note: Runs in two possible modes, native (IOS) and hybrid (IOS with CatOS on top).
|
||||
note: Switch running Hybrid has WS-C in description field and loves L2::Catalyst class
|
||||
note: Native Mode (IOS) versions seem to have SNMP problems with L2 data.
|
||||
note: !Problem with IOS 12.2.17d-SXB ... upgrade to -SXB1 or higher.
|
||||
note: !Sup720-3B and NativeIOS 12.2 (17d)SXB10 may report 127.0.0.51 as CDP neighbor address.
|
||||
|
||||
device: 6503
|
||||
macsuck:no
|
||||
@@ -276,16 +314,20 @@ note: Native mode (IOS) reports L2+L3
|
||||
note: !Macsuck failing even under vlan mode
|
||||
|
||||
device: wsc6509
|
||||
duplex: both
|
||||
duplex: write
|
||||
class: Layer2::Catalyst
|
||||
note: Hybrid Mode (Catalyst) reports L2 only
|
||||
|
||||
device: 6kMsfc
|
||||
class: Layer3
|
||||
duplex: no
|
||||
vlan: no
|
||||
note: IOS portion of Hybrid mode. VLAN and other L3 Services.
|
||||
|
||||
device: 6kMsfc2
|
||||
class: Layer3
|
||||
duplex: no
|
||||
vlan: no
|
||||
note: IOS portion of Hybrid mode. VLAN and other L3 Services.
|
||||
|
||||
device-family: Voice Gateway
|
||||
@@ -294,12 +336,51 @@ duplex: no
|
||||
|
||||
device: VG200
|
||||
|
||||
# Extreme
|
||||
device-vendor: Extreme Networks
|
||||
|
||||
device-family: Alpine and Summit
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
vlan: yes
|
||||
cdp: no
|
||||
class: Layer3::Extreme
|
||||
|
||||
device: Alpine 3808
|
||||
device: Summit 7i, 48si
|
||||
|
||||
# Foundry
|
||||
device-vendor: Foundry Networks
|
||||
class: Layer3::Foundry
|
||||
note: CDP --> FDP.
|
||||
|
||||
device-family: FastIron
|
||||
class: Layer3::Foundry
|
||||
ver: 1
|
||||
note: Support very limited
|
||||
|
||||
device: FastIron 4802
|
||||
|
||||
device-family: EdgeIron
|
||||
ver: 2
|
||||
class: Layer2::Foundry
|
||||
cdp: yes
|
||||
duplex: yes
|
||||
macsuck: yes
|
||||
device: EdgeIron 24G
|
||||
note: Bug where spanning tree stuff loops forever when polled by SNMP.
|
||||
|
||||
device-family: IronWare
|
||||
class: Layer3::Foundry
|
||||
ver: 2
|
||||
cdp: yes
|
||||
note: FDP enabled.
|
||||
duplex: yes
|
||||
macsuck: yes
|
||||
arpnip: yes
|
||||
device:FWSX424
|
||||
device:SI400 Router
|
||||
|
||||
|
||||
# HP
|
||||
device-vendor: HP
|
||||
@@ -311,6 +392,7 @@ duplex: both
|
||||
macsuck: yes
|
||||
arpnip: no
|
||||
cdp: yes
|
||||
vlan: yes
|
||||
note: CDP only available with newer ROM versions.
|
||||
|
||||
device: 2512
|
||||
@@ -328,8 +410,25 @@ duplex: link
|
||||
device: 4108GL,8000,2626,2650,8000
|
||||
note: VLAN info in Q-BRIDGE-MIB
|
||||
|
||||
# Net-SNMP
|
||||
device-vendor: Net-SNMP
|
||||
class: Layer3
|
||||
ver: 2
|
||||
|
||||
device-family: Linux
|
||||
note: net-snmp 4.x agent and 5.x agent.
|
||||
|
||||
device-family: BSD
|
||||
|
||||
# Juniper
|
||||
device-vendor: Juniper
|
||||
|
||||
device-family: M-series router
|
||||
arpnip: yes
|
||||
|
||||
# NORTEL
|
||||
device-vendor: Nortel Networks
|
||||
device-vendor: Nortel
|
||||
note: CDP --> SONMP.
|
||||
|
||||
device-family: BayStack Hub
|
||||
macsuck: yes
|
||||
@@ -337,13 +436,18 @@ duplex: both
|
||||
cdp: proprietary
|
||||
ver: 1
|
||||
class: Layer1::Bayhub
|
||||
note: !Uses proprietary MIBs to provide MAC to port mapping.
|
||||
note: Uses proprietary MIBs to provide MAC to port mapping.
|
||||
note: !Requires Advanced or Advanced Analyzer NMM
|
||||
|
||||
device: 102
|
||||
|
||||
device-family: Baystack Switch
|
||||
device: System 5000
|
||||
|
||||
device-family: Ethernet Switch/Baystack Switch
|
||||
arpnip: no
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
vlan: yes
|
||||
cdp: proprietary
|
||||
class: Layer2::Baystack
|
||||
|
||||
@@ -355,7 +459,7 @@ device: 380
|
||||
|
||||
device: 410
|
||||
|
||||
device: 420
|
||||
device: 420,425
|
||||
|
||||
device: 450
|
||||
note: !Some versions > 4.X in stacked configuration have SNMP timeout issues.
|
||||
@@ -363,14 +467,25 @@ note: Labels full duplex as 20Mbit connection.
|
||||
|
||||
device: 460,470
|
||||
|
||||
device: 5510,5520
|
||||
|
||||
device: BPS
|
||||
|
||||
device-family: Ethernet Routing Switch/Baystack Switch
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
vlan: yes
|
||||
cdp: proprietary
|
||||
class: Layer2::Baystack
|
||||
|
||||
device: 3510
|
||||
|
||||
device: 5510,5520,5530
|
||||
|
||||
device-family: Centillion
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
cdp: proprietary
|
||||
vlan: yes
|
||||
class: Layer2::Centillion
|
||||
note: !Must be on version 4.x or 5.x (VLAN based) software.
|
||||
|
||||
@@ -394,13 +509,12 @@ device: AP-2220
|
||||
|
||||
device: AP-2221
|
||||
|
||||
device: AP-2225
|
||||
|
||||
device-family: Alteon AD
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
cdp: no
|
||||
vlan: yes
|
||||
class: Layer3::AlteonAD
|
||||
note: !Some versions have issues with continuous SNMP polling. Upgrade to 10.0.30.7 or higher.
|
||||
|
||||
@@ -416,12 +530,13 @@ device: 183
|
||||
|
||||
device: 184
|
||||
|
||||
device-family: BayRS
|
||||
device-family: Multiprotocol Router/BayRS
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: both
|
||||
cdp: no
|
||||
vlan: yes
|
||||
class: Layer3::BayRS
|
||||
|
||||
device: AN
|
||||
@@ -436,7 +551,7 @@ device: Passport 2430
|
||||
|
||||
device: Passport 5430
|
||||
|
||||
device-family: Contivity
|
||||
device-family: VPN Router/Contivity
|
||||
arpnip: yes
|
||||
macsuck: no
|
||||
portmac: yes
|
||||
@@ -454,21 +569,60 @@ device: 2500,2600,2700
|
||||
|
||||
device: 4500,4600,5000
|
||||
|
||||
|
||||
device-family: Passport LAN
|
||||
device-family: Ethernet Routing Switch/Passport/Accelar LAN
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: both
|
||||
cdp: proprietary
|
||||
vlan: yes
|
||||
class: Layer3::Passport
|
||||
note: !Code versions < 3.2 vlan based mac-suck and are unsupported. Upgrade code.
|
||||
note: !3.2 code versions < 3.2.2.2 have Bridge MIB loop. Upgrade code.
|
||||
note: !8600 Code versions < 3.2 vlan based mac-suck and are unsupported. Upgrade code.
|
||||
note: !8600 3.2 code versions < 3.2.2.2 have Bridge MIB loop. Upgrade code.
|
||||
|
||||
device: 8603,8606,8610
|
||||
|
||||
device: 8610co
|
||||
|
||||
device: 8106,8110
|
||||
|
||||
device: 1050,1100,1150,1200
|
||||
|
||||
device-family: Ethernet Routing Switch/Passport 1600
|
||||
arpnip: yes
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: both
|
||||
cdp: proprietary
|
||||
vlan: yes
|
||||
class: Layer3::N1600
|
||||
|
||||
device: 1612,1624,1648
|
||||
|
||||
device-family: Synoptics
|
||||
macsuck: yes
|
||||
duplex: both
|
||||
cdp: proprietary
|
||||
ver: 1
|
||||
class: Layer1::S3000
|
||||
note: Uses proprietary MIBs to provide MAC to port mapping.
|
||||
note: !Requires Advanced or Advanced Analyzer NMM
|
||||
|
||||
device: 281X
|
||||
|
||||
device: System 3000
|
||||
|
||||
device-family: Wireless Switch 2270
|
||||
arpnip: no
|
||||
macsuck: yes
|
||||
portmac: yes
|
||||
duplex: both
|
||||
cdp: proprietary
|
||||
class: Layer2::N2270
|
||||
note: Uses proprietary MIBs to provide MAC to port mapping. APs appear as switch ports.
|
||||
|
||||
device: 2270
|
||||
|
||||
# Proxim
|
||||
device-vendor: Proxim
|
||||
|
||||
@@ -482,8 +636,14 @@ device: AP-1000
|
||||
|
||||
device: AP-2000
|
||||
|
||||
device: AP-4000
|
||||
|
||||
device: WavePOINT-II
|
||||
|
||||
# Synoptics
|
||||
device-vendor: Synoptics
|
||||
note: See Nortel
|
||||
|
||||
# Zyxel
|
||||
device-vendor: Zyxel
|
||||
class: Layer2::ZyXEL_DSLAM
|
||||
|
||||
448
Info/Airespace.pm
Normal file
448
Info/Airespace.pm
Normal file
@@ -0,0 +1,448 @@
|
||||
# SNMP::Info::Airespace
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2005 Eric Miller
|
||||
#
|
||||
# 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::Airespace;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::Airespace::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::Airespace::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
'AIRESPACE-WIRELESS-MIB' => 'bsnAPName',
|
||||
'AIRESPACE-SWITCHING-MIB' => 'agentInventorySerialNumber',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
'serial' => 'agentInventorySerialNumber',
|
||||
'os_ver' => 'agentInventoryProductVersion',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
'i_index2' => 'ifIndex',
|
||||
'i_name2' => 'ifName',
|
||||
'i_description2' => 'ifDescr',
|
||||
# AIRESPACE-WIRELESS-MIB::bsnAPTable
|
||||
'airespace_ap_mac' => 'bsnAPDot3MacAddress',
|
||||
'airespace_ap_name' => 'bsnAPName',
|
||||
'airespace_ap_ip' => 'bsnApIpAddress',
|
||||
'airespace_ap_loc' => 'bsnAPLocation',
|
||||
'airespace_ap_model' => 'bsnAPModel',
|
||||
'airespace_ap_serial' => 'bsnAPSerialNumber',
|
||||
# AIRESPACE-WIRELESS-MIB::bsnMobileStationTable
|
||||
'fw_port' => 'bsnMobileStationAPMacAddr',
|
||||
'fw_mac' => 'bsnMobileStationMacAddress',
|
||||
# AIRESPACE-SWITCHING-MIB::agentPortConfigTable
|
||||
'airespace_duplex_admin' => 'agentPortPhysicalMode',
|
||||
'airespace_duplex' => 'agentPortPhysicalStatus',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
# Add ones for our class
|
||||
'airespace_ap_mac' => \&SNMP::Info::munge_mac,
|
||||
'fw_port' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
sub layers {
|
||||
return '00000011';
|
||||
}
|
||||
|
||||
# Wirless switches do not support ifMIB requirements for get MAC
|
||||
# and port status
|
||||
|
||||
sub i_index {
|
||||
my $airespace = shift;
|
||||
my $i_index = $airespace->i_index2();
|
||||
my $ap_index = $airespace->airespace_ap_mac();
|
||||
|
||||
my %if_index;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
$if_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# Get Attached APs as Interfaces
|
||||
foreach my $ap_id (keys %$ap_index){
|
||||
my $ap_index = $ap_index->{$ap_id};
|
||||
next unless defined $ap_index;
|
||||
|
||||
$if_index{$ap_id} = $ap_index;
|
||||
}
|
||||
return \%if_index;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $airespace = shift;
|
||||
my $i_index = $airespace->i_index();
|
||||
my $ap_index = $airespace->airespace_ap_mac();
|
||||
|
||||
my %if;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index =~ /^\d+$/ ) {
|
||||
$if{$index} = "1.$index";
|
||||
}
|
||||
|
||||
elsif ($index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/) {
|
||||
my $ap = $ap_index->{$iid};
|
||||
next unless defined $ap;
|
||||
$if{$index} = $ap;
|
||||
}
|
||||
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%if;
|
||||
}
|
||||
|
||||
sub i_name {
|
||||
my $airespace = shift;
|
||||
my $i_index = $airespace->i_index();
|
||||
my $i_name2 = $airespace->i_name2();
|
||||
my $ap_name = $airespace->airespace_ap_name();
|
||||
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index =~ /^\d+$/ ) {
|
||||
my $name = $i_name2->{$iid};
|
||||
next unless defined $name;
|
||||
$i_name{$index} = $name;
|
||||
}
|
||||
|
||||
elsif ($index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/) {
|
||||
my $name = $ap_name->{$iid};
|
||||
next unless defined $name;
|
||||
$i_name{$index} = $name;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%i_name;
|
||||
}
|
||||
|
||||
sub i_description {
|
||||
my $airespace = shift;
|
||||
my $i_index = $airespace->i_index();
|
||||
my $i_descr = $airespace->i_description2();
|
||||
my $ap_loc = $airespace->airespace_ap_loc();
|
||||
|
||||
|
||||
my %descr;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index =~ /^\d+$/ ) {
|
||||
my $descr = $i_descr->{$iid};
|
||||
next unless defined $descr;
|
||||
$descr{$index} = $descr;
|
||||
}
|
||||
|
||||
elsif ($index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/) {
|
||||
my $name = $ap_loc->{$iid};
|
||||
next unless defined $name;
|
||||
$descr{$index} = $name;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%descr;
|
||||
}
|
||||
|
||||
sub i_duplex {
|
||||
my $airespace = shift;
|
||||
|
||||
my $interfaces = $airespace->interfaces();
|
||||
my $ap_duplex = $airespace->airespace_duplex();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $if (keys %$interfaces){
|
||||
my $duplex = $ap_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;
|
||||
}
|
||||
|
||||
sub i_duplex_admin {
|
||||
my $airespace = shift;
|
||||
|
||||
my $interfaces = $airespace->interfaces();
|
||||
my $ap_duplex_admin = $airespace->airespace_duplex_admin();
|
||||
|
||||
my %i_duplex_admin;
|
||||
foreach my $if (keys %$interfaces){
|
||||
my $duplex = $ap_duplex_admin->{$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_admin{$if}=$duplex;
|
||||
}
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
|
||||
# Wireless switches do not support the standard Bridge MIB
|
||||
sub bp_index {
|
||||
my $airespace = shift;
|
||||
my $i_index = $airespace->i_index2();
|
||||
my $ap_index = $airespace->airespace_ap_mac();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
$bp_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# Get Attached APs as Interfaces
|
||||
foreach my $ap_id (keys %$ap_index){
|
||||
my $ap_index = $ap_index->{$ap_id};
|
||||
next unless defined $ap_index;
|
||||
|
||||
$bp_index{$ap_index} = $ap_index;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Airespace - SNMP Interface to Airespace wireless switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $airespace = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $airespace->class();
|
||||
print " Using device sub class : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::Airespace is a subclass of SNMP::Info that provides an interface
|
||||
to C<AIRESPACE-WIRELESS-MIB> and C<AIRESPACE-SWITCHING-MIB>. These MIBs are
|
||||
used in Airespace wireless switches, as well as, products from Cisco, Nortel,
|
||||
and Alcatel which are based upon the Airespace platform.
|
||||
|
||||
The Airespace platform utilizes intelligent wireless switches which control
|
||||
thin access points. The thin access points themselves are unable to be polled
|
||||
for end station information.
|
||||
|
||||
This class emulates bridge functionality for the wireless switch. This enables
|
||||
end station MAC addresses collection and correlation to the thin access point
|
||||
the end station is using for communication.
|
||||
|
||||
Normally you use or create a subclass of SNMP::Info that inherits this one. Do not use directly.
|
||||
|
||||
For debugging purposes call the class directly as you would SNMP::Info
|
||||
|
||||
my $airespace = new SNMP::Info::Airespace(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item AIRESPACE-WIRELESS-MIB
|
||||
|
||||
=item AIRESPACE-SWITCHING-MIB
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $airespace->serial()
|
||||
|
||||
(B<agentInventorySerialNumber>)
|
||||
|
||||
=item $airespace->os_ver()
|
||||
|
||||
(B<agentInventoryProductVersion>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $airespace->layers()
|
||||
|
||||
Returns 00000011. Class emulates Layer 2 functionality for Thin APs through
|
||||
proprietary MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $airespace->i_index()
|
||||
|
||||
Returns reference to map of IIDs to Interface index.
|
||||
|
||||
Extends ifIndex to support thin APs as device interfaces.
|
||||
|
||||
=item $airespace->interfaces()
|
||||
|
||||
Returns reference to map of IIDs to ports. Thin APs are implemented as device
|
||||
interfaces. The thin AP MAC address is used as the port identifier.
|
||||
|
||||
=item $airespace->i_name()
|
||||
|
||||
Interface name. Returns (B<ifName>) for Ethernet interfaces and (B<bsnAPName>)
|
||||
for thin AP interfaces.
|
||||
|
||||
=item $airespace->i_description()
|
||||
|
||||
Description of the interface. Returns (B<ifDescr>) for Ethernet interfaces and
|
||||
(B<bsnAPLocation>) for thin AP interfaces.
|
||||
|
||||
=item $airespace->i_duplex()
|
||||
|
||||
Returns reference to map of IIDs to current link duplex. Ethernet interfaces only.
|
||||
|
||||
=item $airespace->i_duplex_admin()
|
||||
|
||||
Returns reference to hash of IIDs to admin duplex setting. Ethernet interfaces
|
||||
only.
|
||||
|
||||
=item $airespace->bp_index()
|
||||
|
||||
Simulates bridge MIB by returning reference to a hash containing the index for
|
||||
both the keys and values.
|
||||
|
||||
=item $airespace->fw_port()
|
||||
|
||||
(B<bsnMobileStationAPMacAddr>)
|
||||
|
||||
=item $airespace->fw_mac()
|
||||
|
||||
(B<bsnMobileStationMacAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 AIRESPACE AP Table (B<bsnAPTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $airespace->airespace_ap_mac()
|
||||
|
||||
(B<bsnAPDot3MacAddress>)
|
||||
|
||||
=item $airespace->airespace_ap_name()
|
||||
|
||||
(B<bsnAPName>)
|
||||
|
||||
=item $airespace->airespace_ap_ip()
|
||||
|
||||
(B<bsnApIpAddress>)
|
||||
|
||||
=item $airespace->airespace_ap_loc()
|
||||
|
||||
(B<bsnAPLocation>)
|
||||
|
||||
=item $airespace->airespace_ap_model()
|
||||
|
||||
(B<bsnAPModel>)
|
||||
|
||||
=item $airespace->airespace_ap_serial()
|
||||
|
||||
(B<bsnAPSerialNumber>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 AIRESPACE Agent Port Config Table (B<agentPortConfigTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $airespace->airespace_duplex_admin()
|
||||
|
||||
(B<agentPortPhysicalMode>)
|
||||
|
||||
=item $airespace->airespace_duplex()
|
||||
|
||||
(B<agentPortPhysicalStatus>)
|
||||
|
||||
=cut
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Bridge
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Changes since Version 0.7 Copyright (c) 2004 Max Baker
|
||||
# All rights reserved.
|
||||
@@ -32,7 +32,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Bridge;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -44,11 +44,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::Bridge::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::Bridge::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ('BRIDGE-MIB' => 'dot1dBaseBridgeAddress',
|
||||
'Q-BRIDGE-MIB' => 'dot1qPvid',
|
||||
);
|
||||
@@ -107,6 +102,22 @@ $INIT = 0;
|
||||
'stp_p_port' => \&SNMP::Info::munge_mac
|
||||
);
|
||||
|
||||
sub qb_i_vlan_t {
|
||||
my $bridge = shift;
|
||||
|
||||
my $qb_i_vlan = $bridge->qb_i_vlan();
|
||||
my $qb_i_vlan_type = $bridge->qb_i_vlan_type();
|
||||
|
||||
my $i_vlan = {};
|
||||
|
||||
foreach my $if (keys %$qb_i_vlan){
|
||||
my $vlan = $qb_i_vlan->{$if};
|
||||
my $tagged = $qb_i_vlan_type->{$if} || '';
|
||||
next unless defined $vlan;
|
||||
$i_vlan->{$if} = $tagged eq 'admitOnlyVlanTagged' ? 'trunk' : $vlan;
|
||||
}
|
||||
return $i_vlan;
|
||||
}
|
||||
|
||||
sub i_stp_state {
|
||||
my $bridge = shift;
|
||||
@@ -126,7 +137,60 @@ sub i_stp_state {
|
||||
return \%i_stp_state;
|
||||
}
|
||||
|
||||
|
||||
sub i_stp_port {
|
||||
my $bridge = shift;
|
||||
my $bp_index = $bridge->bp_index();
|
||||
my $stp_p_port = $bridge->stp_p_port();
|
||||
|
||||
my %i_stp_port;
|
||||
|
||||
foreach my $index (keys %$stp_p_port){
|
||||
my $bridge = $stp_p_port->{$index};
|
||||
my $iid = $bp_index->{$index};
|
||||
next unless defined $iid;
|
||||
next unless defined $bridge;
|
||||
$i_stp_port{$iid}=$bridge;
|
||||
}
|
||||
return \%i_stp_port;
|
||||
}
|
||||
|
||||
sub i_stp_id {
|
||||
my $bridge = shift;
|
||||
my $bp_index = $bridge->bp_index();
|
||||
my $stp_p_id = $bridge->stp_p_id();
|
||||
|
||||
my %i_stp_id;
|
||||
|
||||
foreach my $index (keys %$stp_p_id){
|
||||
my $bridge = $stp_p_id->{$index};
|
||||
my $iid = $bp_index->{$index};
|
||||
next unless defined $iid;
|
||||
next unless defined $bridge;
|
||||
$i_stp_id{$iid}=$bridge;
|
||||
}
|
||||
return \%i_stp_id;
|
||||
}
|
||||
|
||||
sub i_stp_bridge {
|
||||
my $bridge = shift;
|
||||
my $bp_index = $bridge->bp_index();
|
||||
my $stp_p_bridge = $bridge->stp_p_bridge();
|
||||
|
||||
my %i_stp_bridge;
|
||||
|
||||
foreach my $index (keys %$stp_p_bridge){
|
||||
my $bridge = $stp_p_bridge->{$index};
|
||||
my $iid = $bp_index->{$index};
|
||||
next unless defined $iid;
|
||||
next unless defined $bridge;
|
||||
$i_stp_bridge{$iid}=$bridge;
|
||||
}
|
||||
return \%i_stp_bridge;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
|
||||
@@ -136,7 +200,7 @@ SNMP::Info::Bridge - Perl5 Interface to SNMP data available through the BRIDGE-M
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -191,7 +255,7 @@ None.
|
||||
|
||||
=item Q-BRIDGE-MIB
|
||||
|
||||
f<rfc2674_q.mib>
|
||||
F<rfc2674_q.mib>
|
||||
|
||||
=back
|
||||
|
||||
@@ -363,6 +427,18 @@ this port's segment."
|
||||
|
||||
"The Port Identifier of the port on the Designated Bridge for this port's segment."
|
||||
|
||||
=item $bridge->i_stp_port()
|
||||
|
||||
Returns the mapping of (B<dot1dStpPortDesignatedPort>) to the interface index (iid).
|
||||
|
||||
=item $bridge->i_stp_id()
|
||||
|
||||
Returns the mapping of (B<dot1dStpPort>) to the interface index (iid).
|
||||
|
||||
=item $bridge->i_stp_bridge()
|
||||
|
||||
Returns the mapping of (B<dot1dStpPortDesignatedBridge>) to the interface index (iid).
|
||||
|
||||
=back
|
||||
|
||||
=head2 Q-BRIDGE Data
|
||||
|
||||
18
Info/CDP.pm
18
Info/CDP.pm
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::CDP
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Changes since Version 0.7 Copyright (c) 2004 Max Baker
|
||||
# All rights reserved.
|
||||
@@ -31,27 +31,22 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::CDP;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use Carp;
|
||||
|
||||
@SNMP::Info::CDP::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CDP::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MIBS_V1 %MUNGE $INIT/;
|
||||
# Debug
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
$INIT = 0;
|
||||
%MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' );
|
||||
%MIBS_V1 = ( 'CISCO-CDP-MIB-V1SMI' => 'cdpGlobalRun' );
|
||||
|
||||
# Notice we dont inherit the default GLOBALS and FUNCS
|
||||
# only the default MUNGE.
|
||||
%GLOBALS = (
|
||||
@@ -129,8 +124,7 @@ sub c_if {
|
||||
# Nope, didn't think so. Now we fake it.
|
||||
my $c_ip = $cdp->c_ip();
|
||||
unless (defined $c_ip){
|
||||
$cdp->{error} = "SNMP::Info::CDP::c_if() - Device doesn't have c_ip() data. Can't fake c_index()";
|
||||
$DEBUG and carp($cdp->error(1));
|
||||
$cdp->error_throw("SNMP::Info::CDP:c_if() - Device doesn't have cdp_ip() data. Can't fake cdp_index()");
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -155,7 +149,7 @@ SNMP::Info::CDP - Perl5 Interface to Cisco Discovery Protocol (CDP) using SNMP
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
118
Info/CiscoImage.pm
Normal file
118
Info/CiscoImage.pm
Normal file
@@ -0,0 +1,118 @@
|
||||
package SNMP::Info::CiscoImage;
|
||||
#$Id$
|
||||
|
||||
# Copyright (c) 2005 Matt Tuttle
|
||||
#
|
||||
# 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.
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
$VERSION = '1.01';
|
||||
|
||||
@SNMP::Info::CiscoImage::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoImage::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-IMAGE-MIB' => 'ciscoImageString',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
'ci_images' => 'ciscoImageString',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
);
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::CiscoImage - Perl5 Interface to image strings for Cisco Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Matt Tuttle (C<mtuttle@americanhebrewacademy.org>)
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $ci = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $ci->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::CiscoImage is a subclass of SNMP::Info that provides access to
|
||||
image strings embedded in an image running on Cisco Devices.
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
none.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-IMAGE-MIB
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
None.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
=over
|
||||
|
||||
=item $ci->ci_images()
|
||||
|
||||
Returns the table of image strings.
|
||||
|
||||
B<ciscoImageString>
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
151
Info/CiscoQOS.pm
Normal file
151
Info/CiscoQOS.pm
Normal file
@@ -0,0 +1,151 @@
|
||||
# SNMP::Info::CiscoQOS
|
||||
# Alexander Hartmaier <alexander.hartmaier@t-systems.at>
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2005 Alexander Hartmaier
|
||||
#
|
||||
# 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::CiscoQOS;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::CiscoQOS::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoQOS::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-CLASS-BASED-QOS-MIB' => 'cbQosIfIndex',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
# CISCO-CLASS-BASED-QOS-MIB
|
||||
'qos_i_index' => 'cbQosIfIndex',
|
||||
'qos_i_type' => 'cbQosIfType',
|
||||
'qos_pol_direction' => 'cbQosPolicyDirection',
|
||||
'qos_obj_index' => 'cbQosConfigIndex',
|
||||
'qos_obj_type' => 'cbQosObjectsType',
|
||||
'qos_obj_parent' => 'cbQosParentObjectsIndex',
|
||||
'qos_cm_name' => 'cbQosCMName',
|
||||
'qos_cm_desc' => 'cbQosCMDesc',
|
||||
'qos_cm_info' => 'cbQosCMInfo',
|
||||
'qos_octet_pre' => 'cbQosCMPrePolicyByte',
|
||||
'qos_octet_post' => 'cbQosCMPostPolicyByte',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
);
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::CiscoQOS - Perl5 Interface to Cisco's Quality of Service MIBs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Alexander Hartmaier (C<alexander.hartmaier@t-systems.at>)
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $qos = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $qos->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::CiscoQOS is a subclass of SNMP::Info that provides
|
||||
information about a cisco device's QoS config.
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
none.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-CLASS-BASED-QOS-MIB
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
=over
|
||||
|
||||
none
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
=head2 ServicePolicy Table
|
||||
|
||||
This table is from CISCO-CLASS-BASED-QOS-MIB::cbQosServicePolicyTable
|
||||
|
||||
This table describes the interfaces/media types and the policymap that are attached to it.
|
||||
|
||||
=over
|
||||
|
||||
=item $qos->qos_i_index()
|
||||
|
||||
(B<cbQosIfIndex>)
|
||||
|
||||
=item $qos->qos_i_type()
|
||||
|
||||
(B<cbQosIfType>)
|
||||
|
||||
=head2 ClassMap configuration Table
|
||||
|
||||
This table is from CISCO-CLASS-BASED-QOS-MIB::cbQosCMCfgTable
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
143
Info/CiscoRTT.pm
Normal file
143
Info/CiscoRTT.pm
Normal file
@@ -0,0 +1,143 @@
|
||||
# SNMP::Info::CiscoRTT
|
||||
# Alexander Hartmaier <alexander.hartmaier@t-systems.at>
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2005 Alexander Hartmaier
|
||||
#
|
||||
# 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::CiscoRTT;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
|
||||
@SNMP::Info::CiscoRTT::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoRTT::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
|
||||
%MIBS = (
|
||||
'CISCO-RTTMON-MIB' => 'rttMonCtrlAdminOwner',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
# CISCO-RTTMON-MIB
|
||||
'rtt_desc' => 'rttMonCtrlAdminOwner',
|
||||
'rtt_last' => 'rttMonLatestRttOperCompletionTime',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
);
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::CiscoRTT - Perl5 Interface to Cisco's Round Trip Time MIBs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Alexander Hartmaier (C<alexander.hartmaier@t-systems.at>)
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $rtt = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $rtt->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::CiscoRTT is a subclass of SNMP::Info that provides
|
||||
information about a cisco device's RTT values.
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
none.
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-RTTMON-MIB
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
=over
|
||||
|
||||
none
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
=head2 Overall Control Group Table
|
||||
|
||||
This table is from CISCO-RTTMAN-MIB::rttMonCtrlAdminTable
|
||||
|
||||
=over
|
||||
|
||||
=item $rtt->rtt_desc()
|
||||
|
||||
(B<rttMonCtrlAdminOwner>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overall Control Group Table
|
||||
|
||||
This table is from CISCO-RTTMON-MIB::rttMonCtrl
|
||||
|
||||
=over
|
||||
|
||||
=item $rtt->rtt_last()
|
||||
|
||||
(B<rttMonLatestRttOperCompletionTime>)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::CiscoStack
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c)2003,2004 Max Baker
|
||||
# All rights reserved.
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::CiscoStack;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -40,10 +40,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/;
|
||||
@SNMP::Info::CiscoStack::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoStack::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
%MIBS = (
|
||||
'CISCO-STACK-MIB' => 'ciscoStackMIB',
|
||||
'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB',
|
||||
@@ -97,6 +93,11 @@ $INIT = 0;
|
||||
'p_speed' => 'portAdminSpeed',
|
||||
'p_duplex' => 'portDuplex',
|
||||
'p_port' => 'portIfIndex',
|
||||
'p_rx_flow_control' => 'portOperRxFlowControl',
|
||||
'p_tx_flow_control' => 'portOperTxFlowControl',
|
||||
'p_rx_flow_control_admin' => 'portAdminRxFlowControl',
|
||||
'p_tx_flow_control_admin' => 'portAdminTxFlowControl',
|
||||
'p_oidx' => 'portCrossIndex',
|
||||
# CISCO-STACK-MIB::PortCpbEntry
|
||||
'p_speed_admin' => 'portCpbSpeed',
|
||||
'p_duplex_admin' => 'portCpbDuplex',
|
||||
@@ -243,6 +244,43 @@ sub i_duplex_admin {
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
sub set_i_speed_admin {
|
||||
# map speeds to those the switch will understand
|
||||
my %speeds = qw/auto 1 10 10000000 100 100000000 1000 1000000000/;
|
||||
|
||||
my $stack = shift;
|
||||
my ($speed, $iid) = @_;
|
||||
my $p_port = $stack->p_port();
|
||||
my %reverse_p_port = reverse %$p_port;
|
||||
|
||||
$speed = lc($speed);
|
||||
|
||||
return 0 unless defined $speeds{$speed};
|
||||
|
||||
$iid = $reverse_p_port{$iid};
|
||||
|
||||
return $stack->set_p_speed($speeds{$speed}, $iid);
|
||||
}
|
||||
|
||||
sub set_i_duplex_admin {
|
||||
# map a textual duplex to an integer one the switch understands
|
||||
my %duplexes = qw/half 1 full 2 auto 4/;
|
||||
|
||||
my $stack = shift;
|
||||
my ($duplex, $iid) = @_;
|
||||
my $p_port = $stack->p_port();
|
||||
my %reverse_p_port = reverse %$p_port;
|
||||
|
||||
$duplex = lc($duplex);
|
||||
|
||||
return 0 unless defined $duplexes{$duplex};
|
||||
|
||||
$iid = $reverse_p_port{$iid};
|
||||
|
||||
return $stack->set_p_duplex($duplexes{$duplex}, $iid);
|
||||
}
|
||||
|
||||
|
||||
# $stack->interfaces() - Maps the ifIndex table to a physical port
|
||||
sub interfaces {
|
||||
my $self = shift;
|
||||
@@ -269,7 +307,7 @@ SNMP::Info::CiscoStack - Intefaces to data from CISCO-STACK-MIB and CISCO-PORT-S
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -424,6 +462,34 @@ Crosses p_duplex_admin with p_port.
|
||||
|
||||
Munges bit_string returned from p_duplex_admin to get duplex settings.
|
||||
|
||||
=item $stack->set_i_speed_admin(speed, ifIndex)
|
||||
|
||||
Sets port speed, must be supplied with speed and port ifIndex
|
||||
|
||||
Speed choices are 'auto', '10', '100', '1000'
|
||||
|
||||
Crosses $stack->p_port() with $stack->p_duplex() to
|
||||
utilize port ifIndex.
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$stack->interfaces()};
|
||||
$stack->set_i_speed_admin('auto', $if_map{'FastEthernet0/1'})
|
||||
or die "Couldn't change port speed. ",$stack->error(1);
|
||||
|
||||
=item $stack->set_i_duplex_admin(duplex, ifIndex)
|
||||
|
||||
Sets port duplex, must be supplied with duplex and port ifIndex
|
||||
|
||||
Speed choices are 'auto', 'half', 'full'
|
||||
|
||||
Crosses $stack->p_port() with $stack->p_duplex() to
|
||||
utilize port ifIndex.
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$stack->interfaces()};
|
||||
$stack->set_i_duplex_admin('auto', $if_map{'FastEthernet0/1'})
|
||||
or die "Couldn't change port duplex. ",$stack->error(1);
|
||||
|
||||
=back
|
||||
|
||||
=head2 Module table
|
||||
@@ -544,6 +610,50 @@ To see the status of port 4 :
|
||||
|
||||
(B<portIfIndex>)
|
||||
|
||||
=item $stack->p_rx_flow_control()
|
||||
|
||||
Can be either C<on> C<off> or C<disagree>
|
||||
|
||||
"Indicates the receive flow control operational status of the port. If the port
|
||||
could not agree with the far end on a link protocol, its operational status
|
||||
will be disagree(3)."
|
||||
|
||||
B<portOperRxFlowControl>
|
||||
|
||||
=item $stack->p_tx_flow_control()
|
||||
|
||||
Can be either C<on> C<off> or C<disagree>
|
||||
|
||||
"Indicates the transmit flow control operational status of the port. If the
|
||||
port could not agree with the far end on a link protocol, its operational
|
||||
status will be disagree(3)."
|
||||
|
||||
B<portOperTxFlowControl>
|
||||
|
||||
=item $stack->p_rx_flow_control_admin()
|
||||
|
||||
Can be either C<on> C<off> or C<desired>
|
||||
|
||||
"Indicates the receive flow control administrative status set on the port. If
|
||||
the status is set to on(1), the port will require the far end to send flow
|
||||
control. If the status is set to off(2), the port will not allow far end to
|
||||
send flow control. If the status is set to desired(3), the port will allow the
|
||||
far end to send the flow control."
|
||||
|
||||
B<portAdminRxFlowControl>
|
||||
|
||||
=item $stack->p_tx_flow_control_admin()
|
||||
|
||||
Can be either C<on> C<off> or C<desired>
|
||||
|
||||
"Indicates the transmit flow control administrative status set on the port. If
|
||||
the status is set to on(1), the port will send flow control to the far end. If
|
||||
the status is set to off(2), the port will not send flow control to the far
|
||||
end. If the status is set to desired(3), the port will send flow control to the
|
||||
far end if the far end supports it."
|
||||
|
||||
B<portAdminTxFlowControl>
|
||||
|
||||
=back
|
||||
|
||||
=head2 Port Capability Table (CISCO-STACK-MIB::portCpbTable)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::CiscoStats
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Changes since Version 0.7 Copyright (c) 2004 Max Baker
|
||||
# All rights reserved.
|
||||
@@ -31,7 +31,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::CiscoStats;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -43,14 +43,14 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::CiscoStats::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoStats::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
%MIBS = (
|
||||
'RFC1213-MIB' => 'sysDescr',
|
||||
'SNMPv2-MIB' => 'sysDescr',
|
||||
'CISCO-PROCESS-MIB' => 'cpmCPUTotal5sec',
|
||||
'CISCO-MEMORY-POOL-MIB' => 'ciscoMemoryPoolUsed'
|
||||
'CISCO-MEMORY-POOL-MIB' => 'ciscoMemoryPoolUsed',
|
||||
'OLD-CISCO-SYSTEM-MIB' => 'writeMem',
|
||||
'CISCO-PRODUCTS-MIB' => 'sysName',
|
||||
'CISCO-STACK-MIB' => 'wsc1900sysID', # some older catalysts live here
|
||||
'CISCO-ENTITY-VENDORTYPE-OID-MIB' => 'cevChassis',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -68,6 +68,8 @@ $INIT = 0;
|
||||
# CISCO-MEMORY-POOL-MIB
|
||||
'mem_free' => 'ciscoMemoryPoolFree.1',
|
||||
'mem_used' => 'ciscoMemoryPoolUsed.1',
|
||||
# OLD-CISCO-SYSTEM-MIB
|
||||
'write_mem' => 'writeMem',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
@@ -78,7 +80,7 @@ $INIT = 0;
|
||||
|
||||
sub os {
|
||||
my $l2 = shift;
|
||||
my $descr = $l2->description();
|
||||
my $descr = $l2->description() || '';
|
||||
|
||||
# order here matters - there are Catalysts that run IOS and have catalyst in their description field.
|
||||
return 'ios' if ($descr =~ /IOS/);
|
||||
@@ -144,7 +146,7 @@ SNMP::Info::CiscoStats - Perl5 Interface to CPU and Memory stats for Cisco Devic
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -177,11 +179,19 @@ none.
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-PRODUCTS-MIB
|
||||
|
||||
=item CISCO-PROCESS-MIB
|
||||
|
||||
=item CISCO-MEMORY-POOL-MIB
|
||||
|
||||
=item RFC1213-MIB
|
||||
=item SNMPv2-MIB
|
||||
|
||||
=item OLD-CISCO-SYSTEM-MIB
|
||||
|
||||
=item CISCO-STACK-MIB
|
||||
|
||||
=item CISCO-ENTITY-VENDORTYPE-OID-MIB
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::CiscoVTP
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::CiscoVTP;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -42,10 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::CiscoVTP::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::CiscoVTP::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
%MIBS = (
|
||||
'CISCO-VTP-MIB' => 'vtpVlanName',
|
||||
'CISCO-VLAN-MEMBERSHIP-MIB' => 'vmMembershipEntry',
|
||||
@@ -106,11 +102,12 @@ $INIT = 0;
|
||||
# CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB
|
||||
'v_cvi_if' => 'cviRoutedVlanIfIndex',
|
||||
|
||||
# vlanTrunkPortTable
|
||||
|
||||
# TODO Add these tables if someone wants them..
|
||||
# vtpEditControlTable
|
||||
# vtpVlanEditTable
|
||||
# vtpStatsTable
|
||||
# vlanTrunkPortTable
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -141,6 +138,18 @@ sub i_vlan {
|
||||
return $i_vlan;
|
||||
}
|
||||
|
||||
sub set_i_vlan {
|
||||
my $vtp = shift;
|
||||
|
||||
# Check for CISCO-VLAN-MIB
|
||||
my $i_vlan = $vtp->i_vlan2();
|
||||
if (defined $i_vlan) {
|
||||
return $vtp->set_i_vlan2(@_);
|
||||
}
|
||||
# only support the first case for now.
|
||||
return undef;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -150,7 +159,7 @@ SNMP::Info::CiscoVTP - Perl5 Interface to Cisco's VLAN Management MIBs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Entity
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Entity;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -42,24 +42,29 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::Entity::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::Entity::EXPORT_OK = qw//;
|
||||
|
||||
$INIT = 0;
|
||||
%MIBS = ('ENTITY-MIB' => 'entPhysicalSerialNum');
|
||||
|
||||
%GLOBALS = (
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
'e_index' => 'entPhysicalIndex',
|
||||
'e_alias' => 'entPhysicalAlias',
|
||||
'e_class' => 'entPhysicalClass',
|
||||
'e_descr' => 'entPhysicalDescr',
|
||||
'e_fwver' => 'entPhysicalFirmwareRev',
|
||||
'e_fru' => 'entPhysicalIsFRU',
|
||||
'e_hwver' => 'entPhysicalHardwareRev',
|
||||
'e_id' => 'entPhysicalAssetID',
|
||||
'e_map' => 'entAliasMappingIdentifier',
|
||||
'e_model' => 'entPhysicalModelName',
|
||||
'e_name' => 'entPhysicalName',
|
||||
'e_parent' => 'entPhysicalContainedIn',
|
||||
'e_pos' => 'entParentRelPos',
|
||||
'e_serial' => 'entPhysicalSerialNum',
|
||||
'e_swver' => 'entPhysicalSoftwareRev',
|
||||
'e_type' => 'entPhysicalVendorType',
|
||||
'e_vendor' => 'entPhysicalMfgName',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -87,11 +92,11 @@ sub e_port {
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Entity - Perl5 Interface to SNMP data stored in ENTITY-MIB.
|
||||
SNMP::Info::Entity - Perl5 Interface to SNMP data stored in ENTITY-MIB. RFC 2737
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -111,7 +116,9 @@ Max Baker (C<max@warped.org>)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
ENTITY-MIB is used by some Layer 2 devices like HP Switches and Aironet Access Points
|
||||
ENTITY-MIB is used by Layer 2 devices from HP,Aironet,Foundry,Cisco and more.
|
||||
|
||||
See RFC 2737 for full details.
|
||||
|
||||
Create or use a device subclass that inherit this class. Do not use directly.
|
||||
|
||||
@@ -146,36 +153,72 @@ to a hash.
|
||||
|
||||
=over
|
||||
|
||||
=item $entity->e_index()
|
||||
|
||||
Not normally implemented
|
||||
|
||||
(C<entPhysicalIndex>)
|
||||
|
||||
=item $entity->e_alias()
|
||||
|
||||
Human entered, not usually used.
|
||||
|
||||
(C<entPhysicalAlias>)
|
||||
|
||||
=item $entity->e_class()
|
||||
|
||||
Stack, Module, Container, Port ...
|
||||
|
||||
(C<entPhysicalClass>)
|
||||
|
||||
=item $entity->e_descr()
|
||||
|
||||
Human Friendly
|
||||
|
||||
(C<entPhysicalClass>)
|
||||
|
||||
=item $entity->e_fwver()
|
||||
|
||||
(C<entPhysicalFirmwareRev>)
|
||||
|
||||
=item $entity->e_fru()
|
||||
|
||||
BOOLEAN. Field Replaceable unit?
|
||||
|
||||
(C<entPhysicalFRU>)
|
||||
|
||||
=item $entity->e_hwver()
|
||||
|
||||
(C<entPhysicalHardwareRev>)
|
||||
|
||||
=item $entity->e_id()
|
||||
|
||||
This is human entered and not normally used.
|
||||
|
||||
(C<entPhysicalAssetID>)
|
||||
|
||||
=item $entity->e_map()
|
||||
|
||||
See MIB.
|
||||
|
||||
(C<entAliasMappingIdentifier>)
|
||||
|
||||
=item $entity->e_model()
|
||||
|
||||
Model Name of Entity.
|
||||
|
||||
(C<entPhysicalModelName>)
|
||||
|
||||
=item $entity->e_name()
|
||||
|
||||
More computer friendly name of entity. Parse me.
|
||||
|
||||
(C<entPhysicalName>)
|
||||
|
||||
=item $entity->e_parent()
|
||||
|
||||
0 if root.
|
||||
|
||||
(C<entPhysicalContainedIn>)
|
||||
|
||||
=item $entity->e_port()
|
||||
@@ -193,8 +236,16 @@ $entity->e_map()
|
||||
|
||||
=item $entity->e_type()
|
||||
|
||||
This is an OID.
|
||||
|
||||
(C<entPhysicalVendorType>)
|
||||
|
||||
=item $entity->e_vendor()
|
||||
|
||||
Vendor of Module.
|
||||
|
||||
(C<entPhysicalMfgName>)
|
||||
|
||||
=back
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::EtherLike
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::EtherLike;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -42,12 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::EtherLike::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::EtherLike::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
# Same info in both rfc1398 and this?
|
||||
%MIBS = ('ETHERLIKE-MIB' => 'etherMIB' );
|
||||
|
||||
%GLOBALS = ();
|
||||
@@ -75,7 +69,18 @@ $INIT = 0;
|
||||
'el_coll_freq' => 'dot3CollFrequencies'
|
||||
);
|
||||
|
||||
%MUNGE = ( %SNMP::Info::MUNGE );
|
||||
%MUNGE = ( %SNMP::Info::MUNGE,
|
||||
'el_duplex' => \&munge_el_duplex,
|
||||
);
|
||||
|
||||
sub munge_el_duplex {
|
||||
my $duplex = shift;
|
||||
return unless defined $duplex;
|
||||
|
||||
$duplex =~ s/Duplex$//;
|
||||
return $duplex;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
@@ -83,11 +88,11 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB
|
||||
SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB RFC 1398
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -112,10 +117,6 @@ Max Baker (C<max@warped.org>)
|
||||
my $iid = $el_index->{$el_port};
|
||||
my $port = $interfaces->{$iid};
|
||||
|
||||
$duplex = 'half' if $duplex =~/half/i;
|
||||
$duplex = 'full' if $duplex =~/full/i;
|
||||
$duplex = 'auto' if $duplex =~/auto/i;
|
||||
|
||||
print "PORT:$port set to duplex:$duplex\n";
|
||||
}
|
||||
|
||||
@@ -124,6 +125,8 @@ Max Baker (C<max@warped.org>)
|
||||
SNMP::Info::EtherLike is a subclass of SNMP::Info that supplies
|
||||
access to the ETHERLIKE-MIB used by some Layer 3 Devices such as Cisco routers.
|
||||
|
||||
See RFC 1398 for more details.
|
||||
|
||||
Use or create a subclass of SNMP::Info that inherits this one. Do not use directly.
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
30
Info/FDP.pm
30
Info/FDP.pm
@@ -32,31 +32,22 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::FDP;
|
||||
$VERSION = 0.9;
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use Carp;
|
||||
|
||||
@SNMP::Info::FDP::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::FDP::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
# Debug
|
||||
$DEBUG=1;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
$VERSION = '1.01';
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
$INIT = 0;
|
||||
%MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' );
|
||||
|
||||
# Notice we dont inherit the default GLOBALS and FUNCS
|
||||
# only the default MUNGE.
|
||||
%GLOBALS = (
|
||||
# CDP-Compatibility
|
||||
'cdp_run' => 'snFdpGlobalRun',
|
||||
'cdp_interval' => 'snFdpGlobalMessageInterval',
|
||||
'cdp_holdtime' => 'snFdpGlobalHoldTime',
|
||||
'cdp_id' => 'snFdpGlobalDeviceId',
|
||||
@@ -78,7 +69,7 @@ $INIT = 0;
|
||||
'c_capabilities' => 'snFdpCacheCapabilities',
|
||||
'c_domain' => 'snFdpCacheVTPMgmtDomain',
|
||||
'c_vlan' => 'snFdpCacheNativeVLAN',
|
||||
'c_duplex' => 'snFdpCacheDuplex'
|
||||
'c_duplex' => 'snFdpCacheDuplex',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -96,6 +87,16 @@ sub munge_caps {
|
||||
|
||||
|
||||
}
|
||||
|
||||
sub cdp_run {
|
||||
my $fdp = shift;
|
||||
my $fdp_run = $fdp->fdp_run();
|
||||
|
||||
# if fdp_run isn't implemented on device, assume FDP is on
|
||||
return $fdp_run if defined $fdp_run;
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub hasFDP {
|
||||
my $fdp = shift;
|
||||
|
||||
@@ -118,8 +119,6 @@ sub hasFDP {
|
||||
sub c_if {
|
||||
my $fdp = shift;
|
||||
|
||||
|
||||
|
||||
# See if by some miracle Cisco implemented the fdpCacheIfIndex entry
|
||||
my $fdp_index = $fdp->fdp_index();
|
||||
return $fdp_index if defined $fdp_index;
|
||||
@@ -127,8 +126,7 @@ sub c_if {
|
||||
# Nope, didn't think so. Now we fake it.
|
||||
my $fdp_ip = $fdp->c_ip();
|
||||
unless (defined $fdp_ip){
|
||||
$fdp->{error} = "SNMP::Info::FDP:fdp_if() - Device doesn't have fdp_ip() data. Can't fake fdp_index()";
|
||||
$DEBUG and carp($fdp->error(1));
|
||||
$fdp->error_throw("SNMP::Info::FDP:fdp_if() - Device doesn't have fdp_ip() data. Can't fake fdp_index()");
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -153,7 +151,7 @@ SNMP::Info::FDP - Perl5 Interface to Foundry Discovery Protocol (FDP) using SNMP
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Bruce Rodger, Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer1 - SNMP Interface to Layer1 Devices
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer1;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -43,13 +43,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/;
|
||||
@SNMP::Info::Layer1::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::Layer1::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS,
|
||||
'SNMP-REPEATER-MIB' => 'rptrPortGroupIndex'
|
||||
);
|
||||
@@ -169,7 +162,7 @@ SNMP::Info::Layer1 - Perl5 Interface to network devices serving Layer1 only.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer1::Allied
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer1::Allied;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
@@ -128,7 +128,7 @@ SNMP::Info::Layer1::Allied - SNMP Interface to old Allied Hubs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer1::Asante
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer1::Asante;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
@@ -171,7 +171,7 @@ SNMP::Info::Layer1::Asante - SNMP Interface to old Asante 1012 Hubs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -232,12 +232,6 @@ Culls software version from description()
|
||||
|
||||
Returns 'asante' :)
|
||||
|
||||
=item $asante->root_ip()
|
||||
|
||||
Returns IP Address of Managed Hub.
|
||||
|
||||
(B<actualIpAddr>)
|
||||
|
||||
=item $asante->model()
|
||||
|
||||
Trys to cull out AT-nnnnX out of the description field.
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
# SNMP::Info::Layer1::Bayhub
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2004-6 Eric Miller, Max Baker
|
||||
#
|
||||
# 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:
|
||||
#
|
||||
@@ -31,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer1::Bayhub;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
@@ -46,12 +43,12 @@ use SNMP::Info::SONMP;
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::NortelStack::MIBS,
|
||||
%SNMP::Info::NortelStack::MIBS,
|
||||
%SNMP::Info::SONMP::MIBS,
|
||||
'S5-ETHERNET-COMMON-MIB' => 's5EnPortTable',
|
||||
'S5-COMMON-STATS-MIB' => 's5CmStat',
|
||||
'S5-ETHERNET-COMMON-MIB' => 's5EnPortTable',
|
||||
'S5-COMMON-STATS-MIB' => 's5CmStat',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -59,7 +56,7 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::NortelStack::GLOBALS,
|
||||
%SNMP::Info::SONMP::GLOBALS,
|
||||
);
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
@@ -67,14 +64,14 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%SNMP::Info::NortelStack::FUNCS,
|
||||
%SNMP::Info::SONMP::FUNCS,
|
||||
# S5-ETHERNET-COMMON-MIB::s5EnPortTable
|
||||
'bayhub_pb_index' => 's5EnPortBrdIndx',
|
||||
'bayhub_pp_index' => 's5EnPortIndx',
|
||||
'bayhub_up_admin' => 's5EnPortPartStatus',
|
||||
'bayhub_up' => 's5EnPortLinkStatus',
|
||||
# S5-COMMON-STATS-MIB::s5CmSNodeTable
|
||||
'bayhub_nb_index' => 's5CmSNodeBrdIndx',
|
||||
'bayhub_np_index' => 's5CmSNodePortIndx',
|
||||
'fw_mac' => 's5CmSNodeMacAddr',
|
||||
'bayhub_pb_index' => 's5EnPortBrdIndx',
|
||||
'bayhub_pp_index' => 's5EnPortIndx',
|
||||
'bayhub_up_admin' => 's5EnPortPartStatus',
|
||||
'bayhub_up' => 's5EnPortLinkStatus',
|
||||
# S5-COMMON-STATS-MIB::s5CmSNodeTable
|
||||
'bayhub_nb_index' => 's5CmSNodeBrdIndx',
|
||||
'bayhub_np_index' => 's5CmSNodePortIndx',
|
||||
'fw_mac' => 's5CmSNodeMacAddr',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -137,9 +134,9 @@ sub i_index {
|
||||
}
|
||||
}
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$i_index{$iid} = $index;
|
||||
$i_index{$iid} = $index;
|
||||
}
|
||||
return \%i_index;
|
||||
}
|
||||
@@ -153,8 +150,8 @@ sub interfaces {
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# Index numbers are deterministic slot * 256 + port
|
||||
my $port = $index % 256;
|
||||
# Index numbers are deterministic slot * 256 + port
|
||||
my $port = $index % 256;
|
||||
my $slot = int($index / 256);
|
||||
|
||||
my $slotport = "$slot.$port";
|
||||
@@ -220,8 +217,8 @@ sub i_up {
|
||||
my $index = $port_index->{$iid};
|
||||
next unless defined $index;
|
||||
my $link_stat = $link_stat->{$iid};
|
||||
next unless defined $link_stat;
|
||||
|
||||
next unless defined $link_stat;
|
||||
|
||||
$link_stat = 'up' if $link_stat =~ /on/i;
|
||||
$link_stat = 'down' if $link_stat =~ /off/i;
|
||||
|
||||
@@ -237,15 +234,35 @@ sub i_up_admin {
|
||||
|
||||
my %i_up_admin;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
my $link_stat = $link_stat->{$iid};
|
||||
next unless defined $link_stat;
|
||||
next unless defined $link_stat;
|
||||
|
||||
$i_up_admin{$index}=$link_stat;
|
||||
}
|
||||
return \%i_up_admin;
|
||||
}
|
||||
|
||||
sub set_i_up_admin {
|
||||
# map setting to those the hub will understand
|
||||
my %setting = qw/up 2 down 3/;
|
||||
|
||||
my $bayhub = shift;
|
||||
my ($setting, $iid) = @_;
|
||||
|
||||
my $i_index = $bayhub->i_index();
|
||||
my %reverse_i_index = reverse %$i_index;
|
||||
|
||||
$setting = lc($setting);
|
||||
|
||||
return 0 unless defined $setting{$setting};
|
||||
|
||||
$iid = $reverse_i_index{$iid};
|
||||
|
||||
return $bayhub->set_bayhub_up_admin($setting{$setting}, $iid);
|
||||
}
|
||||
|
||||
# Hubs do not support the standard Bridge MIB
|
||||
sub bp_index {
|
||||
my $bayhub = shift;
|
||||
@@ -258,7 +275,7 @@ sub bp_index {
|
||||
my $board = $b_index->{$iid};
|
||||
next unless defined $board;
|
||||
my $port = $p_index->{$iid}||0;
|
||||
|
||||
|
||||
if ($model eq 'Baystack Hub') {
|
||||
my $comidx = $board;
|
||||
if (! ($comidx % 5)) {
|
||||
@@ -272,9 +289,9 @@ sub bp_index {
|
||||
}
|
||||
}
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$bp_index{$index} = $index;
|
||||
$bp_index{$index} = $index;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
@@ -303,8 +320,8 @@ sub fw_port {
|
||||
$port = 26;
|
||||
}
|
||||
}
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$fw_port{$iid} = $index;
|
||||
}
|
||||
@@ -328,7 +345,7 @@ SNMP::Info::Layer1::Bayhub - SNMP Interface to Bay / Nortel Hubs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -392,13 +409,6 @@ See SNMP::Info::SONMP for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found on the CD that came with your product.
|
||||
|
||||
Or, they can be downloaded directly from Nortel Networks regardless of support
|
||||
contract status. Go to http://www.nortelnetworks.com Technical Support, Browse Technical Support,
|
||||
Select by Product Families, BayStack, BayStack: Hubs - 150 Series, 10BASE-T,
|
||||
Software. Filter on mibs and download the latest version's archive.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
@@ -407,11 +417,11 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=item $bayhub->vendor()
|
||||
|
||||
Returns 'Nortel'
|
||||
Returns 'nortel'
|
||||
|
||||
=item $bayhub->os()
|
||||
|
||||
Returns 'Bay Hub'
|
||||
Returns 'bay_hub'
|
||||
|
||||
=item $bayhub->model()
|
||||
|
||||
@@ -498,6 +508,17 @@ Returns (B<s5EnPortLinkStatus>) for each port. Translates on/off to up/down.
|
||||
|
||||
Returns (B<s5EnPortPartStatus>) for each port.
|
||||
|
||||
=item $bayhub->set_i_up_admin(state, ifIndex)
|
||||
|
||||
Sets port state, must be supplied with state and port ifIndex
|
||||
|
||||
State choices are 'up'or 'down'
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$bayhub->interfaces()};
|
||||
$bayhub->set_i_up_admin('down', $if_map{'1.1'})
|
||||
or die "Couldn't change port state. ",$bayhub->error(1);
|
||||
|
||||
=item $bayhub->bp_index()
|
||||
|
||||
Simulates bridge MIB by returning reference to a hash containing the index for
|
||||
|
||||
524
Info/Layer1/S3000.pm
Normal file
524
Info/Layer1/S3000.pm
Normal file
@@ -0,0 +1,524 @@
|
||||
# SNMP::Info::Layer1::S3000
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2006 Eric Miller
|
||||
#
|
||||
# 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::Layer1::S3000;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer1;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
@SNMP::Info::Layer1::S3000::ISA = qw/SNMP::Info::Layer1 SNMP::Info::Bridge/;
|
||||
@SNMP::Info::Layer1::S3000::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer1::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'SYNOPTICS-ETHERNET-MIB' => 's3EnetPortTable',
|
||||
'SYNOPTICS-COMMON-MIB' => 's3AgentType',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer1::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
# From SYNOPTICS-COMMON-MIB
|
||||
'os_bin' => 's3AgentFwVer',
|
||||
's3000_major_ver' => 's3AgentSwMajorVer',
|
||||
's3000_minor_ver' => 's3AgentSwMinorVer',
|
||||
's3000_maint_ver' => 's3AgentSwMaintVer',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer1::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
# SYNOPTICS-ETHERNET-MIB::s3EnetPortTable
|
||||
's3000_pb_index' => 's3EnetPortBoardIndex',
|
||||
's3000_pp_index' => 's3EnetPortIndex',
|
||||
's3000_up_admin' => 's3EnetPortPartStatus',
|
||||
's3000_up' => 's3EnetPortLinkStatus',
|
||||
# SYNOPTICS-ETHERNET-MIB::s3EnetShowNodesTable
|
||||
's3000_nb_index' => 's3EnetShowNodesSlotIndex',
|
||||
's3000_np_index' => 's3EnetShowNodesPortIndex',
|
||||
'fw_mac' => 's3EnetShowNodesMacAddress',
|
||||
# SYNOPTICS-ETHERNET-MIB::s3EnetTopNmmTable
|
||||
's3000_topo_port' => 's3EnetTopNmmPort',
|
||||
's3000_topo_mac' => 's3EnetTopNmmMacAddr',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer1::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
's3000_topo_mac' => \&SNMP::Info::munge_mac
|
||||
);
|
||||
|
||||
sub layers {
|
||||
return '00000011';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'synoptics';
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'nortel';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $s3000 = shift;
|
||||
my $id = $s3000->id();
|
||||
return undef unless defined $id;
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
$model =~ s/^s3reg-//i;
|
||||
|
||||
return $1 if ($model =~ /((\d+){3}[\dX])/);
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $s3000 = shift;
|
||||
my $major_ver = $s3000->s3000_major_ver() || 0;
|
||||
my $minor_ver = $s3000->s3000_minor_ver() || 0;
|
||||
my $maint_ver = $s3000->s3000_maint_ver() || 0;
|
||||
|
||||
my $ver = "$major_ver.$minor_ver.$maint_ver";
|
||||
return $ver;
|
||||
}
|
||||
|
||||
sub mac {
|
||||
my $s3000 = shift;
|
||||
my $topo_port = $s3000->s3000_topo_port();
|
||||
my $topo_mac = $s3000->s3000_topo_mac();
|
||||
|
||||
foreach my $entry (keys %$topo_port){
|
||||
my $port = $topo_port->{$entry};
|
||||
next unless $port == 0;
|
||||
my $mac = $topo_mac->{$entry};
|
||||
return $mac;
|
||||
}
|
||||
# Topology turned off, not supported.
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Hubs do not support ifMIB requirements for get MAC
|
||||
# and port status
|
||||
sub i_index {
|
||||
my $s3000 = shift;
|
||||
my $b_index = $s3000->s3000_pb_index();
|
||||
my $p_index = $s3000->s3000_pp_index();
|
||||
|
||||
my %i_index;
|
||||
foreach my $iid (keys %$b_index){
|
||||
my $board = $b_index->{$iid};
|
||||
next unless defined $board;
|
||||
my $port = $p_index->{$iid}||0;
|
||||
|
||||
# We need to make up an index for multiple board instances.
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$i_index{$iid} = $index;
|
||||
}
|
||||
return \%i_index;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $s3000 = shift;
|
||||
my $i_index = $s3000->i_index();
|
||||
|
||||
my %if;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# Index numbers are deterministic slot * 256 + port - see i_index()
|
||||
my $port = $index % 256;
|
||||
my $slot = int($index / 256);
|
||||
|
||||
my $slotport = "$slot.$port";
|
||||
|
||||
$if{$index} = $slotport;
|
||||
}
|
||||
|
||||
return \%if;
|
||||
}
|
||||
|
||||
sub i_duplex {
|
||||
my $s3000 = shift;
|
||||
my $port_index = $s3000->i_index();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $iid (keys %$port_index){
|
||||
my $index = $port_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# Hubs only function half duplex
|
||||
my $duplex = 'half';
|
||||
$i_duplex{$index}=$duplex;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
|
||||
sub i_duplex_admin {
|
||||
my $s3000 = shift;
|
||||
my $port_index = $s3000->i_index();
|
||||
|
||||
my %i_duplex_admin;
|
||||
foreach my $iid (keys %$port_index){
|
||||
my $index = $port_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# Hubs only function half duplex
|
||||
my $duplex = 'half';
|
||||
$i_duplex_admin{$index}=$duplex;
|
||||
}
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
sub i_speed {
|
||||
my $s3000 = shift;
|
||||
my $port_index = $s3000->i_index();
|
||||
|
||||
my %i_speed;
|
||||
foreach my $iid (keys %$port_index){
|
||||
my $index = $port_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
# These hubs only support 10Mbs
|
||||
my $speed = '10000000';
|
||||
$i_speed{$index}=$speed;
|
||||
}
|
||||
return \%i_speed;
|
||||
}
|
||||
|
||||
sub i_up {
|
||||
my $s3000 = shift;
|
||||
my $port_index = $s3000->i_index();
|
||||
my $link_stat = $s3000->s3000_up();
|
||||
|
||||
my %i_up;
|
||||
foreach my $iid (keys %$port_index){
|
||||
my $index = $port_index->{$iid};
|
||||
next unless defined $index;
|
||||
my $link_stat = $link_stat->{$iid};
|
||||
next unless defined $link_stat;
|
||||
|
||||
$link_stat = 'up' if $link_stat =~ /on/i;
|
||||
$link_stat = 'down' if $link_stat =~ /off/i;
|
||||
|
||||
$i_up{$index}=$link_stat;
|
||||
}
|
||||
return \%i_up;
|
||||
}
|
||||
|
||||
sub i_up_admin {
|
||||
my $s3000 = shift;
|
||||
my $i_index = $s3000->i_index();
|
||||
my $link_stat = $s3000->s3000_up_admin();
|
||||
|
||||
my %i_up_admin;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
my $link_stat = $link_stat->{$iid};
|
||||
next unless defined $link_stat;
|
||||
|
||||
$i_up_admin{$index}=$link_stat;
|
||||
}
|
||||
return \%i_up_admin;
|
||||
}
|
||||
|
||||
sub set_i_up_admin {
|
||||
# map setting to those the hub will understand
|
||||
my %setting = qw/up 2 down 3/;
|
||||
|
||||
my $s3000 = shift;
|
||||
my ($setting, $iid) = @_;
|
||||
|
||||
my $i_index = $s3000->i_index();
|
||||
my %reverse_i_index = reverse %$i_index;
|
||||
|
||||
$setting = lc($setting);
|
||||
|
||||
return 0 unless defined $setting{$setting};
|
||||
|
||||
$iid = $reverse_i_index{$iid};
|
||||
|
||||
return $s3000->set_s3000_up_admin($setting{$setting}, $iid);
|
||||
}
|
||||
|
||||
# Hubs do not support the standard Bridge MIB
|
||||
sub bp_index {
|
||||
my $s3000 = shift;
|
||||
my $b_index = $s3000->s3000_nb_index();
|
||||
my $p_index = $s3000->s3000_np_index();
|
||||
my $model = $s3000->model();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$b_index){
|
||||
my $board = $b_index->{$iid};
|
||||
next unless defined $board;
|
||||
my $port = $p_index->{$iid}||0;
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$bp_index{$index} = $index;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
sub fw_port {
|
||||
my $s3000 = shift;
|
||||
my $b_index = $s3000->s3000_nb_index();
|
||||
my $p_index = $s3000->s3000_np_index();
|
||||
my $model = $s3000->model();
|
||||
|
||||
my %fw_port;
|
||||
foreach my $iid (keys %$b_index){
|
||||
my $board = $b_index->{$iid};
|
||||
next unless defined $board;
|
||||
my $port = $p_index->{$iid}||0;
|
||||
|
||||
my $index = ($board*256)+$port;
|
||||
|
||||
$fw_port{$iid} = $index;
|
||||
}
|
||||
return \%fw_port;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer1::S3000 - SNMP Interface to Synoptics / Nortel Hubs
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#Let SNMP::Info determine the correct subclass for you.
|
||||
|
||||
my $s3000 = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $s3000->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a
|
||||
Bayhub device through SNMP. Also provides device MAC to port mapping through the propietary MIB.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
|
||||
my $s3000 = new SNMP::Info::Layer1::S3000(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer1
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item SYNOPTICS-COMMON-MIB
|
||||
|
||||
=item SYNOPTICS-ETHERNET-MIB
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See SNMP::Info::Layer1 for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Bridge for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $s3000->vendor()
|
||||
|
||||
Returns 'nortel'
|
||||
|
||||
=item $s3000->os()
|
||||
|
||||
Returns 'synoptics'
|
||||
|
||||
=item $s3000->model()
|
||||
|
||||
Cross references $s3000->id() to the SYNOPTICS-MIB and returns
|
||||
the results.
|
||||
|
||||
Removes sreg- from the model name and returns only the numeric model identifier.
|
||||
|
||||
=item $stack->os_ver()
|
||||
|
||||
Returns the software version specified as major.minor.maint.
|
||||
|
||||
(B<s3AgentSwMajorVer>).(B<s3AgentSwMinorVer>).(B<s3AgentSwMaintVer>)
|
||||
|
||||
=item $stack->os_bin()
|
||||
|
||||
Returns the firmware version. (B<s3AgentFwVer>)
|
||||
|
||||
=item $s3000->mac()
|
||||
|
||||
Returns MAC of the advertised IP address of the device.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $s3000->layers()
|
||||
|
||||
Returns 00000011. Class emulates Layer 2 functionality through proprietary MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer1
|
||||
|
||||
See documentation in SNMP::Info::Layer1 for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $s3000->i_index()
|
||||
|
||||
Returns reference to map of IIDs to Interface index.
|
||||
|
||||
Since hubs do not support ifIndex, the interface index is created using the
|
||||
formula (board * 256 + port). This is required to support devices with more than one module.
|
||||
|
||||
=item $s3000->interfaces()
|
||||
|
||||
Returns reference to map of IIDs to physical ports.
|
||||
|
||||
=item $s3000->i_duplex()
|
||||
|
||||
Returns half, hubs do not support full duplex.
|
||||
|
||||
=item $s3000->i_duplex_admin()
|
||||
|
||||
Returns half, hubs do not support full duplex.
|
||||
|
||||
=item $s3000->i_speed()
|
||||
|
||||
Returns 10000000. The hubs only support 10Mbs Ethernet.
|
||||
|
||||
=item $s3000->i_up()
|
||||
|
||||
Returns (B<s3EnetPortLinkStatus>) for each port. Translates on/off to up/down.
|
||||
|
||||
=item $s3000->i_up_admin()
|
||||
|
||||
Returns (B<s3EnetPortPartStatus>) for each port.
|
||||
|
||||
=item $s3000->set_i_up_admin(state, ifIndex)
|
||||
|
||||
Sets port state, must be supplied with state and port ifIndex
|
||||
|
||||
State choices are 'up'or 'down'
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$s3000->interfaces()};
|
||||
$s3000->set_i_up_admin('down', $if_map{'1.1'})
|
||||
or die "Couldn't change port state. ",$s3000->error(1);
|
||||
|
||||
=item $s3000->bp_index()
|
||||
|
||||
Simulates bridge MIB by returning reference to a hash containing the index for
|
||||
both the keys and values.
|
||||
|
||||
=item $s3000->fw_port()
|
||||
|
||||
Returns reference to map of IIDs of the SYNOPTICS-ETHERNET-MIB::s3EnetShowNodesTable
|
||||
to the Interface index.
|
||||
|
||||
=item $s3000->fw_mac()
|
||||
|
||||
(B<s3EnetShowNodesMacAddress>)
|
||||
|
||||
=item $s3000->s3000_topo_port()
|
||||
|
||||
Returns reference to hash. Key: Table entry, Value:Port Number (interface iid)
|
||||
|
||||
(B<s3EnetTopNmmPort>)
|
||||
|
||||
=item $s3000->s3000_topo_mac()
|
||||
|
||||
(B<s3EnetTopNmmMacAddr>)
|
||||
|
||||
Returns reference to hash. Key: Table entry, Value:Remote MAC address
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer1
|
||||
|
||||
See documentation in SNMP::Info::Layer1 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=cut
|
||||
104
Info/Layer2.pm
104
Info/Layer2.pm
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer2 - SNMP Interface to Layer2 Devices
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker -- All changes from Version 0.7 on
|
||||
# Copyright (c) 2004,2005 Max Baker -- All changes from Version 0.7 on
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# All rights reserved.
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -38,53 +38,36 @@ use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/;
|
||||
|
||||
@SNMP::Info::Layer2::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::CDP SNMP::Info::CiscoStats Exporter/;
|
||||
@SNMP::Info::Layer2::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer2::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
'CISCO-PRODUCTS-MIB' => 'sysName', # for model()
|
||||
'CISCO-STACK-MIB' => 'wsc1900sysID', # some older catalysts live here
|
||||
'ENTITY-MIB' => 'entPhysicalName', # for serial stuff
|
||||
%MIBS = ( %SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
'serial1' => '.1.3.6.1.4.1.9.3.6.3.0', # OLD-CISCO-CHASSIS-MIB::chassisId.0
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
'ent_serial' => 'entPhysicalSerialNum',
|
||||
'ent_chassis'=> 'entPhysicalDescr',
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
);
|
||||
|
||||
# Method OverRides
|
||||
@@ -112,7 +95,7 @@ sub vendor {
|
||||
my $model = $l2->model();
|
||||
my $descr = $l2->description();
|
||||
|
||||
if ($model =~ /hp/i or $descr =~ /hp/i) {
|
||||
if ($model =~ /hp/i or $descr =~ /\bhp\b/i) {
|
||||
return 'hp';
|
||||
}
|
||||
|
||||
@@ -125,12 +108,12 @@ sub vendor {
|
||||
sub serial {
|
||||
my $l2 = shift;
|
||||
|
||||
my $serial1 = $l2->serial1();
|
||||
my $ent_chassis = $l2->ent_chassis() || {};
|
||||
my $ent_serial = $l2->ent_serial() || {};
|
||||
my $serial1 = $l2->serial1();
|
||||
my $e_descr = $l2->e_descr() || {};
|
||||
my $e_serial = $l2->e_serial() || {};
|
||||
|
||||
my $serial2 = $ent_serial->{1} || undef;
|
||||
my $chassis = $ent_chassis->{1} || undef;
|
||||
my $serial2 = $e_serial->{1} || undef;
|
||||
my $chassis = $e_descr->{1} || undef;
|
||||
|
||||
# precedence
|
||||
# serial2,chassis parse,serial1
|
||||
@@ -157,31 +140,18 @@ sub i_ignore {
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
# By Default we'll use the description field
|
||||
sub interfaces {
|
||||
my $l2 = shift;
|
||||
my $interfaces = $l2->i_index();
|
||||
my $i_descr = $l2->i_description();
|
||||
my $i_name = $l2->i_name();
|
||||
|
||||
my %if;
|
||||
foreach my $iid (keys %$interfaces){
|
||||
# Replace the Index with the ifDescr field.
|
||||
foreach my $iid (keys %$i_descr){
|
||||
my $port = $i_descr->{$iid};
|
||||
my $name = $i_name->{$iid};
|
||||
$port = $name if (defined $name and $name !~ /^\s*$/);
|
||||
next unless defined $port;
|
||||
|
||||
# Cisco 1900 has a space in some of its port descr.
|
||||
# get rid of any weird characters
|
||||
$port =~ s/[^\d\/,()\w]+//gi;
|
||||
|
||||
# Translate Cisco 2926,etc. from 1/5 to 1.5
|
||||
$port =~ s/\//\./ if ($port =~ /^\d+\/\d+$/);
|
||||
|
||||
$if{$iid} = $port;
|
||||
$interfaces->{$iid} = $port;
|
||||
}
|
||||
|
||||
return \%if
|
||||
return $interfaces;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -193,7 +163,7 @@ SNMP::Info::Layer2 - Perl5 Interface to network devices serving Layer2 only.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -243,9 +213,7 @@ a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
=item SNMP::Info::Entity
|
||||
|
||||
=back
|
||||
|
||||
@@ -253,21 +221,13 @@ a more specific class using the method above.
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-PRODUCTS-MIB
|
||||
|
||||
Needed for ID of Cisco Products
|
||||
|
||||
=item CISCO-STACK-MIB
|
||||
|
||||
Needed for ID of Cisco Products
|
||||
|
||||
=item Inherited Classes
|
||||
|
||||
MIBs required by the inherited classes listed above.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
MIBs can be found in netdisco-mibs package.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
@@ -300,13 +260,9 @@ See documentation in SNMP::Info for details.
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
=head2 Globals imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
|
||||
=head1 TABLE METHODS
|
||||
|
||||
@@ -339,12 +295,8 @@ See documentation in SNMP::Info for details.
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
=head2 Table Methods imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::Aironet
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Aironet;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
@@ -38,20 +38,23 @@ use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::Entity;
|
||||
use SNMP::Info::EtherLike;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CDP;
|
||||
|
||||
@SNMP::Info::Layer2::Aironet::ISA = qw/SNMP::Info::Layer2 SNMP::Info::Entity SNMP::Info::EtherLike
|
||||
SNMP::Info::CiscoVTP Exporter/;
|
||||
SNMP::Info::CiscoStats SNMP::Info::CiscoVTP SNMP::Info::CDP Exporter/;
|
||||
@SNMP::Info::Layer2::Aironet::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
# Set for No CDP
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
%SNMP::Info::EtherLike::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'serial' => 'entPhysicalSerialNum.1',
|
||||
'descr' => 'sysDescr'
|
||||
);
|
||||
@@ -59,20 +62,30 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%FUNCS = (%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
%SNMP::Info::EtherLike::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'i_ssidlist' => 'cd11IfAuxSsid',
|
||||
'i_ssidbcast' => 'cd11IfAuxSsidBroadcastSsid',
|
||||
'i_80211channel' => 'cd11IfPhyDsssCurrentChannel',
|
||||
);
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
%SNMP::Info::EtherLike::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
'CISCO-DOT11-IF-MIB' => 'cd11IfAuxSsid',
|
||||
);
|
||||
|
||||
%MUNGE = (%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
%SNMP::Info::EtherLike::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
);
|
||||
|
||||
|
||||
@@ -124,7 +137,7 @@ SNMP::Info::Layer2::Aironet - SNMP Interface to Cisco Aironet devices running IO
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::Allied
|
||||
# Max Baker <max@warped.org>, Dmitry Sergienko <dmitry@trifle.net>
|
||||
# Max Baker, Dmitry Sergienko <dmitry@trifle.net>
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# All rights reserved.
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Allied;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
@@ -119,10 +119,10 @@ sub i_up {
|
||||
my $allied = shift;
|
||||
|
||||
my $i_up = SNMP::Info::Layer1::i_up($allied);
|
||||
my $i_up2 = $allied->i_up2();
|
||||
#my $i_up2 = $allied->i_up2() || {};
|
||||
|
||||
foreach my $port (keys %$ati_up){
|
||||
my $up = $ati_up->{$port};
|
||||
foreach my $port (keys %$i_up){
|
||||
my $up = $i_up->{$port};
|
||||
$i_up->{$port} = 'down' if $up eq 'linktesterror';
|
||||
$i_up->{$port} = 'up' if $up eq 'nolinktesterror';
|
||||
}
|
||||
@@ -138,7 +138,7 @@ SNMP::Info::Layer2::Allied - SNMP Interface to Allied Telesyn switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker, Dmitry Sergienko <dmitry@trifle.net>
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
420
Info/Layer2/Aruba.pm
Normal file
420
Info/Layer2/Aruba.pm
Normal file
@@ -0,0 +1,420 @@
|
||||
# SNMP::Info::Layer2::Aruba
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2005 Eric Miller
|
||||
#
|
||||
# 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::Aruba;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
|
||||
@SNMP::Info::Layer2::Aruba::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer2::Aruba::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'WLSX-SWITCH-MIB' => 'wlsxHostname',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
'i_index2' => 'ifIndex',
|
||||
'i_name2' => 'ifName',
|
||||
# WLSX-SWITCH-MIB::wlsxSwitchAccessPointTable
|
||||
# Table index leafs do not return information
|
||||
# therefore unable to use apESSID. We extract
|
||||
# the information from the IID instead.
|
||||
#'aruba_ap_essid' => 'apESSID',
|
||||
'aruba_ap_name' => 'apLocation',
|
||||
'aruba_ap_ip' => 'apIpAddress',
|
||||
# WLSX-SWITCH-MIB::wlsxSwitchStationMgmtTable
|
||||
# Table index leafs do not return information
|
||||
# therefore unable to use staAccessPointBSSID
|
||||
# or staPhyAddress. We extract the information from
|
||||
# the IID instead.
|
||||
#'fw_port' => 'staAccessPointBSSID',
|
||||
#'fw_mac' => 'staPhyAddress',
|
||||
'fw_user' => 'staUserName',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
);
|
||||
|
||||
sub layers {
|
||||
return '00000011';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'airos';
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'aruba';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $aruba = shift;
|
||||
my $descr = $aruba->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
if ($descr =~ m/Version\s+(\d+\.\d+\.\d+\.\d+)/){
|
||||
return $1;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $aruba = shift;
|
||||
my $id = $aruba->id();
|
||||
return undef unless defined $id;
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
# Thin APs do not support ifMIB requirement
|
||||
|
||||
sub i_index {
|
||||
my $aruba = shift;
|
||||
my $i_index = $aruba->i_index2();
|
||||
my $ap_index = $aruba->aruba_ap_name();
|
||||
|
||||
my %if_index;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
$if_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# Get Attached APs as Interfaces
|
||||
foreach my $ap_id (keys %$ap_index){
|
||||
# Convert the 0.254.123.456 index entry to a MAC address.
|
||||
my $mac = join(':',map {sprintf("%02x",$_)} split(/\./,$ap_id));
|
||||
|
||||
$if_index{$ap_id} = $mac;
|
||||
}
|
||||
return \%if_index;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $aruba = shift;
|
||||
my $i_index = $aruba->i_index();
|
||||
my $i_descr = $aruba->i_description();
|
||||
|
||||
my %if;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index =~ /^\d+$/ ) {
|
||||
# Replace the Index with the ifDescr field.
|
||||
my $port = $i_descr->{$iid};
|
||||
next unless defined $port;
|
||||
$if{$iid} = $port;
|
||||
}
|
||||
|
||||
elsif ($index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/) {
|
||||
$if{$index} = $index;
|
||||
}
|
||||
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%if;
|
||||
}
|
||||
|
||||
sub i_name {
|
||||
my $aruba = shift;
|
||||
my $i_index = $aruba->i_index();
|
||||
my $i_name2 = $aruba->i_name2();
|
||||
my $ap_name = $aruba->aruba_ap_name();
|
||||
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index =~ /^\d+$/ ) {
|
||||
my $name = $i_name2->{$iid};
|
||||
next unless defined $name;
|
||||
$i_name{$index} = $name;
|
||||
}
|
||||
|
||||
elsif ($index =~ /(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}/) {
|
||||
my $name = $ap_name->{$iid};
|
||||
next unless defined $name;
|
||||
$i_name{$index} = $name;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%i_name;
|
||||
}
|
||||
|
||||
# Wireless switches do not support the standard Bridge MIB
|
||||
sub bp_index {
|
||||
my $aruba = shift;
|
||||
my $i_index = $aruba->i_index2();
|
||||
my $ap_index = $aruba->aruba_ap_name();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
$bp_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# Get Attached APs as Interfaces
|
||||
foreach my $ap_id (keys %$ap_index){
|
||||
# Convert the 0.254.123.456 index entry to a MAC address.
|
||||
my $mac = join(':',map {sprintf("%02x",$_)} split(/\./,$ap_id));
|
||||
|
||||
$bp_index{$mac} = $mac;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
sub fw_port {
|
||||
my $aruba = shift;
|
||||
my $fw_idx = $aruba->fw_user();
|
||||
|
||||
my %fw_port;
|
||||
foreach my $iid (keys %$fw_idx){
|
||||
if ($iid =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/) {
|
||||
my $port = join(':',map {sprintf("%02x",$_)} split(/\./,$2));
|
||||
$fw_port{$iid} = $port;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%fw_port;
|
||||
}
|
||||
|
||||
sub fw_mac {
|
||||
my $aruba = shift;
|
||||
my $fw_idx = $aruba->fw_user();
|
||||
|
||||
my %fw_mac;
|
||||
foreach my $iid (keys %$fw_idx){
|
||||
if ($iid =~ /(\d+\.\d+\.\d+\.\d+\.\d+\.\d+).(\d+\.\d+\.\d+\.\d+\.\d+\.\d+)/) {
|
||||
my $mac = join(':',map {sprintf("%02x",$_)} split(/\./,$1));
|
||||
$fw_mac{$iid} = $mac;
|
||||
}
|
||||
else {
|
||||
next;
|
||||
}
|
||||
}
|
||||
return \%fw_mac;
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::Aruba - SNMP Interface to Aruba wireless switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
my $aruba = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $aruba->class();
|
||||
print " Using device sub class : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::Layer2::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.
|
||||
|
||||
This class emulates bridge functionality for the wireless switch. This enables
|
||||
end station MAC addresses collection and correlation to the thin access point
|
||||
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(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item WLSX-SWITCH-MIB
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See SNMP::Info for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Bridge for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $aruba->model()
|
||||
|
||||
Returns model type. Cross references $aruba->id() with product IDs in the
|
||||
Aruba MIB.
|
||||
|
||||
=item $aruba->vendor()
|
||||
|
||||
Returns 'aruba'
|
||||
|
||||
=item $aruba->os()
|
||||
|
||||
Returns 'airos'
|
||||
|
||||
=item $aruba->os_ver()
|
||||
|
||||
Returns the software version extracted from B<sysDescr>
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $aruba->layers()
|
||||
|
||||
Returns 00000011. Class emulates Layer 2 functionality for Thin APs through
|
||||
proprietary MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $aruba->i_index()
|
||||
|
||||
Returns reference to map of IIDs to Interface index.
|
||||
|
||||
Extends ifIndex to support thin APs as device interfaces.
|
||||
|
||||
=item $aruba->interfaces()
|
||||
|
||||
Returns reference to map of IIDs to ports. Thin APs are implemented as device
|
||||
interfaces. The thin AP MAC address is used as the port identifier.
|
||||
|
||||
=item $aruba->i_name()
|
||||
|
||||
Interface name. Returns (B<ifName>) for Ethernet interfaces and (B<apLocation>)
|
||||
for thin AP interfaces.
|
||||
|
||||
=item $aruba->bp_index()
|
||||
|
||||
Simulates bridge MIB by returning reference to a hash containing the index for
|
||||
both the keys and values.
|
||||
|
||||
=item $aruba->fw_port()
|
||||
|
||||
(B<staAccessPointBSSID>) as extracted from the IID.
|
||||
|
||||
=item $aruba->fw_mac()
|
||||
|
||||
(B<staPhyAddress>) as extracted from the IID.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Aruba Switch AP Table (B<wlsxSwitchAccessPointTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $aruba->aruba_ap_name()
|
||||
|
||||
(B<apLocation>)
|
||||
|
||||
=item $aruba->aruba_ap_ip()
|
||||
|
||||
(B<apIpAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Aruba Switch Station Management Table (B<wlsxSwitchStationMgmtTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $aruba->fw_user()
|
||||
|
||||
(B<staUserName>)
|
||||
|
||||
=cut
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::Bay
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
# This module depricated. See Layer2::BayStack
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
@@ -31,7 +31,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Bay;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
@@ -273,7 +273,7 @@ SNMP::Info::Layer2::Bay - SNMP Interface to old Bay Network BayStack Switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer2::Baystack
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2004-6 Max Baker changes from version 0.8 and beyond.
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Baystack;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
@@ -57,7 +57,7 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::SONMP::GLOBALS,
|
||||
%SNMP::Info::RapidCity::GLOBALS,
|
||||
%SNMP::Info::NortelStack::GLOBALS,
|
||||
%SNMP::Info::NortelStack::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
@@ -65,9 +65,13 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::SONMP::FUNCS,
|
||||
%SNMP::Info::RapidCity::FUNCS,
|
||||
%SNMP::Info::NortelStack::FUNCS,
|
||||
%SNMP::Info::NortelStack::FUNCS,
|
||||
'i_name2' => 'ifName',
|
||||
'i_mac2' => 'ifPhysAddress',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
);
|
||||
|
||||
# 450's report full duplex as speed = 20mbps?!
|
||||
@@ -82,6 +86,7 @@ $SNMP::Info::SPEED_MAP{2_000_000_000} = '1.0 Gbps';
|
||||
%SNMP::Info::RapidCity::MUNGE,
|
||||
%SNMP::Info::NortelStack::MUNGE,
|
||||
'i_mac2' => \&SNMP::Info::munge_mac,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
sub os {
|
||||
@@ -89,7 +94,7 @@ sub os {
|
||||
my $descr = $baystack->description();
|
||||
my $model = $baystack->model();
|
||||
|
||||
if ((defined $model and $model =~ /(470|460|BPS|5510|5520)/) and (defined $descr and $descr =~ m/SW:v[3-5]/i)) {
|
||||
if ((defined $model and $model =~ /(470|460|BPS|5510|5520|5530)/) and (defined $descr and $descr =~ m/SW:v[3-5]/i)) {
|
||||
return 'boss';
|
||||
}
|
||||
return 'baystack';
|
||||
@@ -126,23 +131,13 @@ sub model {
|
||||
return undef unless defined $id;
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
$model =~ s/^sreg-//i;
|
||||
|
||||
my $descr = $baystack->description();
|
||||
|
||||
return '303' if (defined $descr and $descr =~ /\D303\D/);
|
||||
return '304' if (defined $descr and $descr =~ /\D304\D/);
|
||||
return '350' if ($model =~ /BayStack350/);
|
||||
return '380' if ($model =~ /BayStack380/);
|
||||
return '410' if ($model =~ /BayStack410/);
|
||||
return '420' if ($model =~ /BayStack420/);
|
||||
return '425' if ($model =~ /BayStack425/);
|
||||
return '450' if ($model =~ /BayStack450/);
|
||||
return '470' if ($model =~ /BayStack470/i);
|
||||
return '460' if ($model =~ /BayStack460/i);
|
||||
return 'BPS' if ($model =~ /BPS2000/i);
|
||||
return '5510' if ($model =~ /BayStack5510/i);
|
||||
return '5520' if ($model =~ /BayStack5520/i);
|
||||
return $2 if ($model =~ /(ES|ERS|BayStack|EthernetRoutingSwitch|EthernetSwitch)(\d+)/);
|
||||
|
||||
return $model;
|
||||
}
|
||||
@@ -173,8 +168,8 @@ sub interfaces {
|
||||
# Ignore cascade ports
|
||||
next if $index > 513;
|
||||
|
||||
my $port = ($index % $index_factor);
|
||||
my $slot = (int($index / $index_factor)) + $slot_offset;
|
||||
my $port = ($index % $index_factor);
|
||||
my $slot = (int($index / $index_factor)) + $slot_offset;
|
||||
|
||||
my $slotport = "$slot.$port";
|
||||
$if{$iid} = $slotport;
|
||||
@@ -234,12 +229,11 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::Baystack - SNMP Interface to Nortel Networks' Baystack Switches
|
||||
SNMP::Info::Layer2::Baystack - SNMP Interface to Nortel Ethernet (Baystack) Switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>),
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -259,8 +253,8 @@ Eric Miller (C<eric@jeneric.org>)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a Nortel Networks'
|
||||
Baystack device through SNMP.
|
||||
Provides abstraction to the configuration information obtainable from a Nortel
|
||||
Ethernet Switch (Baystack) through SNMP.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
@@ -309,19 +303,22 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=item $baystack->vendor()
|
||||
|
||||
Returns 'Nortel'
|
||||
Returns 'nortel'
|
||||
|
||||
=item $baystack->model()
|
||||
|
||||
Cross references $baystack->id() to the SYNOPTICS-MIB and returns
|
||||
the results. 303s and 304s have the same ID, so we have a hack
|
||||
to return depending on which it is.
|
||||
to return depending on which it is.
|
||||
|
||||
Removes sreg- from the model name
|
||||
Returns BPS for Business Policy Switch
|
||||
|
||||
For BayStack, EthernetRoutingSwitch, or EthernetSwitch extracts and returns
|
||||
the switch numeric designation.
|
||||
|
||||
=item $baystack->os()
|
||||
|
||||
Returns 'Baystack' or 'BoSS' depending on software version.
|
||||
Returns 'baystack' or 'boss' depending on software version.
|
||||
|
||||
=item $baystack->os_bin()
|
||||
|
||||
@@ -339,7 +336,7 @@ Required by SNMP::Info::SONMP. Number representing the number of ports
|
||||
reserved per slot within the device MIB.
|
||||
|
||||
Index factor on the Baystack switches are determined by the formula: Index
|
||||
Factor = 64 if (model = 470 or (os eq 'BoSS' and operating in pure mode))
|
||||
Factor = 64 if (model = 470 or (os eq 'boss' and operating in pure mode))
|
||||
or else Index factor = 32.
|
||||
|
||||
Returns either 32 or 64 based upon the formula.
|
||||
@@ -403,6 +400,30 @@ Crosses ifName with ifAlias and returns the human set port name if exists.
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
=over
|
||||
|
||||
=item $baystack->at_index()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to Interface IIDs
|
||||
|
||||
(B<ipNetToMediaIfIndex>)
|
||||
|
||||
=item $baystack->at_paddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to MAC addresses.
|
||||
|
||||
(B<ipNetToMediaPhysAddress>)
|
||||
|
||||
=item $baystack->at_netaddr()
|
||||
|
||||
Returns reference to hash. Maps ARP table entries to IPs
|
||||
|
||||
(B<ipNetToMediaNetAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::C1900
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,15 +30,18 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::C1900;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
|
||||
@SNMP::Info::Layer2::C1900::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP Exporter/;
|
||||
@SNMP::Info::Layer2::C1900::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CDP SNMP::Info::CiscoStats Exporter/;
|
||||
@SNMP::Info::Layer2::C1900::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
@@ -47,11 +50,15 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'c1900_flash_status' => 'upgradeFlashBankStatus',
|
||||
);
|
||||
|
||||
%FUNCS = (%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'i_type2' => 'ifType',
|
||||
'i_name2' => 'ifName',
|
||||
# ESSWITCH-MIB
|
||||
@@ -68,12 +75,16 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
# Also known as the ESSWITCH-MIB
|
||||
'STAND-ALONE-ETHERNET-SWITCH-MIB' => 'series2000'
|
||||
);
|
||||
|
||||
%MUNGE = (%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
@@ -99,9 +110,8 @@ sub os_ver {
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub cisco_comm_indexing {
|
||||
1;
|
||||
}
|
||||
sub bulkwalk_no { 1; }
|
||||
sub cisco_comm_indexing { 1; }
|
||||
|
||||
sub interfaces {
|
||||
my $c1900 = shift;
|
||||
@@ -210,7 +220,7 @@ SNMP::Info::Layer2::C1900 - Perl5 Interface to SNMP data from Cisco Catlyst 1900
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -270,6 +280,10 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $c1900->bulkwalk_no
|
||||
|
||||
Return C<1>. Bulkwalk is turned off for this class.
|
||||
|
||||
=item $c1900->c1900_flash_status()
|
||||
|
||||
Usually contains the version of the software loaded in flash.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::C2900
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,15 +30,18 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::C2900;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
|
||||
@SNMP::Info::Layer2::C2900::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP Exporter/;
|
||||
@SNMP::Info::Layer2::C2900::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CDP SNMP::Info::CiscoStats Exporter/;
|
||||
@SNMP::Info::Layer2::C2900::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
@@ -47,10 +50,14 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'i_name' => 'ifAlias',
|
||||
# C2900PortEntry
|
||||
'c2900_p_index' => 'c2900PortIfIndex',
|
||||
@@ -61,11 +68,15 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
'CISCO-C2900-MIB' => 'ciscoC2900MIB',
|
||||
);
|
||||
|
||||
%MUNGE = (%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
@@ -125,6 +136,54 @@ sub i_duplex_admin {
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
### we want to be able to set speed on 2900 class switches
|
||||
###
|
||||
### $info->set_i_speed_admin("100", ifIndex);
|
||||
### speed choices are 'auto', '10', '100'
|
||||
###
|
||||
sub set_i_speed_admin {
|
||||
# map speeds to those the switch will understand
|
||||
my %speeds = qw/auto 1 10 10000000 100 100000000/;
|
||||
|
||||
my $c2900 = shift;
|
||||
my ($speed, $iid) = @_;
|
||||
my $c2900_p_index = $c2900->c2900_p_index();
|
||||
my %reverse_2900 = reverse %$c2900_p_index;
|
||||
|
||||
$speed = lc($speed);
|
||||
|
||||
return 0 unless defined $speeds{$speed};
|
||||
|
||||
# account for weirdness of c2900 mib
|
||||
$iid = $reverse_2900{$iid};
|
||||
|
||||
return $c2900->set_c2900_p_speed_admin($speeds{$speed}, $iid);
|
||||
}
|
||||
|
||||
### we want to be able to set duplex on 2900 class switches
|
||||
###
|
||||
### $info->set_i_duplex_admin("half", ifIndex);
|
||||
### duplex choices are 'auto', 'half', 'full'
|
||||
###
|
||||
sub set_i_duplex_admin {
|
||||
# map a textual duplex to an integer one the switch understands
|
||||
my %duplexes = qw/full 1 half 2 auto 3/;
|
||||
|
||||
my $c2900 = shift;
|
||||
my ($duplex, $iid) = @_;
|
||||
my $c2900_p_index = $c2900->c2900_p_index();
|
||||
my %reverse_2900 = reverse %$c2900_p_index;
|
||||
|
||||
$duplex = lc($duplex);
|
||||
|
||||
return 0 unless defined $duplexes{$duplex};
|
||||
|
||||
# account for weirdness of c2900 mib
|
||||
$iid = $reverse_2900{$iid};
|
||||
|
||||
return $c2900->set_c2900_p_duplex_admin($duplexes{$duplex}, $iid);
|
||||
}
|
||||
|
||||
# Use i_descritption for port key, cuz i_name can be manually entered.
|
||||
sub interfaces {
|
||||
my $c2900 = shift;
|
||||
@@ -154,7 +213,7 @@ SNMP::Info::Layer2::C2900 - SNMP Interface to Cisco Catalyst 2900 Switches runni
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -262,7 +321,34 @@ to a hash.
|
||||
Returns reference to hash of IIDs to admin duplex setting
|
||||
|
||||
Crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex_admin;
|
||||
|
||||
|
||||
=item $c2900->set_i_speed_admin(speed, ifIndex)
|
||||
|
||||
Sets port speed, must be supplied with speed and port ifIndex
|
||||
|
||||
Speed choices are 'auto', '10', '100'
|
||||
|
||||
Crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex_admin to
|
||||
utilize port ifIndex.
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$c2900->interfaces()};
|
||||
$c2900->set_i_speed_admin('auto', $if_map{'FastEthernet0/1'})
|
||||
or die "Couldn't change port speed. ",$c2900->error(1);
|
||||
|
||||
=item $c2900->set_i_duplex_admin(duplex, ifIndex)
|
||||
|
||||
Sets port duplex, must be supplied with duplex and port ifIndex
|
||||
|
||||
Speed choices are 'auto', 'half', 'full'
|
||||
|
||||
Crosses $c2900->c2900_p_index() with $c2900->c2900_p_duplex_admin to
|
||||
utilize port ifIndex.
|
||||
|
||||
Example:
|
||||
my %if_map = reverse %{$c2900->interfaces()};
|
||||
$c2900->set_i_duplex_admin('auto', $if_map{'FastEthernet0/1'})
|
||||
or die "Couldn't change port duplex. ",$c2900->error(1);
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer2::Catalyst
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# Copyright (c) 2003,2004 Max Baker changes from version 0.8 and beyond
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Catalyst;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -38,41 +38,53 @@ use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CiscoStack;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
|
||||
@SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::CiscoStack SNMP::Info::Layer2
|
||||
SNMP::Info::CiscoVTP Exporter/;
|
||||
@SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::Layer2 SNMP::Info::CiscoStack
|
||||
SNMP::Info::CiscoVTP SNMP::Info::CDP SNMP::Info::CiscoStats Exporter/;
|
||||
@SNMP::Info::Layer2::Catalyst::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStack::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStack::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CiscoStack::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
);
|
||||
|
||||
# Need to specify this or it might grab the ones out of L2 instead of CiscoStack
|
||||
*SNMP::Info::Layer2::Catalyst::serial = \&SNMP::Info::CiscoStack::serial;
|
||||
*SNMP::Info::Layer2::Catalyst::interfaces = \&SNMP::Info::CiscoStack::interfaces;
|
||||
*SNMP::Info::Layer2::Catalyst::i_duplex = \&SNMP::Info::CiscoStack::i_duplex;
|
||||
*SNMP::Info::Layer2::Catalyst::i_type = \&SNMP::Info::CiscoStack::i_type;
|
||||
*SNMP::Info::Layer2::Catalyst::i_name = \&SNMP::Info::CiscoStack::i_name;
|
||||
*SNMP::Info::Layer2::Catalyst::i_duplex_admin = \&SNMP::Info::CiscoStack::i_duplex_admin;
|
||||
|
||||
# Overidden Methods
|
||||
|
||||
# i_physical sets a hash entry as true if the iid is a physical port
|
||||
@@ -110,6 +122,23 @@ sub os_ver {
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Workaround for incomplete bp_index
|
||||
sub bp_index {
|
||||
my $cat = shift;
|
||||
my $p_index = $cat->p_port();
|
||||
my $b_index = $cat->p_oidx();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$p_index){
|
||||
my $ifidx = $p_index->{$iid};
|
||||
next unless defined $ifidx;
|
||||
my $bpidx = $b_index->{$iid}||0;
|
||||
|
||||
$bp_index{$bpidx} = $ifidx;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
sub cisco_comm_indexing {
|
||||
1;
|
||||
}
|
||||
@@ -119,11 +148,11 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::Catalyst - Perl5 Interface to Cisco Catalyst 5000 series devices.
|
||||
SNMP::Info::Layer2::Catalyst - Perl5 Interface to Cisco Catalyst devices running Catalyst OS.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -143,15 +172,16 @@ Max Baker (C<max@warped.org>)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info subclass to provide information for Cisco Catalyst 5000 series switches running CatOS.
|
||||
SNMP::Info subclass to provide information for Cisco Catalyst series switches running CatOS.
|
||||
|
||||
This class includes the Catalyst 2920, 4000, 5000, 6000 (hybrid mode) families.
|
||||
|
||||
This subclass is not for all devices that have the name Catalyst. Note that some Catalyst
|
||||
switches run IOS, like the 2900 and 3550 families. Cisco Catalyst 1900 switches use their
|
||||
own MIB and have a separate subclass. Use the method above to have SNMP::Info determine the
|
||||
appropriate subclass before using this class directly.
|
||||
|
||||
This class includes the Catalyst 2950 series devices, which fall under the
|
||||
Catalyst 5000 family.
|
||||
See SNMP::Info::device_type() for specifics.
|
||||
|
||||
Note: Some older Catalyst switches will only talk SNMP version 1. Some newer ones will not
|
||||
return all their data if connected via Version 1.
|
||||
@@ -227,6 +257,19 @@ See documentation in SNMP::Info::CiscoStack for details.
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $cat->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface identifier (iid)
|
||||
|
||||
Crosses (B<portCrossIndex>) to (B<portIfIndex>) since some devices seem to have
|
||||
problems with BRIDGE-MIB
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
@@ -235,7 +278,7 @@ See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
See documentation in SNMP::Info::Layer2 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2::CiscoSTack
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2::CiscoStack
|
||||
|
||||
See documentation in SNMP::Info::Layer2::CiscoStack for details.
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer2::Centillion
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Centillion;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -248,7 +248,7 @@ SNMP::Info::Layer2::Centillion - SNMP Interface to Nortel Centillion based ATM S
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
299
Info/Layer2/Foundry.pm
Normal file
299
Info/Layer2/Foundry.pm
Normal file
@@ -0,0 +1,299 @@
|
||||
# SNMP::Info::Layer2::Foundry - SNMP Interface to Foundry Switches
|
||||
#
|
||||
# Copyright (c) 2005 Max Baker
|
||||
#
|
||||
# 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::Foundry;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::FDP;
|
||||
use SNMP::Info::EtherLike;
|
||||
use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer2::Foundry::ISA = qw/SNMP::Info::Layer2 SNMP::Info::FDP SNMP::Info::EtherLike
|
||||
SNMP::Info::MAU Exporter/;
|
||||
@SNMP::Info::Layer2::Foundry::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::FDP::MIBS,
|
||||
%SNMP::Info::EtherLike::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
'FOUNDRY-SN-ROOT-MIB' => 'foundry',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::FDP::GLOBALS,
|
||||
%SNMP::Info::EtherLike::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::FDP::FUNCS,
|
||||
%SNMP::Info::EtherLike::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
'test' => 'dot1dStpPortState',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::FDP::MUNGE,
|
||||
%SNMP::Info::EtherLike::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
);
|
||||
|
||||
|
||||
# Method OverRides
|
||||
|
||||
#sub bulkwalk_no { 1;}
|
||||
|
||||
*SNMP::Info::Layer2::Foundry::i_duplex = \&SNMP::Info::MAU::mau_i_duplex;
|
||||
*SNMP::Info::Layer2::Foundry::i_duplex_admin = \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
*SNMP::Info::Layer2::Foundry::i_vlan = \&SNMP::Info::Bridge::qb_i_vlan_t;
|
||||
|
||||
# todo doc these
|
||||
|
||||
sub os_ver {
|
||||
my $foundry = shift;
|
||||
|
||||
my $e_name = $foundry->e_name();
|
||||
|
||||
# find entity table entry for "stackmanaget.1"
|
||||
my $unit_iid = undef;
|
||||
foreach my $e (keys %$e_name){
|
||||
my $name = $e_name->{$e} || '';
|
||||
$unit_iid = $e if $name eq 'stackmanaget.1';
|
||||
}
|
||||
|
||||
# Default to OID method if no dice.
|
||||
unless (defined $unit_iid){
|
||||
return $foundry->SUPER::model();
|
||||
}
|
||||
|
||||
# Find Model Name
|
||||
my $e_fwver = $foundry->e_fwver();
|
||||
if (defined $e_fwver->{$unit_iid}){
|
||||
return $e_fwver->{$unit_iid};
|
||||
}
|
||||
|
||||
# Not found in ENTITY-MIB, go up a level.
|
||||
return $foundry->SUPER::os_ver();
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $foundry = shift;
|
||||
|
||||
my $e_name = $foundry->e_name();
|
||||
|
||||
# find entity table entry for "unit.1"
|
||||
my $unit_iid = undef;
|
||||
foreach my $e (keys %$e_name){
|
||||
my $name = $e_name->{$e} || '';
|
||||
$unit_iid = $e if $name eq 'unit.1';
|
||||
}
|
||||
|
||||
# Default to OID method if no dice.
|
||||
unless (defined $unit_iid){
|
||||
return $foundry->SUPER::model();
|
||||
}
|
||||
|
||||
# Find Model Name
|
||||
my $e_model = $foundry->e_model();
|
||||
if (defined $e_model->{$unit_iid}){
|
||||
return $e_model->{$unit_iid};
|
||||
}
|
||||
|
||||
# Not found in ENTITY-MIB, go up a level.
|
||||
return $foundry->SUPER::model();
|
||||
|
||||
}
|
||||
|
||||
sub serial {
|
||||
my $foundry = shift;
|
||||
|
||||
my $e_name = $foundry->e_name();
|
||||
|
||||
# find entity table entry for "unit.1"
|
||||
my $unit_iid = undef;
|
||||
foreach my $e (keys %$e_name){
|
||||
my $name = $e_name->{$e} || '';
|
||||
$unit_iid = $e if $name eq 'unit.1';
|
||||
}
|
||||
return undef unless defined $unit_iid;
|
||||
|
||||
# Look up serial of found entry.
|
||||
my $e_serial = $foundry->e_serial();
|
||||
return $e_serial->{$unit_iid} if defined $e_serial->{$unit_iid};
|
||||
|
||||
return $foundry->SUPER::serial();
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $foundry = shift;
|
||||
my $i_descr = $foundry->i_description;
|
||||
my $i_name = $foundry->i_name;
|
||||
|
||||
# use ifName only if it is in portn
|
||||
# format. For EdgeIrons
|
||||
# else use ifDescr
|
||||
foreach my $iid (keys %$i_name){
|
||||
my $name = $i_name->{$iid};
|
||||
next unless defined $name;
|
||||
$i_descr->{$iid} = $name
|
||||
if $name =~ /^port\d+/i;
|
||||
}
|
||||
|
||||
return $i_descr;
|
||||
}
|
||||
|
||||
sub i_ignore {
|
||||
my $foundry = shift;
|
||||
my $i_type = $foundry->i_type();
|
||||
|
||||
my %i_ignore = ();
|
||||
|
||||
foreach my $iid (keys %$i_type){
|
||||
my $type = $i_type->{$iid} || '';
|
||||
$i_ignore{$iid}++
|
||||
# 33 is the console port
|
||||
if $type =~ /(loopback|propvirtual|other|cpu|33)/i;
|
||||
}
|
||||
return \%i_ignore;
|
||||
}
|
||||
|
||||
|
||||
sub os {
|
||||
return 'foundry';
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'foundry';
|
||||
}
|
||||
|
||||
# this hangs on a edgeiron24g
|
||||
# TODO: check by devicetype and deferr to SUPER if not bad device
|
||||
sub stp_p_state { undef; }
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::Foundry - Perl5 Interface to Foundry FastIron Network Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $foundry = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 1
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $foundry->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This module provides support for Foundry EdgeIron Switches
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer2
|
||||
|
||||
=item SNMP::Info::FDP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item FOUNDRY-SN-ROOT-MIB
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See classes listed above for their required MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item todo
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in SNMP::Info::Layer2 for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::FDP
|
||||
|
||||
See documentation in SNMP::Info::FDP for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item todo2
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
|
||||
See documentation in SNMP::Info::Layer2 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::FDP
|
||||
|
||||
See documentation in SNMP::Info::FDP for details.
|
||||
|
||||
=cut
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer2::HP - SNMP Interface to HP ProCurve Switches
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2004,2005 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# All rights reserved.
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::HP;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -39,18 +39,18 @@ use Exporter;
|
||||
use SNMP::Info::Layer2;
|
||||
use SNMP::Info::MAU;
|
||||
use SNMP::Info::Entity;
|
||||
use SNMP::Info::CDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE $INIT/ ;
|
||||
|
||||
@SNMP::Info::Layer2::HP::ISA = qw/SNMP::Info::Layer2 SNMP::Info::MAU SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer2::HP::ISA = qw/SNMP::Info::Layer2 SNMP::Info::MAU SNMP::Info::Entity
|
||||
SNMP::Info::CDP Exporter/;
|
||||
@SNMP::Info::Layer2::HP::EXPORT_OK = qw//;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer2::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
'RFC1271-MIB' => 'logDescription',
|
||||
'HP-ICF-OID' => 'hpSwitch4000',
|
||||
'HP-VLAN' => 'hpVlanMemberIndex',
|
||||
@@ -62,6 +62,7 @@ $INIT = 0;
|
||||
%SNMP::Info::Layer2::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
'serial1' => 'entPhysicalSerialNum.1',
|
||||
'hp_cpu' => 'hpSwitchCpuStat.0',
|
||||
'hp_mem_total' => 'hpGlobalMemTotalBytes.1',
|
||||
@@ -77,6 +78,8 @@ $INIT = 0;
|
||||
%SNMP::Info::Layer2::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
'bp_index2' => 'dot1dBasePortIfIndex',
|
||||
'i_type2' => 'ifType',
|
||||
# RFC1271
|
||||
'l_descr' => 'logDescription',
|
||||
@@ -95,7 +98,8 @@ $INIT = 0;
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer2::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE
|
||||
);
|
||||
|
||||
%MODEL_MAP = (
|
||||
@@ -108,26 +112,40 @@ $INIT = 0;
|
||||
'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',
|
||||
'J8718A' => '5404yl',
|
||||
'J8719A' => '5408yl',
|
||||
);
|
||||
|
||||
# Method Overrides
|
||||
|
||||
*SNMP::Info::Layer2::HP::i_duplex = \&SNMP::Info::MAU::mau_i_duplex;
|
||||
*SNMP::Info::Layer2::HP::i_duplex_admin = \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
|
||||
sub cpu {
|
||||
my $hp = shift;
|
||||
return $hp->hp_cpu();
|
||||
@@ -282,125 +300,57 @@ sub slots {
|
||||
#
|
||||
#}
|
||||
|
||||
sub i_duplex {
|
||||
my $hp = shift;
|
||||
|
||||
my $mau_index = $hp->mau_index();
|
||||
my $mau_link = $hp->mau_link();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $mau_port (keys %$mau_link){
|
||||
my $iid = $mau_index->{$mau_port};
|
||||
next unless defined $iid;
|
||||
|
||||
my $linkoid = $mau_link->{$mau_port};
|
||||
my $link = &SNMP::translateObj($linkoid);
|
||||
next unless defined $link;
|
||||
|
||||
my $duplex = undef;
|
||||
|
||||
if ($link =~ /fd$/i) {
|
||||
$duplex = 'full';
|
||||
} elsif ($link =~ /hd$/i){
|
||||
$duplex = 'half';
|
||||
}
|
||||
|
||||
$i_duplex{$iid} = $duplex if defined $duplex;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
|
||||
|
||||
sub i_duplex_admin {
|
||||
my $hp = shift;
|
||||
|
||||
my $interfaces = $hp->interfaces();
|
||||
my $mau_index = $hp->mau_index();
|
||||
my $mau_auto = $hp->mau_auto();
|
||||
my $mau_autostat = $hp->mau_autostat();
|
||||
my $mau_typeadmin = $hp->mau_type_admin();
|
||||
my $mau_autosent = $hp->mau_autosent();
|
||||
|
||||
my %mau_reverse = reverse %$mau_index;
|
||||
|
||||
my %i_duplex_admin;
|
||||
foreach my $iid (keys %$interfaces){
|
||||
my $mau_index = $mau_reverse{$iid};
|
||||
next unless defined $mau_index;
|
||||
|
||||
my $autostat = $mau_autostat->{$mau_index};
|
||||
|
||||
# HP25xx has this value
|
||||
if (defined $autostat and $autostat =~ /enabled/i){
|
||||
$i_duplex_admin{$iid} = 'auto';
|
||||
next;
|
||||
}
|
||||
|
||||
my $type = $mau_autosent->{$mau_index};
|
||||
|
||||
next unless defined $type;
|
||||
|
||||
if ($type == 0) {
|
||||
$i_duplex_admin{$iid} = 'none';
|
||||
next;
|
||||
}
|
||||
|
||||
my $full = $hp->_isfullduplex($type);
|
||||
my $half = $hp->_ishalfduplex($type);
|
||||
|
||||
if ($full and !$half){
|
||||
$i_duplex_admin{$iid} = 'full';
|
||||
} elsif ($half) {
|
||||
$i_duplex_admin{$iid} = 'half';
|
||||
}
|
||||
}
|
||||
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
sub i_vlan {
|
||||
my $hp = shift;
|
||||
|
||||
my $interfaces = $hp->interfaces();
|
||||
|
||||
# Newer devices use Q-BRIDGE-MIB
|
||||
my $qb_i_vlan = $hp->qb_i_vlan();
|
||||
my $qb_i_vlan_type = $hp->qb_i_vlan_type();
|
||||
|
||||
my $i_vlan = {};
|
||||
|
||||
foreach my $if (keys %$qb_i_vlan){
|
||||
my $vlan = $qb_i_vlan->{$if};
|
||||
my $tagged = $qb_i_vlan_type->{$if};
|
||||
$tagged = (defined $tagged and $tagged eq 'admitOnlyVlanTagged') ? 1 : 0;
|
||||
next unless defined $vlan;
|
||||
$i_vlan->{$if}= $tagged ? 'trunk' : $vlan;
|
||||
my $qb_i_vlan = $hp->qb_i_vlan_t();
|
||||
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
|
||||
unless (defined $qb_i_vlan and scalar(keys %$qb_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 $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;
|
||||
$vlan = 'Trunk' if $tag eq 'tagged';
|
||||
$vlan = 'Auto' if $tag eq 'auto';
|
||||
undef $vlan if $tag eq 'no';
|
||||
my $tag = $hp_v_if_tag->{$row};
|
||||
my $vlan = $hp_v_index->{$index};
|
||||
|
||||
next unless defined $tag;
|
||||
$vlan = 'Trunk' if $tag eq 'tagged';
|
||||
$vlan = 'Auto' if $tag eq 'auto';
|
||||
undef $vlan if $tag eq 'no';
|
||||
|
||||
|
||||
$i_vlan->{$if} = $vlan if defined $vlan;
|
||||
}
|
||||
|
||||
$i_vlan->{$if} = $vlan if defined $vlan;
|
||||
}
|
||||
|
||||
return $i_vlan;
|
||||
}
|
||||
|
||||
# Bridge MIB does not map Bridge Port to ifIndex correctly on all models
|
||||
sub bp_index {
|
||||
my $hp = shift;
|
||||
my $if_index = $hp->i_index();
|
||||
my $model = $hp->model();
|
||||
my $bp_index = $hp->bp_index2();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -410,7 +360,7 @@ SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -513,14 +463,43 @@ Returns the model number of the HP Switch. Will translate between the HP Part n
|
||||
the common model number with this map :
|
||||
|
||||
%MODEL_MAP = (
|
||||
'J4812A' => '2512',
|
||||
'J4819A' => '5308XL',
|
||||
'J4813A' => '2524',
|
||||
'J4805A' => '5304XL',
|
||||
'J4815A' => '3324XL',
|
||||
'J4865A' => '4108GL',
|
||||
'J4887A' => '4104GL',
|
||||
'J4874A' => '9315',
|
||||
'J4093A' => '2424M',
|
||||
'J4110A' => '8000M',
|
||||
'J4120A' => '1600M',
|
||||
'J4121A' => '4000M',
|
||||
'J4122A' => '2400M',
|
||||
'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',
|
||||
'J8718A' => '5404yl',
|
||||
'J8719A' => '5408yl',
|
||||
|
||||
);
|
||||
|
||||
=item $hp->os()
|
||||
@@ -604,6 +583,13 @@ Looks in Q-BRIDGE-MIB -- see SNMP::Info::Bridge
|
||||
|
||||
and for older devices looks in HP-VLAN.
|
||||
|
||||
=item $hp->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface identifier (iid)
|
||||
|
||||
Returns (B<ifIndex>) for both key and value for 1600, 2424, 4000, and 8000 models
|
||||
since they seem to have problems with BRIDGE-MIB
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer2
|
||||
|
||||
253
Info/Layer2/N2270.pm
Normal file
253
Info/Layer2/N2270.pm
Normal file
@@ -0,0 +1,253 @@
|
||||
# SNMP::Info::Layer2::N2270
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2005 Eric Miller
|
||||
#
|
||||
# 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::N2270;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
use SNMP::Info::SONMP;
|
||||
use SNMP::Info::Airespace;
|
||||
|
||||
@SNMP::Info::Layer2::N2270::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::SONMP SNMP::Info::Airespace Exporter/;
|
||||
@SNMP::Info::Layer2::N2270::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::SONMP::MIBS,
|
||||
%SNMP::Info::Airespace::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::SONMP::GLOBALS,
|
||||
%SNMP::Info::Airespace::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::SONMP::FUNCS,
|
||||
%SNMP::Info::Airespace::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::SONMP::MUNGE,
|
||||
%SNMP::Info::Airespace::MUNGE,
|
||||
);
|
||||
|
||||
sub os {
|
||||
return 'nortel';
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'nortel';
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $n2270 = shift;
|
||||
my $id = $n2270->id();
|
||||
return undef unless defined $id;
|
||||
my $model = &SNMP::translateObj($id);
|
||||
return $id unless defined $model;
|
||||
$model =~ s/^sreg-WLANSecuritySwitch//i;
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub index_factor {
|
||||
return 256;
|
||||
}
|
||||
|
||||
sub slot_offset {
|
||||
return 0;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::N2270 - SNMP Interface to Nortel 2270 Series Wireless Switch
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
#Let SNMP::Info determine the correct subclass for you.
|
||||
|
||||
my $n2270 = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $n2270->class();
|
||||
print " Using device sub class : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a
|
||||
Nortel 2270 Series Wireless Switch through SNMP.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after
|
||||
determining a more specific class using the method above.
|
||||
|
||||
my $n2270 = new SNMP::Info::Layer2::N2270(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=item SNMP::Info::SONMP
|
||||
|
||||
=item SNMP::Info::Airespace
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See SNMP::Info for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Bridge for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::SONMP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Airespace for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $n2270->vendor()
|
||||
|
||||
Returns 'nortel'
|
||||
|
||||
=item $n2270->os()
|
||||
|
||||
Returns 'nortel'
|
||||
|
||||
=item $n2270->model()
|
||||
|
||||
Cross references $bayhub->id() to the SYNOPTICS-ROOT-MIB and returns
|
||||
the results.
|
||||
|
||||
Removes sreg-WLANSecuritySwitch from the model name
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $bayhub->index_factor()
|
||||
|
||||
Required by SNMP::Info::SONMP. Number representing the number of ports
|
||||
reserved per slot within the device MIB. Returns 256.
|
||||
|
||||
=item $bayhub->slot_offset()
|
||||
|
||||
Required by SNMP::Info::SONMP. Offset if slot numbering does not
|
||||
start at 0. Returns 0.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::SONMP
|
||||
|
||||
See documentation in SNMP::Info::SONMP for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::Airespace
|
||||
|
||||
See documentation in SNMP::Info::Airespace for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item None
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::SONMP
|
||||
|
||||
See documentation in SNMP::Info::SONMP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Airespace
|
||||
|
||||
See documentation in SNMP::Info::Airespace for details.
|
||||
|
||||
=cut
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer2::NAP222x
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::NAP222x;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
@@ -284,7 +284,7 @@ SNMP::Info::Layer2::nap222x - SNMP Interface to Nortel 2220 Series Access Points
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer2::Orinoco
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004-6 Eric Miller
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::Orinoco;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
@@ -95,7 +95,7 @@ sub os_bin {
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'Proxim';
|
||||
return 'proxim';
|
||||
}
|
||||
|
||||
sub model {
|
||||
@@ -103,8 +103,7 @@ sub model {
|
||||
my $descr = $orinoco->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
return 'AP-1000' if ($descr =~ /AP-1000/);
|
||||
return 'AP-2000' if ($descr =~ /AP-2000/);
|
||||
return $1 if ($descr =~ /(AP-\d+)/);
|
||||
return 'WavePOINT-II' if ($descr =~ /WavePOINT-II/);
|
||||
return undef;
|
||||
}
|
||||
@@ -158,7 +157,7 @@ SNMP::Info::Layer2::Orinoco - SNMP Interface to Orinoco Series Access Points
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer2::ZyXEL_DSLAM
|
||||
# Dmitry Sergienko <dmitry@trifle.net>
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker <max@warped.org>
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer2::ZyXEL_DSLAM;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
use strict;
|
||||
|
||||
|
||||
214
Info/Layer3.pm
214
Info/Layer3.pm
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer3 - SNMP Interface to Layer3 devices
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker -- All changes from Version 0.7 on
|
||||
#
|
||||
@@ -30,57 +30,49 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::Bridge;
|
||||
use SNMP::Info::EtherLike;
|
||||
use SNMP::Info::Entity;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::ISA = qw/SNMP::Info SNMP::Info::CDP SNMP::Info::Bridge
|
||||
SNMP::Info::EtherLike SNMP::Info::CiscoStats Exporter/;
|
||||
@SNMP::Info::Layer3::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::EtherLike
|
||||
SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer3::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::EtherLike::MIBS,
|
||||
'ENTITY-MIB' => 'entPhysicalName',
|
||||
'CISCO-PRODUCTS-MIB' => 'sysName',
|
||||
'OSPF-MIB' => 'ospfRouterId',
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
'OSPF-MIB' => 'ospfRouterId',
|
||||
'BGP4-MIB' => 'bgpIdentifier',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
# Inherit the super class ones
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::EtherLike::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
'serial1' => '.1.3.6.1.4.1.9.3.6.3.0', # OLD-CISCO-CHASSIS-MIB::chassisId.0
|
||||
'router_ip' => 'ospfRouterId.0',
|
||||
%SNMP::Info::Entity::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
'serial1' => '.1.3.6.1.4.1.9.3.6.3.0', # OLD-CISCO-CHASSIS-MIB::chassisId.0
|
||||
'router_ip' => 'ospfRouterId.0',
|
||||
'bgp_id' => 'bgpIdentifier.0',
|
||||
'bgp_local_as' => 'bgpLocalAs.0',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::EtherLike::FUNCS,
|
||||
%SNMP::Info::Entity::FUNCS,
|
||||
# IFMIB
|
||||
'i_name2' => 'ifName',
|
||||
# Address Translation Table (ARP Cache)
|
||||
@@ -88,17 +80,26 @@ $INIT = 0;
|
||||
'at_paddr' => 'atPhysAddress',
|
||||
'at_netaddr' => 'atNetAddress',
|
||||
'ospf_ip' => 'ospfHostIpAddress',
|
||||
'ent_serial' => 'entPhysicalSerialNum',
|
||||
'ent_chassis'=> 'entPhysicalDescr',
|
||||
# BGP Peer Table
|
||||
'bgp_peers' => 'bgpPeerLocalAddr',
|
||||
'bgp_peer_id' => 'bgpPeerIdentifier',
|
||||
'bgp_peer_state' => 'bgpPeerState',
|
||||
'bgp_peer_as' => 'bgpPeerRemoteAs',
|
||||
'bgp_peer_addr' => 'bgpPeerRemoteAddr',
|
||||
'bgp_peer_fsm_est_trans' => 'bgpPeerFsmEstablishedTransitions',
|
||||
'bgp_peer_in_tot_msgs' => 'bgpPeerInTotalMessages',
|
||||
'bgp_peer_in_upd_el_time' => 'bgpPeerInUpdateElapsedTime',
|
||||
'bgp_peer_in_upd' => 'bgpPeerInUpdates',
|
||||
'bgp_peer_out_tot_msgs' => 'bgpPeerOutTotalMessages',
|
||||
'bgp_peer_out_upd' => 'bgpPeerOutUpdates',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::EtherLike::MUNGE,
|
||||
%SNMP::Info::Entity::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
|
||||
@@ -111,17 +112,18 @@ sub root_ip {
|
||||
my $router_ip = $l3->router_ip();
|
||||
my $ospf_ip = $l3->ospf_ip();
|
||||
|
||||
# return the first one found here (should be only)
|
||||
# return the first one found here (should be only one)
|
||||
if (defined $ospf_ip and scalar(keys %$ospf_ip)){
|
||||
foreach my $key (keys %$ospf_ip){
|
||||
my $ip = $ospf_ip->{$key};
|
||||
next if $ip eq '0.0.0.0';
|
||||
print " SNMP::Layer3::root_ip() using $ip\n" if $DEBUG;
|
||||
next unless $l3->snmp_connect_ip($ip);
|
||||
print " SNMP::Layer3::root_ip() using $ip\n" if $l3->debug();
|
||||
return $ip;
|
||||
}
|
||||
}
|
||||
|
||||
return $router_ip if (defined $router_ip and $router_ip ne '0.0.0.0');
|
||||
return $router_ip if ( (defined $router_ip) and ($router_ip ne '0.0.0.0') and ($l3->snmp_connect_ip($router_ip)) );
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -133,7 +135,7 @@ sub i_ignore {
|
||||
my %i_ignore;
|
||||
foreach my $if (keys %$interfaces) {
|
||||
# lo -> cisco aironet 350 loopback
|
||||
if ($interfaces->{$if} =~ /(tunnel|loopback|lo|null)/i){
|
||||
if ($interfaces->{$if} =~ /(tunnel|loopback|\blo\b|null)/i){
|
||||
$i_ignore{$if}++;
|
||||
}
|
||||
}
|
||||
@@ -144,11 +146,11 @@ sub serial {
|
||||
my $l3 = shift;
|
||||
|
||||
my $serial1 = $l3->serial1();
|
||||
my $ent_chassis = $l3->ent_chassis() || {};
|
||||
my $ent_serial = $l3->ent_serial() || {};
|
||||
my $e_descr = $l3->e_descr() || {};
|
||||
my $e_serial = $l3->e_serial() || {};
|
||||
|
||||
my $serial2 = $ent_serial->{1} || undef;
|
||||
my $chassis = $ent_chassis->{1} || undef;
|
||||
my $serial2 = $e_serial->{1} || undef;
|
||||
my $chassis = $e_descr->{1} || undef;
|
||||
|
||||
# precedence
|
||||
# serial2,chassis parse,serial1
|
||||
@@ -166,7 +168,7 @@ sub model {
|
||||
my $id = $l3->id();
|
||||
|
||||
unless (defined $id){
|
||||
print " SNMP::Info::Layer3::model() - Device does not support sysObjectID\n" if $DEBUG;
|
||||
print " SNMP::Info::Layer3::model() - Device does not support sysObjectID\n" if $l3->debug();
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -241,11 +243,13 @@ sub vendor {
|
||||
|
||||
my $descr = $l3->description();
|
||||
|
||||
return 'cisco' if ($descr =~ /(cisco|ios)/i);
|
||||
return 'cisco' if ($descr =~ /(cisco|\bios\b)/i);
|
||||
return 'foundry' if ($descr =~ /foundry/i);
|
||||
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
@@ -254,7 +258,7 @@ SNMP::Info::Layer3 - Perl5 Interface to network devices serving Layer3 or Layers
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -304,9 +308,7 @@ a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
For L2/L3 devices.
|
||||
|
||||
=item SNMP::Info::EtherLike
|
||||
|
||||
@@ -316,19 +318,17 @@ a more specific class using the method above.
|
||||
|
||||
=over
|
||||
|
||||
=item CISCO-PRODUCTS-MIB
|
||||
|
||||
=item ENTITY-MIB
|
||||
|
||||
=item OSPF-MIB
|
||||
|
||||
=item BGP4-MIB
|
||||
|
||||
=item Inherited Classes
|
||||
|
||||
MIBs required by the inherited classes listed above.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
MIBs can be found in the netdisco-mibs package.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
@@ -336,12 +336,6 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $l3->chassis()
|
||||
|
||||
Returns Chassis type (model).
|
||||
|
||||
(B<entPhysicalDescr.1>)
|
||||
|
||||
=item $l3->mac()
|
||||
|
||||
Returns root port mac address
|
||||
@@ -352,6 +346,18 @@ Returns root port mac address
|
||||
|
||||
(B<ospfRouterId.0>)
|
||||
|
||||
=item $l3->bgp_id()
|
||||
|
||||
(B<bgpIdentifier.0>)
|
||||
|
||||
Returns the BGP identifier of the local system
|
||||
|
||||
=item $l3->bgp_local_as()
|
||||
|
||||
Returns the local autonomous system number
|
||||
|
||||
(B<bgpLocalAs.0>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
@@ -366,7 +372,7 @@ Removes 'cisco' from cisco devices for readability.
|
||||
|
||||
=item $l3->serial()
|
||||
|
||||
Trys to cull a serial number from $l3->chassis()
|
||||
Trys to cull a serial number from ENTITY-MIB, description, and OLD-CISCO-... mib
|
||||
|
||||
=item $l3->vendor()
|
||||
|
||||
@@ -382,18 +388,14 @@ See documentation in SNMP::Info for details.
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::EtherLike
|
||||
|
||||
See documentation in SNMP::Info::EtherLike for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -456,6 +458,84 @@ Returns reference to hash of Arp Cache Entries to IP Address
|
||||
|
||||
=back
|
||||
|
||||
=head2 BGP Peer Table
|
||||
|
||||
=over
|
||||
|
||||
=item $l3->bgp_peers()
|
||||
|
||||
Returns reference to hash of BGP peer to local IP address
|
||||
|
||||
(B<bgpPeerLocalAddr>)
|
||||
|
||||
=item $l3->bgp_peer_id()
|
||||
|
||||
Returns reference to hash of BGP peer to BGP peer identifier
|
||||
|
||||
(B<bgpPeerIdentifier>)
|
||||
|
||||
=item $l3->bgp_peer_state()
|
||||
|
||||
Returns reference to hash of BGP peer to BGP peer state
|
||||
|
||||
(B<bgpPeerState>)
|
||||
|
||||
=item $l3->bgp_peer_as()
|
||||
|
||||
Returns reference to hash of BGP peer to BGP peer autonomous system number
|
||||
|
||||
(B<bgpPeerRemoteAs>)
|
||||
|
||||
=item $l3->bgp_peer_addr()
|
||||
|
||||
Returns reference to hash of BGP peer to BGP peer IP address
|
||||
|
||||
(B<bgpPeerRemoteAddr>)
|
||||
|
||||
=item $l3->bgp_peer_fsm_est_trans()
|
||||
|
||||
Returns reference to hash of BGP peer to the total number of times the BGP FSM
|
||||
transitioned into the established state
|
||||
|
||||
(B<bgpPeerFsmEstablishedTransitions>)
|
||||
|
||||
=item $l3->bgp_peer_in_tot_msgs()
|
||||
|
||||
Returns reference to hash of BGP peer to the total number of messages received
|
||||
from the remote peer on this connection
|
||||
|
||||
(B<bgpPeerInTotalMessages>)
|
||||
|
||||
=item $l3->bgp_peer_in_upd_el_time()
|
||||
|
||||
Returns reference to hash of BGP peer to the elapsed time in seconds since
|
||||
the last BGP UPDATE message was received from the peer.
|
||||
|
||||
(B<bgpPeerInUpdateElapsedTime>)
|
||||
|
||||
=item $l3->bgp_peer_in_upd()
|
||||
|
||||
Returns reference to hash of BGP peer to the number of BGP UPDATE messages
|
||||
received on this connection
|
||||
|
||||
(B<bgpPeerInUpdates>)
|
||||
|
||||
=item $l3->bgp_peer_out_tot_msgs()
|
||||
|
||||
Returns reference to hash of BGP peer to the total number of messages transmitted
|
||||
to the remote peer on this connection
|
||||
|
||||
(B<bgpPeerOutTotalMessages>)
|
||||
|
||||
=item $l3->bgp_peer_out_upd()
|
||||
|
||||
Returns reference to hash of BGP peer to the number of BGP UPDATE messages
|
||||
transmitted on this connection
|
||||
|
||||
(B<bgpPeerOutUpdates>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
@@ -464,16 +544,12 @@ See documentation in SNMP::Info for details.
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::EtherLike
|
||||
|
||||
See documentation in SNMP::Info::EtherLike for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Entity
|
||||
|
||||
See documentation in SNMP::Info::Entity for details.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer3::Aironet
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Aironet;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -42,10 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::Layer3::Aironet::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Aironet::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'AWCVX-MIB' => 'awcIfTable',
|
||||
@@ -90,7 +86,7 @@ sub os {
|
||||
|
||||
sub os_ver {
|
||||
my $aironet = shift;
|
||||
my $descr = $aironet->description();
|
||||
my $descr = $aironet->description() || '';
|
||||
|
||||
# CAP340 11.21, AP4800-E 11.21
|
||||
if ($descr =~ /AP\d{3,4}(-\D+)?\s+(\d{2}\.\d{2})/){
|
||||
@@ -220,7 +216,7 @@ SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer3::AlteonAD
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller
|
||||
# All Rights Reserved
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::AlteonAD;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -42,26 +42,20 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE /;
|
||||
@SNMP::Info::Layer3::AlteonAD::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::AlteonAD::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'ALTEON-TIGON-SWITCH-MIB' => 'agSoftwareVersion',
|
||||
'ALTEON-TS-PHYSICAL-MIB' => 'agPortTableMaxEnt',
|
||||
'ALTEON-TS-NETWORK-MIB' => 'agPortTableMaxEnt',
|
||||
'ALTEON-TIGON-SWITCH-MIB' => 'agSoftwareVersion',
|
||||
'ALTEON-TS-PHYSICAL-MIB' => 'agPortTableMaxEnt',
|
||||
'ALTEON-TS-NETWORK-MIB' => 'agPortTableMaxEnt',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
'sw_ver' => 'agSoftwareVersion',
|
||||
'tftp_action' => 'agTftpAction',
|
||||
'tftp_host' => 'agTftpServer',
|
||||
'sw_ver' => 'agSoftwareVersion',
|
||||
'tftp_action' => 'agTftpAction',
|
||||
'tftp_host' => 'agTftpServer',
|
||||
'tftp_file' => 'agTftpCfgFileName',
|
||||
'tftp_result' => 'agTftpLastActionStatus',
|
||||
);
|
||||
@@ -69,8 +63,8 @@ $INIT = 0;
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
'bp_index_2' => 'dot1dBasePortIfIndex',
|
||||
'i_name2' => 'ifName',
|
||||
'bp_index_2' => 'dot1dBasePortIfIndex',
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
@@ -137,12 +131,12 @@ sub interfaces {
|
||||
my $desc = $descriptions->{$iid};
|
||||
next unless defined $desc;
|
||||
|
||||
if ($desc =~ /(^net\d+)/) {
|
||||
$desc = $1;
|
||||
}
|
||||
elsif (($iid > 256) and ($iid < 266)) {
|
||||
$desc = ($iid % 256);
|
||||
}
|
||||
if ($desc =~ /(^net\d+)/) {
|
||||
$desc = $1;
|
||||
}
|
||||
elsif (($iid > 256) and ($iid < 266)) {
|
||||
$desc = ($iid % 256);
|
||||
}
|
||||
$interfaces{$iid} = $desc;
|
||||
}
|
||||
return \%interfaces;
|
||||
@@ -160,9 +154,9 @@ sub i_duplex {
|
||||
|
||||
$duplex = 'half' if $duplex =~ /half/i;
|
||||
$duplex = 'full' if $duplex =~ /full/i;
|
||||
|
||||
my $idx = $if + 256;
|
||||
|
||||
|
||||
my $idx = $if + 256;
|
||||
|
||||
$i_duplex{$idx}=$duplex;
|
||||
}
|
||||
return \%i_duplex;
|
||||
@@ -180,22 +174,22 @@ sub i_duplex_admin {
|
||||
foreach my $if (keys %$ag_pref){
|
||||
my $pref = $ag_pref->{$if};
|
||||
next unless defined $pref;
|
||||
|
||||
my $string = 'other';
|
||||
if ($pref =~ /gigabit/i) {
|
||||
my $ge_auto = $ag_ge_auto->{$if};
|
||||
$string = 'full' if ($ge_auto =~ /off/i);
|
||||
$string = 'auto' if ($ge_auto =~ /on/i);
|
||||
}
|
||||
elsif ($pref =~ /fast/i) {
|
||||
my $fe_auto = $ag_fe_auto->{$if};
|
||||
my $fe_mode = $ag_fe_mode->{$if};
|
||||
$string = 'half' if ($fe_mode =~ /half/i and $fe_auto =~ /off/i);
|
||||
|
||||
my $string = 'other';
|
||||
if ($pref =~ /gigabit/i) {
|
||||
my $ge_auto = $ag_ge_auto->{$if};
|
||||
$string = 'full' if ($ge_auto =~ /off/i);
|
||||
$string = 'auto' if ($ge_auto =~ /on/i);
|
||||
}
|
||||
elsif ($pref =~ /fast/i) {
|
||||
my $fe_auto = $ag_fe_auto->{$if};
|
||||
my $fe_mode = $ag_fe_mode->{$if};
|
||||
$string = 'half' if ($fe_mode =~ /half/i and $fe_auto =~ /off/i);
|
||||
$string = 'full' if ($fe_mode =~ /full/i and $fe_auto =~ /off/i);
|
||||
$string = 'auto' if $fe_auto =~ /on/i;
|
||||
}
|
||||
my $idx = $if + 256;
|
||||
|
||||
}
|
||||
my $idx = $if + 256;
|
||||
|
||||
$i_duplex_admin{$idx}=$string;
|
||||
}
|
||||
return \%i_duplex_admin;
|
||||
@@ -211,15 +205,15 @@ sub i_vlan {
|
||||
my %i_vlan;
|
||||
foreach my $if (keys %$ip_vlans){
|
||||
my $ip_vlanid = $ip_vlans->{$if};
|
||||
next unless defined $ip_vlanid;
|
||||
next unless defined $ip_vlanid;
|
||||
|
||||
$i_vlan{$if}=$ip_vlanid;
|
||||
}
|
||||
foreach my $if (keys %$ag_vlans){
|
||||
my $ag_vlanid = $ag_vlans->{$if};
|
||||
next unless defined $ag_vlanid;
|
||||
next unless defined $ag_vlanid;
|
||||
|
||||
my $idx = $if + 256;
|
||||
my $idx = $if + 256;
|
||||
$i_vlan{$idx}=$ag_vlanid;
|
||||
}
|
||||
return \%i_vlan;
|
||||
@@ -232,7 +226,7 @@ sub i_name {
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$p_name){
|
||||
my $name = $p_name->{$iid};
|
||||
next unless defined $name;
|
||||
next unless defined $name;
|
||||
my $idx = $iid + 256;
|
||||
$i_name{$idx} = $name;
|
||||
}
|
||||
@@ -250,26 +244,11 @@ sub bp_index {
|
||||
next unless defined $port;
|
||||
$port = $port + 256;
|
||||
|
||||
$bp_index{$iid} = $port;
|
||||
$bp_index{$iid} = $port;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
sub root_ip {
|
||||
my $alteon = shift;
|
||||
my $ip_table = $alteon->ip_table();
|
||||
|
||||
# Return First IP Address
|
||||
foreach my $entry (keys %$ip_table){
|
||||
my $router_ip = $ip_table->{$entry};
|
||||
print " SNMP::Layer3::AlteonAD::root_ip() using $router_ip\n" if $DEBUG;
|
||||
next unless $router_ip;
|
||||
return $router_ip if ($router_ip ne '0.0.0.0');
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -280,7 +259,7 @@ Director Series Layer 2-7 Switches.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -356,21 +335,16 @@ Returns the model extracted from B<sysDescr>
|
||||
|
||||
=item $alteon->vendor()
|
||||
|
||||
Returns 'Nortel'
|
||||
Returns 'nortel'
|
||||
|
||||
=item $alteon->os()
|
||||
|
||||
Returns 'WebOS'
|
||||
Returns 'webos'
|
||||
|
||||
=item $alteon->os_ver()
|
||||
|
||||
Returns the software version reported by B<agSoftwareVersion>
|
||||
|
||||
=item $alteon->root_ip()
|
||||
|
||||
Returns the primary IP used to communicate with the device. Currently returns
|
||||
the first interfaces IP.
|
||||
|
||||
=item $alteon->tftp_action()
|
||||
|
||||
(B<agTftpAction>)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer3::BayRS
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller, Max Baker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::BayRS;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -42,19 +42,13 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE %MODEL_MAP/;
|
||||
@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Bridge Exporter/;
|
||||
@SNMP::Info::Layer3::BayRS::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt',
|
||||
'Wellfleet-OSPF-MIB' => 'wfOspfRouterId',
|
||||
'Wellfleet-DOT1QTAG-CONFIG-MIB' => 'wfDot1qTagCfgVlanName',
|
||||
'Wellfleet-CSMACD-MIB' => 'wfCSMACDCct',
|
||||
'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt',
|
||||
'Wellfleet-OSPF-MIB' => 'wfOspfRouterId',
|
||||
'Wellfleet-DOT1QTAG-CONFIG-MIB' => 'wfDot1qTagCfgVlanName',
|
||||
'Wellfleet-CSMACD-MIB' => 'wfCSMACDCct',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -68,37 +62,37 @@ $INIT = 0;
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
'i_name2' => 'ifName',
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
# From Wellfleet-CSMACD-MIB::wfCSMACDTable
|
||||
'wf_csmacd_cct' => 'wfCSMACDCct',
|
||||
'wf_csmacd_cct' => 'wfCSMACDCct',
|
||||
'wf_csmacd_slot' => 'wfCSMACDSlot',
|
||||
'wf_csmacd_conn' => 'wfCSMACDConnector',
|
||||
'wf_csmacd_mtu' => 'wfCSMACDMtu',
|
||||
'wf_duplex' => 'wfCSMACDLineCapability',
|
||||
'wf_csmacd_line' => 'wfCSMACDLineNumber',
|
||||
'wf_csmacd_mtu' => 'wfCSMACDMtu',
|
||||
'wf_duplex' => 'wfCSMACDLineCapability',
|
||||
'wf_csmacd_line' => 'wfCSMACDLineNumber',
|
||||
# From Wellfleet-CSMACD-MIB::wfCSMACDAutoNegTable
|
||||
'wf_auto' => 'wfCSMACDAutoNegSpeedSelect',
|
||||
'wf_auto' => 'wfCSMACDAutoNegSpeedSelect',
|
||||
# From Wellfleet-DOT1QTAG-CONFIG-MIB::wfDot1qTagConfigTable
|
||||
'wf_vlan_name' => 'wfDot1qTagCfgVlanName',
|
||||
'wf_local_vlan_id' => 'wfDot1qTagCfgLocalVlanId',
|
||||
'wf_global_vlan_id' => 'wfDot1qTagCfgGlobalVlanId',
|
||||
'wf_vlan_port' => 'wfDot1qTagCfgPhysicalPortId',
|
||||
# From Wellfleet-HARDWARE-MIB::wfHwTable
|
||||
'wf_vlan_port' => 'wfDot1qTagCfgPhysicalPortId',
|
||||
# From Wellfleet-HARDWARE-MIB::wfHwTable
|
||||
'wf_hw_slot' => 'wfHwSlot',
|
||||
'wf_hw_mod_id' => 'wfHwModIdOpt',
|
||||
'wf_hw_mod_rev' => 'wfHwModRev',
|
||||
'wf_hw_mod_ser' => 'wfHwModSerialNumber',
|
||||
'wf_hw_mod_id' => 'wfHwModIdOpt',
|
||||
'wf_hw_mod_rev' => 'wfHwModRev',
|
||||
'wf_hw_mod_ser' => 'wfHwModSerialNumber',
|
||||
'wf_hw_mobo_id' => 'wfHwMotherBdIdOpt ',
|
||||
'wf_hw_mobo_rev' => 'wfHwMotherBdRev',
|
||||
'wf_hw_mobo_ser' => 'wfHwMotherBdSerialNumber',
|
||||
'wf_hw_diag' => 'wfHwDiagPromRev',
|
||||
'wf_hw_boot' => 'wfHwBootPromRev',
|
||||
'wf_hw_mobo_mem' => 'wfHwMotherBdMemorySize',
|
||||
'wf_hw_cfg_time' => 'wfHwConfigDateAndTime ',
|
||||
'wf_hw_mobo_ser' => 'wfHwMotherBdSerialNumber',
|
||||
'wf_hw_diag' => 'wfHwDiagPromRev',
|
||||
'wf_hw_boot' => 'wfHwBootPromRev',
|
||||
'wf_hw_mobo_mem' => 'wfHwMotherBdMemorySize',
|
||||
'wf_hw_cfg_time' => 'wfHwConfigDateAndTime ',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -108,20 +102,20 @@ $INIT = 0;
|
||||
);
|
||||
|
||||
%MODEL_MAP = (
|
||||
'acefn' => 'FN',
|
||||
'aceln' => 'LN',
|
||||
'acecn' => 'CN',
|
||||
'afn' => 'AFN',
|
||||
'in' => 'IN',
|
||||
'an' => 'AN',
|
||||
'arn' => 'ARN',
|
||||
'sys5000' => '5000',
|
||||
'freln' => 'BLN',
|
||||
'frecn' => 'BCN',
|
||||
'frerbln' => 'BLN-2',
|
||||
'asn' => 'ASN',
|
||||
'asnzcable' => 'ASN-Z',
|
||||
'asnbcable' => 'ASN-B',
|
||||
'acefn' => 'FN',
|
||||
'aceln' => 'LN',
|
||||
'acecn' => 'CN',
|
||||
'afn' => 'AFN',
|
||||
'in' => 'IN',
|
||||
'an' => 'AN',
|
||||
'arn' => 'ARN',
|
||||
'sys5000' => '5000',
|
||||
'freln' => 'BLN',
|
||||
'frecn' => 'BCN',
|
||||
'frerbln' => 'BLN-2',
|
||||
'asn' => 'ASN',
|
||||
'asnzcable' => 'ASN-Z',
|
||||
'asnbcable' => 'ASN-B',
|
||||
);
|
||||
|
||||
sub model {
|
||||
@@ -170,7 +164,7 @@ sub interfaces {
|
||||
my $desc = $description->{$iid};
|
||||
next unless defined $desc;
|
||||
|
||||
$desc = $1 if $desc =~ /(^[A-Z]\d+)/;
|
||||
$desc = $1 if $desc =~ /(^[A-Z]\d+)/;
|
||||
|
||||
$interfaces{$iid} = $desc;
|
||||
}
|
||||
@@ -179,8 +173,8 @@ sub interfaces {
|
||||
next unless defined $vlan;
|
||||
my $vlan_if = $vlan_idx->{$iid};
|
||||
next unless defined $vlan_if;
|
||||
|
||||
my $desc = 'V' . $vlan;
|
||||
|
||||
my $desc = 'Vlan' . $vlan;
|
||||
|
||||
$interfaces{$vlan_if} = $desc;
|
||||
}
|
||||
@@ -203,7 +197,7 @@ sub i_name {
|
||||
# Get VLAN Virtual Router Interfaces
|
||||
foreach my $vid (keys %$v_name){
|
||||
my $v_name = $v_name->{$vid};
|
||||
next unless defined $v_name;
|
||||
next unless defined $v_name;
|
||||
my $vlan_if = $vlan_idx->{$vid};
|
||||
next unless defined $vlan_if;
|
||||
|
||||
@@ -227,7 +221,7 @@ sub i_duplex {
|
||||
|
||||
my $string = 'half';
|
||||
$string = 'full' if $duplex =~ /duplex/i;
|
||||
|
||||
|
||||
$i_duplex{$idx}=$string;
|
||||
}
|
||||
return \%i_duplex;
|
||||
@@ -248,22 +242,22 @@ sub i_duplex_admin {
|
||||
next unless defined $idx;
|
||||
my $duplex = $wf_duplex->{$if};
|
||||
next unless defined $duplex;
|
||||
my $slot = $wf_slot->{$if};
|
||||
my $conn = $wf_conn->{$if};
|
||||
my $auto_idx = "$slot.$conn";
|
||||
my $auto = $wf_auto->{$auto_idx};
|
||||
|
||||
my $string = 'other';
|
||||
if ($auto) {
|
||||
$string = 'half';
|
||||
$string = 'full' if $auto =~ /duplex/i;
|
||||
$string = 'auto' if $auto =~ /nway/i;
|
||||
}
|
||||
elsif ($duplex) {
|
||||
$string = 'half';
|
||||
$string = 'full' if $duplex =~ /duplex/i;
|
||||
}
|
||||
|
||||
my $slot = $wf_slot->{$if};
|
||||
my $conn = $wf_conn->{$if};
|
||||
my $auto_idx = "$slot.$conn";
|
||||
my $auto = $wf_auto->{$auto_idx};
|
||||
|
||||
my $string = 'other';
|
||||
if ($auto) {
|
||||
$string = 'half';
|
||||
$string = 'full' if $auto =~ /duplex/i;
|
||||
$string = 'auto' if $auto =~ /nway/i;
|
||||
}
|
||||
elsif ($duplex) {
|
||||
$string = 'half';
|
||||
$string = 'full' if $duplex =~ /duplex/i;
|
||||
}
|
||||
|
||||
$i_duplex_admin{$idx}=$string;
|
||||
}
|
||||
return \%i_duplex_admin;
|
||||
@@ -272,41 +266,41 @@ sub i_duplex_admin {
|
||||
sub i_vlan {
|
||||
my $bayrs = shift;
|
||||
|
||||
my $wf_cct = $bayrs->wf_csmacd_cct();
|
||||
my $wf_mtu = $bayrs->wf_csmacd_mtu();
|
||||
my $wf_line = $bayrs->wf_csmacd_line();
|
||||
my $wf_local_vid = $bayrs->wf_local_vlan_id();
|
||||
my $wf_global_vid = $bayrs->wf_global_vlan_id();
|
||||
my $wf_vport = $bayrs->wf_vlan_port();
|
||||
my $wf_cct = $bayrs->wf_csmacd_cct();
|
||||
my $wf_mtu = $bayrs->wf_csmacd_mtu();
|
||||
my $wf_line = $bayrs->wf_csmacd_line();
|
||||
my $wf_local_vid = $bayrs->wf_local_vlan_id();
|
||||
my $wf_global_vid = $bayrs->wf_global_vlan_id();
|
||||
my $wf_vport = $bayrs->wf_vlan_port();
|
||||
|
||||
my %i_vlan;
|
||||
# Look for VLANs on Ethernet Interfaces
|
||||
foreach my $if (keys %$wf_cct){
|
||||
my $idx = $wf_cct->{$if};
|
||||
next unless defined $idx;
|
||||
# Check MTU size, if unable to carry VLAN tag skip.
|
||||
my $mtu = $wf_mtu->{$if};
|
||||
next unless defined $idx;
|
||||
# Check MTU size, if unable to carry VLAN tag skip.
|
||||
my $mtu = $wf_mtu->{$if};
|
||||
next if (($mtu =~ /default/i) or ($mtu < 1522));
|
||||
my $line = $wf_line->{$if};
|
||||
my @vlans = ();
|
||||
foreach my $v_idx (keys %$wf_vport){
|
||||
my $port = $wf_vport->{$v_idx};
|
||||
next unless defined $port;
|
||||
next if ($port != $line);
|
||||
|
||||
my $vlan = $wf_global_vid->{$v_idx};
|
||||
push(@vlans, $vlan);
|
||||
}
|
||||
my $vlans = join (',', @vlans);
|
||||
$i_vlan{$idx}=$vlans;
|
||||
my $line = $wf_line->{$if};
|
||||
my @vlans = ();
|
||||
foreach my $v_idx (keys %$wf_vport){
|
||||
my $port = $wf_vport->{$v_idx};
|
||||
next unless defined $port;
|
||||
next if ($port != $line);
|
||||
|
||||
my $vlan = $wf_global_vid->{$v_idx};
|
||||
push(@vlans, $vlan);
|
||||
}
|
||||
my $vlans = join (',', @vlans);
|
||||
$i_vlan{$idx}=$vlans;
|
||||
}
|
||||
# Add VLAN on VLAN Interfaces
|
||||
foreach my $idx (keys %$wf_global_vid){
|
||||
my $v_if = $wf_local_vid->{$idx};
|
||||
next unless defined $v_if;
|
||||
next unless defined $v_if;
|
||||
my $vlan = $wf_global_vid->{$idx};
|
||||
next unless defined $vlan;
|
||||
|
||||
next unless defined $vlan;
|
||||
|
||||
$i_vlan{$v_if}=$vlan;
|
||||
}
|
||||
return \%i_vlan;
|
||||
@@ -315,31 +309,25 @@ sub i_vlan {
|
||||
sub root_ip {
|
||||
my $bayrs = shift;
|
||||
|
||||
my $ip_index = $bayrs->ip_index();
|
||||
my $ip_table = $bayrs->ip_table();
|
||||
my $ip_index = $bayrs->ip_index();
|
||||
my $ip_table = $bayrs->ip_table();
|
||||
|
||||
# Check for CLIP
|
||||
foreach my $entry (keys %$ip_index){
|
||||
my $idx = $ip_index->{$entry};
|
||||
next unless $idx == 0;
|
||||
my $clip = $ip_table->{$entry};
|
||||
next unless ((defined $clip) and ($clip eq '0.0.0.0'));
|
||||
print " SNMP::Layer3::BayRS::root_ip() using $clip\n" if $DEBUG;
|
||||
return $clip;
|
||||
next unless $idx == 0;
|
||||
my $clip = $ip_table->{$entry};
|
||||
next unless ( (defined $clip) and ($clip ne '0.0.0.0') and ($bayrs->snmp_connect_ip($clip)) );
|
||||
print " SNMP::Layer3::BayRS::root_ip() using $clip\n" if $bayrs->debug();
|
||||
return $clip;
|
||||
}
|
||||
# Check for OSPF Router ID
|
||||
my $ospf_ip = $bayrs->ospf_rtr_id();
|
||||
if ((defined $ospf_ip) and ($ospf_ip ne '0.0.0.0')) {
|
||||
print " SNMP::Layer3::BayRS::root_ip() using $ospf_ip\n" if $DEBUG;
|
||||
return $ospf_ip;
|
||||
}
|
||||
# Else Return First IP Address
|
||||
foreach my $entry (keys %$ip_table){
|
||||
my $ip = $ip_table->{$entry};
|
||||
print " SNMP::Layer3::BayRS::root_ip() using $ip\n" if $DEBUG;
|
||||
next unless $ip;
|
||||
return $ip if ($ip ne '0.0.0.0');
|
||||
if ((defined $ospf_ip) and ($ospf_ip ne '0.0.0.0') and ($bayrs->snmp_connect_ip($ospf_ip)) ) {
|
||||
print " SNMP::Layer3::BayRS::root_ip() using $ospf_ip\n" if $bayrs->debug();
|
||||
return $ospf_ip;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
@@ -348,11 +336,11 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::BayRS - Perl5 Interface to Nortel Networks' routers running BayRS.
|
||||
SNMP::Info::Layer3::BayRS - Perl5 Interface to Nortel routers running BayRS.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -372,7 +360,7 @@ Eric Miller (C<eric@jeneric.org>)
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Abstraction subclass for routers running Nortel Networks' BayRS.
|
||||
Abstraction subclass for routers running Nortel BayRS.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
@@ -407,14 +395,6 @@ See SNMP::Info for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::Bridge for its own MIB requirements.
|
||||
|
||||
MIBs can be found on the CD that came with your product.
|
||||
|
||||
Or, they can be downloaded directly from Nortel Networks regardless of support
|
||||
contract status. Go to http://www.nortelnetworks.com Techninal Support, Browse
|
||||
Technical Support, Select by Product Families, BayRS Router Software,
|
||||
Router Software v 15.x, Software. Filter on mibs and download the latest
|
||||
version's archive.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -429,29 +409,29 @@ Returns the model of the BayRS router. Will translate between the MIB model and
|
||||
the common model with this map :
|
||||
|
||||
%MODEL_MAP = (
|
||||
'acefn' => 'FN',
|
||||
'aceln' => 'LN',
|
||||
'acecn' => 'CN',
|
||||
'afn' => 'AFN',
|
||||
'in' => 'IN',
|
||||
'an' => 'AN',
|
||||
'arn' => 'ARN',
|
||||
'sys5000' => '5000',
|
||||
'freln' => 'BLN',
|
||||
'frecn' => 'BCN',
|
||||
'frerbln' => 'BLN-2',
|
||||
'asn' => 'ASN',
|
||||
'asnzcable' => 'ASN-Z',
|
||||
'asnbcable' => 'ASN-B',
|
||||
'acefn' => 'FN',
|
||||
'aceln' => 'LN',
|
||||
'acecn' => 'CN',
|
||||
'afn' => 'AFN',
|
||||
'in' => 'IN',
|
||||
'an' => 'AN',
|
||||
'arn' => 'ARN',
|
||||
'sys5000' => '5000',
|
||||
'freln' => 'BLN',
|
||||
'frecn' => 'BCN',
|
||||
'frerbln' => 'BLN-2',
|
||||
'asn' => 'ASN',
|
||||
'asnzcable' => 'ASN-Z',
|
||||
'asnbcable' => 'ASN-B',
|
||||
);
|
||||
|
||||
=item $bayrs->vendor()
|
||||
|
||||
Returns 'Nortel'
|
||||
Returns 'nortel'
|
||||
|
||||
=item $bayrs->os()
|
||||
|
||||
Returns 'BayRS'
|
||||
Returns 'bayrs'
|
||||
|
||||
=item $bayrs->os_ver()
|
||||
|
||||
@@ -465,8 +445,7 @@ Returns (B<wfHwBpSerialNumber>) after conversion to ASCII decimal
|
||||
|
||||
Returns the primary IP used to communicate with the router.
|
||||
|
||||
Returns the first found: CLIP (CircuitLess IP), (B<wfOspfRouterId>), or the first
|
||||
IP interface.
|
||||
Returns the first found: CLIP (CircuitLess IP), (B<wfOspfRouterId>), or undefined.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# SNMP::Info::Layer3::C3550
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2003, Regents of the University of California
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::C3550;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -38,27 +38,32 @@ use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CiscoStack;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::CiscoImage;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
|
||||
@SNMP::Info::Layer3::C3550::ISA = qw/ SNMP::Info::Layer3 SNMP::Info::CiscoStack SNMP::Info::CiscoVTP Exporter/;
|
||||
@SNMP::Info::Layer3::C3550::ISA = qw/SNMP::Info::Layer3 SNMP::Info::CiscoStack SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CiscoStats SNMP::Info::CDP Exporter
|
||||
SNMP::Info::CiscoImage/;
|
||||
@SNMP::Info::Layer3::C3550::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
);
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStack::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
'ports2' => 'ifNumber',
|
||||
);
|
||||
|
||||
@@ -66,6 +71,9 @@ $INIT = 0;
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStack::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -73,6 +81,9 @@ $INIT = 0;
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CiscoStack::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CiscoImage::MUNGE,
|
||||
);
|
||||
|
||||
# Pick and choose
|
||||
@@ -95,7 +106,7 @@ sub model {
|
||||
$model =~ s/^catalyst//;
|
||||
|
||||
# turn 355048 into 3550-48
|
||||
if ($model =~ /^(35\d\d)(\d\d[T]?)$/) {
|
||||
if ($model =~ /^(35\d\d)(\d\d(T|G)?)$/) {
|
||||
$model = "$1-$2";
|
||||
}
|
||||
return $model;
|
||||
@@ -109,7 +120,7 @@ sub ports {
|
||||
|
||||
my $id = $c3550->id();
|
||||
my $model = &SNMP::translateObj($id);
|
||||
if ($model =~ /(12|24|48)[T]?$/) {
|
||||
if ($model =~ /(12|24|48)(C|T|TS|G|TS-E|TS-S|T-E)?$/) {
|
||||
return $1;
|
||||
}
|
||||
return $ports2;
|
||||
@@ -129,7 +140,7 @@ SNMP::Info::Layer3::C3550 - Perl5 Interface to Cisco Catalyst 3550 Layer 2/3 Swi
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -170,6 +181,12 @@ a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::CiscoStack
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -184,6 +201,12 @@ See SNMP::Info::CiscoVTP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStack for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStats for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoImage for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CDP for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -196,6 +219,17 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
Returns 'cisco'
|
||||
|
||||
=item $c3550->model()
|
||||
|
||||
Will take the translated model number and try to format it better.
|
||||
|
||||
355048 -> 3550-48
|
||||
355012G -> 3550-12G
|
||||
|
||||
=item $c3550->ports()
|
||||
|
||||
Trys to cull the number of ports from the model number.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
@@ -210,6 +244,18 @@ See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -227,4 +273,16 @@ See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=cut
|
||||
|
||||
262
Info/Layer3/C4000.pm
Normal file
262
Info/Layer3/C4000.pm
Normal file
@@ -0,0 +1,262 @@
|
||||
# SNMP::Info::Layer3::C4000
|
||||
# Bill Fenner
|
||||
#
|
||||
# Copyright (c) 2006 Bill Fenner
|
||||
# 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 Author, nor
|
||||
# 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::C4000;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CiscoStack;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::CiscoImage;
|
||||
use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
|
||||
$VERSION = '1.01';
|
||||
@SNMP::Info::Layer3::C4000::ISA = qw/ SNMP::Info::Layer3 SNMP::Info::CiscoStack SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CiscoStats SNMP::Info::CDP
|
||||
SNMP::Info::CiscoImage SNMP::Info::MAU Exporter/;
|
||||
@SNMP::Info::Layer3::C4000::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
'CISCO-ENVMON-MIB' => 'ciscoEnvMonMIB',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStack::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
'ps1_type' => 'ciscoEnvMonSupplyStatusDescr.1',
|
||||
'ps1_status' => 'ciscoEnvMonSupplyState.1',
|
||||
'ps2_type' => 'ciscoEnvMonSupplyStatusDescr.2',
|
||||
'ps2_status' => 'ciscoEnvMonSupplyState.2',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStack::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
'fan_state' => 'ciscoEnvMonFanState',
|
||||
'fan_descr' => 'ciscoEnvMonFanStatusDescr',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CiscoStack::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CiscoImage::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
);
|
||||
|
||||
# use MAU-MIB for admin. duplex and admin. speed
|
||||
*SNMP::Info::Layer3::C4000::i_duplex_admin = \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
*SNMP::Info::Layer3::C4000::i_speed_admin = \&SNMP::Info::MAU::mau_i_speed_admin;
|
||||
|
||||
sub fan {
|
||||
my $c4000 = shift;
|
||||
my $fan_state = $c4000->fan_state();
|
||||
my $fan_descr = $c4000->fan_descr();
|
||||
my $ret = "";
|
||||
my $s = "";
|
||||
foreach my $i (sort {$a <=> $b} keys %$fan_state) {
|
||||
$ret .= $s . $fan_descr->{$i} . ": " . $fan_state->{$i};
|
||||
$s = ", ";
|
||||
}
|
||||
return undef if ($s eq "");
|
||||
$ret;
|
||||
}
|
||||
|
||||
sub cisco_comm_indexing { 1; }
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::C4000 - Perl5 Interface to Cisco Catalyst 4000 Layer 2/3 Switches running IOS
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Bill Fenner
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $c4000 = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $c4000->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Abstraction subclass for Cisco Catalyst 4000 Layer 2/3 Switches.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
|
||||
my $c4000 = new SNMP::Info::Layer3::C4000(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::CiscoVTP
|
||||
|
||||
=item SNMP::Info::CiscoStack
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
|
||||
=item SNMP::Info::MAU
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See SNMP::Info::Layer3 for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoVTP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStack for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStats for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CDP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoImage for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::MAU for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
=head2 Global Methods imported from SNMP::Info::CiscoStack
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in SNMP::Info::MAU for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoVTP
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStack
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in SNMP::Info::MAU for details.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer3::C6500
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2003,2004 Max Baker
|
||||
# Copyright (c) 2003,2004,2005 Max Baker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -28,7 +28,6 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::C6500;
|
||||
$VERSION = 0.9;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -37,40 +36,51 @@ use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CiscoStack;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::CiscoImage;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
|
||||
@SNMP::Info::Layer3::C6500::ISA = qw/ SNMP::Info::Layer3 SNMP::Info::CiscoStack SNMP::Info::CiscoVTP Exporter/;
|
||||
$VERSION = '1.01';
|
||||
@SNMP::Info::Layer3::C6500::ISA = qw/ SNMP::Info::Layer3 SNMP::Info::CiscoStack SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CiscoStats SNMP::Info::CDP Exporter
|
||||
SNMP::Info::CiscoImage/;
|
||||
@SNMP::Info::Layer3::C6500::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
);
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CiscoStack::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CiscoStack::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CiscoStack::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CiscoStack::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CiscoImage::MUNGE,
|
||||
);
|
||||
|
||||
# Pick and choose
|
||||
@@ -82,21 +92,13 @@ $INIT = 0;
|
||||
*SNMP::Info::Layer3::C6500::i_name = \&SNMP::Info::Layer3::i_name;
|
||||
*SNMP::Info::Layer3::C6500::i_type = \&SNMP::Info::CiscoStack::i_type;
|
||||
|
||||
sub model {
|
||||
my $c6500 = shift;
|
||||
my $model1 = $c6500->model1();
|
||||
return $model1 if defined $model1;
|
||||
return $c6500->SUPER::model();
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'cisco';
|
||||
}
|
||||
|
||||
sub cisco_comm_indexing {
|
||||
1;
|
||||
}
|
||||
|
||||
# There are some buggy 6509's out there.
|
||||
sub bulkwalk_no { 1; }
|
||||
sub cisco_comm_indexing { 1; }
|
||||
|
||||
1;
|
||||
__END__
|
||||
@@ -107,7 +109,7 @@ SNMP::Info::Layer3::C6500 - Perl5 Interface to Cisco Catalyst 6500 Layer 2/3 Swi
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -148,6 +150,12 @@ a more specific class using the method above.
|
||||
|
||||
=item SNMP::Info::CiscoStack
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -162,6 +170,12 @@ See SNMP::Info::CiscoVTP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStack for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStats for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CDP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoImage for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -170,6 +184,11 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $c6500->bulkwalk_no
|
||||
|
||||
Return C<1>. There are some buggy 6509's out there, so bulkwalk
|
||||
is turned off for this class.
|
||||
|
||||
=item $c6500->vendor()
|
||||
|
||||
Returns 'cisco'
|
||||
@@ -188,6 +207,18 @@ See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -205,5 +236,17 @@ See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoStack for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer3::Cisco
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004-6 Max Baker
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -27,7 +27,6 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Cisco;
|
||||
$VERSION = 0.9;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -35,49 +34,71 @@ use strict;
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::CiscoVTP;
|
||||
use SNMP::Info::CDP;
|
||||
use SNMP::Info::CiscoStats;
|
||||
use SNMP::Info::CiscoImage;
|
||||
use SNMP::Info::CiscoRTT;
|
||||
use SNMP::Info::CiscoQOS;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %MUNGE $INIT/ ;
|
||||
@SNMP::Info::Layer3::Cisco::ISA = qw/SNMP::Info::Layer3 SNMP::Info::CiscoVTP Exporter/;
|
||||
$VERSION = '1.01';
|
||||
@SNMP::Info::Layer3::Cisco::ISA = qw/SNMP::Info::Layer3 SNMP::Info::CiscoVTP
|
||||
SNMP::Info::CDP SNMP::Info::CiscoStats
|
||||
SNMP::Info::CiscoImage SNMP::Info::CiscoRTT
|
||||
SNMP::Info::CiscoQOS Exporter/;
|
||||
@SNMP::Info::Layer3::Cisco::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::CiscoVTP::MIBS,
|
||||
%SNMP::Info::CDP::MIBS,
|
||||
%SNMP::Info::CiscoStats::MIBS,
|
||||
%SNMP::Info::CiscoImage::MIBS,
|
||||
%SNMP::Info::CiscoRTT::MIBS,
|
||||
%SNMP::Info::CiscoQOS::MIBS,
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::CiscoVTP::GLOBALS,
|
||||
%SNMP::Info::CDP::GLOBALS,
|
||||
%SNMP::Info::CiscoStats::GLOBALS,
|
||||
%SNMP::Info::CiscoImage::GLOBALS,
|
||||
%SNMP::Info::CiscoRTT::GLOBALS,
|
||||
%SNMP::Info::CiscoQOS::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::CiscoVTP::FUNCS,
|
||||
%SNMP::Info::CDP::FUNCS,
|
||||
%SNMP::Info::CiscoStats::FUNCS,
|
||||
%SNMP::Info::CiscoImage::FUNCS,
|
||||
%SNMP::Info::CiscoRTT::FUNCS,
|
||||
%SNMP::Info::CiscoQOS::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::CiscoVTP::MUNGE,
|
||||
%SNMP::Info::CDP::MUNGE,
|
||||
%SNMP::Info::CiscoStats::MUNGE,
|
||||
%SNMP::Info::CiscoImage::MUNGE,
|
||||
%SNMP::Info::CiscoRTT::MUNGE,
|
||||
%SNMP::Info::CiscoQOS::MUNGE,
|
||||
);
|
||||
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Cisco - Perl5 Interface to Generic L3 Cisco Device
|
||||
SNMP::Info::Layer3::Cisco - Perl5 Interface to L3 and L2+L3 IOS Cisco Device
|
||||
that are not covered in other classes.
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -107,6 +128,12 @@ Subclass for Generic Cisco Routers running IOS
|
||||
|
||||
=item SNMP::Info::CiscoVTP
|
||||
|
||||
=item SNMP::Info::CDP
|
||||
|
||||
=item SNMP::Info::CiscoStats
|
||||
|
||||
=item SNMP::Info::CiscoImage
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
@@ -119,6 +146,12 @@ See SNMP::Info::Layer3 for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoVTP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoStats for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CDP for its own MIB requirements.
|
||||
|
||||
See SNMP::Info::CiscoImage for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
@@ -141,6 +174,17 @@ See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
@@ -155,4 +199,16 @@ See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
See documentation in SNMP::Info::CiscoVTP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CDP
|
||||
|
||||
See documentation in SNMP::Info::CDP for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoStats
|
||||
|
||||
See documentation in SNMP::Info::CiscoStats for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::CiscoImage
|
||||
|
||||
See documentation in SNMP::Info::CiscoImage for details.
|
||||
|
||||
=cut
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer3::Contivity
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller, Max Baker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Contivity;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -42,12 +42,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
@SNMP::Info::Layer3::Contivity::ISA = qw/SNMP::Info SNMP::Info::Entity Exporter/;
|
||||
@SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Entity::MIBS,
|
||||
@@ -152,31 +146,17 @@ sub i_name {
|
||||
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$i_name2){
|
||||
my $name = $i_name2->{$iid};
|
||||
#Skip everything except Ethernet interfaces
|
||||
next unless (defined $name and $name =~ /fe/i);
|
||||
|
||||
$name = $1 if $name =~ /(fei\.\d+\.\d+)/;
|
||||
|
||||
$i_name{$iid} = $name;
|
||||
my $name = $i_name2->{$iid};
|
||||
#Skip everything except Ethernet interfaces
|
||||
next unless (defined $name and $name =~ /fe/i);
|
||||
|
||||
$name = $1 if $name =~ /(fei\.\d+\.\d+)/;
|
||||
|
||||
$i_name{$iid} = $name;
|
||||
}
|
||||
return \%i_name;
|
||||
}
|
||||
|
||||
sub root_ip {
|
||||
my $contivity = shift;
|
||||
my $ip_table = $contivity->ip_table();
|
||||
|
||||
# Return First IP Address
|
||||
foreach my $entry (keys %$ip_table){
|
||||
my $router_ip = $ip_table->{$entry};
|
||||
print " SNMP::Layer3::Contivity::root_ip() using $router_ip\n" if $DEBUG;
|
||||
next unless $router_ip;
|
||||
return $router_ip if ($router_ip ne '0.0.0.0');
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -187,7 +167,7 @@ Extranet Switches (CES).
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -270,11 +250,6 @@ Returns the chassis serial number.
|
||||
|
||||
Returns the MAC address of the first Ethernet Interface.
|
||||
|
||||
=item $contivity->root_ip()
|
||||
|
||||
Returns the primary IP used to communicate with the router. Returns the first
|
||||
IP interface.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
331
Info/Layer3/Extreme.pm
Normal file
331
Info/Layer3/Extreme.pm
Normal file
@@ -0,0 +1,331 @@
|
||||
# SNMP::Info::Layer3::Extreme - SNMP Interface to Extreme devices
|
||||
# Eric Miller
|
||||
#
|
||||
# Copyright (c) 2005 Eric Miller
|
||||
#
|
||||
# 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::Layer3::Extreme;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::MAU;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '1.01';
|
||||
|
||||
@SNMP::Info::Layer3::Extreme::ISA = qw/SNMP::Info::Layer3 SNMP::Info::MAU Exporter/;
|
||||
@SNMP::Info::Layer3::Extreme::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::MAU::MIBS,
|
||||
'EXTREME-BASE-MIB' => 'extremeAgent',
|
||||
'EXTREME-SYSTEM-MIB' => 'extremeSystem',
|
||||
'EXTREME-FDB-MIB' => 'extremeSystem',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::MAU::GLOBALS,
|
||||
'serial' => 'extremeSystemID',
|
||||
'temp' => 'extremeCurrentTemperature',
|
||||
'ps1_status' => 'extremePowerSupplyStatus.1',
|
||||
'fan' => 'extremeFanOperational.1',
|
||||
'mac' => 'dot1dBaseBridgeAddress',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::MAU::FUNCS,
|
||||
# EXTREME-FDB-MIB:extremeFdbMacFdbTable
|
||||
'fw_mac' => 'extremeFdbMacFdbMacAddress',
|
||||
'fw_port' => 'extremeFdbMacFdbPortIfIndex',
|
||||
'fw_status' => 'extremeFdbMacFdbStatus',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::MAU::MUNGE,
|
||||
);
|
||||
|
||||
# Method OverRides
|
||||
|
||||
sub bulkwalk_no { 1; }
|
||||
|
||||
*SNMP::Info::Layer3::Extreme::i_duplex = \&SNMP::Info::MAU::mau_i_duplex;
|
||||
*SNMP::Info::Layer3::Extreme::i_duplex_admin = \&SNMP::Info::MAU::mau_i_duplex_admin;
|
||||
|
||||
sub model {
|
||||
my $extreme = shift;
|
||||
my $id = $extreme->id();
|
||||
|
||||
unless (defined $id){
|
||||
print " SNMP::Info::Layer3::Extreme::model() - Device does not support sysObjectID\n" if $extreme->debug();
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'extreme';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'extreme';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $extreme = shift;
|
||||
my $descr = $extreme->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
if ($descr =~ m/Version ([\d.]*)/){
|
||||
return $1;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
# We're not using BRIDGE-MIB
|
||||
sub bp_index {
|
||||
my $extreme = shift;
|
||||
my $if_index = $extreme->i_index();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$if_index){
|
||||
$bp_index{$iid} = $iid;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
# Index values in the Q-BRIDGE-MIB are the same
|
||||
# as in the BRIDGE-MIB and do not match ifIndex.
|
||||
sub i_vlan {
|
||||
my $extreme = shift;
|
||||
my $qb_i_vlan = $extreme->qb_i_vlan();
|
||||
my $bp_index = $extreme->bp_index();
|
||||
|
||||
my %i_vlan;
|
||||
foreach my $v_index (keys %$qb_i_vlan){
|
||||
my $vlan = $qb_i_vlan->{$v_index};
|
||||
my $iid = $bp_index->{$v_index};
|
||||
|
||||
unless (defined $iid) {
|
||||
print " Port $v_index has no bp_index mapping. Skipping\n"
|
||||
if $DEBUG;
|
||||
next;
|
||||
}
|
||||
$i_vlan{$iid}=$vlan;
|
||||
}
|
||||
return \%i_vlan;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Extreme - Perl5 Interface to Extreme Network Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $extreme = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 1
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $extreme->class();
|
||||
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from an
|
||||
Extreme device through SNMP.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
|
||||
my $extreme = new SNMP::Info::Layer3::Extreme(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::MAU
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item EXTREME-BASE-MIB
|
||||
|
||||
=item EXTREME-SYSTEM-MIB
|
||||
|
||||
=item EXTREME-FDB-MIB
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See classes listed above for their required MIBs.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $extreme->bulkwalk_no
|
||||
|
||||
Return C<1>. Bulkwalk is currently turned off for this class.
|
||||
|
||||
=item $extreme->model()
|
||||
|
||||
Returns model type. Checks $extreme->id() against the EXTREME-BASE-MIB.
|
||||
|
||||
=item $extreme->vendor()
|
||||
|
||||
Returns extreme
|
||||
|
||||
=item $extreme->os()
|
||||
|
||||
Returns extreme
|
||||
|
||||
=item $extreme->serial()
|
||||
|
||||
Returns serial number
|
||||
|
||||
(B<extremeSystemID>)
|
||||
|
||||
=item $extreme->temp()
|
||||
|
||||
Returns system temperature
|
||||
|
||||
(B<extremeCurrentTemperature>)
|
||||
|
||||
=item $extreme->ps1_status()
|
||||
|
||||
Returns status of power supply 1
|
||||
|
||||
(B<extremePowerSupplyStatus.1>)
|
||||
|
||||
=item $extreme->fan()
|
||||
|
||||
Returns fan status
|
||||
|
||||
(B<extremeFanOperational.1>)
|
||||
|
||||
=item $extreme->mac()
|
||||
|
||||
Returns base mac
|
||||
|
||||
(B<dot1dBaseBridgeAddress>)
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in SNMP::Info::MAU for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $extreme->fw_mac()
|
||||
|
||||
(B<extremeFdbMacFdbMacAddress>)
|
||||
|
||||
=item $extreme->fw_port()
|
||||
|
||||
(B<extremeFdbMacFdbPortIfIndex>)
|
||||
|
||||
=item $extreme->fw_status()
|
||||
|
||||
(B<extremeFdbMacFdbStatus>)
|
||||
|
||||
=item $extreme->i_vlan()
|
||||
|
||||
Returns a mapping between ifIndex and the VLAN.
|
||||
|
||||
=item $stack->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface identifier (iid)
|
||||
|
||||
Returns (B<ifIndex>) for both key and value since we're using EXTREME-FDB-MIB
|
||||
rather than BRIDGE-MIB.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::MAU
|
||||
|
||||
See documentation in SNMP::Info::MAU for details.
|
||||
|
||||
=cut
|
||||
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::Layer3::Foundry - SNMP Interface to Foundry devices
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2004,2005 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# All rights reserved.
|
||||
@@ -30,30 +30,25 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Foundry;
|
||||
$VERSION = 0.9;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info;
|
||||
use SNMP::Info::Bridge;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::FDP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::FDP Exporter/;
|
||||
$VERSION = '1.01';
|
||||
|
||||
@SNMP::Info::Layer3::Foundry::ISA = qw/SNMP::Info::Layer3 SNMP::Info::FDP Exporter/;
|
||||
@SNMP::Info::Layer3::Foundry::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ( %SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::FDP::MIBS,
|
||||
'FOUNDRY-SN-ROOT-MIB' => 'foundry',
|
||||
'FOUNDRY-SN-AGENT-MIB' => 'snChasPwrSupplyDescription',
|
||||
# IP-FORWARD-MIB
|
||||
# ETHERLIKE-MIB
|
||||
# RFC1398-MIB
|
||||
@@ -62,9 +57,7 @@ $INIT = 0;
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
# Inherit the super class ones
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::FDP::GLOBALS,
|
||||
'mac' => 'ifPhysAddress.1',
|
||||
'chassis' => 'entPhysicalDescr.1',
|
||||
@@ -81,14 +74,9 @@ $INIT = 0;
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::FUNCS,
|
||||
%SNMP::Info::Bridge::FUNCS,
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::FDP::FUNCS,
|
||||
'i_name2' => 'ifName',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
# FOUNDRY-MIB
|
||||
# snSwPortInfoTable - Switch Port Information Group
|
||||
'sw_index' => 'snSwPortIfIndex',
|
||||
@@ -99,8 +87,7 @@ $INIT = 0;
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::MUNGE,
|
||||
%SNMP::Info::Bridge::MUNGE,
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::FDP::MUNGE,
|
||||
'at_paddr' => \&SNMP::Info::munge_mac,
|
||||
);
|
||||
@@ -108,6 +95,8 @@ $INIT = 0;
|
||||
|
||||
# Method OverRides
|
||||
|
||||
sub bulkwalk_no { 1; }
|
||||
|
||||
# Add our i_aliases if they are set (manually)
|
||||
sub i_name {
|
||||
my $foundry = shift;
|
||||
@@ -145,6 +134,10 @@ sub i_duplex {
|
||||
my $foundry = shift;
|
||||
my $sw_index = $foundry->sw_index();
|
||||
my $sw_duplex= $foundry->sw_duplex();
|
||||
|
||||
unless (defined $sw_index and defined $sw_duplex){
|
||||
return $foundry->SUPER::i_duplex();
|
||||
}
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $sw_port (keys %$sw_duplex){
|
||||
@@ -161,6 +154,10 @@ sub i_type {
|
||||
my $foundry = shift;
|
||||
my $sw_index = $foundry->sw_index();
|
||||
my $sw_type= $foundry->sw_type();
|
||||
|
||||
unless (defined $sw_index and defined $sw_type){
|
||||
return $foundry->SUPER::i_type();
|
||||
}
|
||||
|
||||
my %i_type;
|
||||
foreach my $sw_port (keys %$sw_type){
|
||||
@@ -176,6 +173,10 @@ sub i_speed {
|
||||
my $foundry = shift;
|
||||
my $sw_index = $foundry->sw_index();
|
||||
my $sw_speed= $foundry->sw_speed();
|
||||
|
||||
unless (defined $sw_index and defined $sw_speed){
|
||||
return $foundry->SUPER::i_speed();
|
||||
}
|
||||
|
||||
my %i_speed;
|
||||
foreach my $sw_port (keys %$sw_speed){
|
||||
@@ -201,7 +202,9 @@ sub model {
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
$model = $1 if $desc =~ /\s+([a-z]{2}\d{4})\D/i;
|
||||
|
||||
$model = $1 if $desc =~ /\b(FW[A-Z\d]+)/;
|
||||
|
||||
$model =~ s/^sn//;
|
||||
|
||||
return $model;
|
||||
}
|
||||
@@ -246,6 +249,7 @@ sub interfaces {
|
||||
sub vendor {
|
||||
return 'foundry';
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
@@ -255,7 +259,7 @@ SNMP::Info::Layer3::Foundry - Perl5 Interface to Foundry FastIron Network Device
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -271,15 +275,14 @@ Max Baker (C<max@warped.org>)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $foundry->class();
|
||||
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This subclass no longer supported.
|
||||
This module provides limited functionality from some L2+L3 and L3 Foundry devices.
|
||||
|
||||
This module provides limited functionality from older Foundry devices.
|
||||
|
||||
Specifically designed for a FI4802.
|
||||
Specifically designed for a FI4802. Works on a FWSX424.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above. Turn off the AutoSpecify flag.
|
||||
@@ -292,7 +295,6 @@ a more specific class using the method above. Turn off the AutoSpecify flag.
|
||||
|
||||
=item SNMP::Info
|
||||
|
||||
=item SNMP::Info::Bridge
|
||||
|
||||
=back
|
||||
|
||||
@@ -373,10 +375,6 @@ Returns the status of the chassis fan.
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
@@ -482,8 +480,4 @@ Returns reference to hash. Current Port Speed.
|
||||
|
||||
See documentation in SNMP::Info for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Bridge
|
||||
|
||||
See documentation in SNMP::Info::Bridge for details.
|
||||
|
||||
=cut
|
||||
|
||||
179
Info/Layer3/Juniper.pm
Normal file
179
Info/Layer3/Juniper.pm
Normal file
@@ -0,0 +1,179 @@
|
||||
# SNMP::Info::Layer3::Juniper
|
||||
# Bill Fenner
|
||||
#
|
||||
#
|
||||
# 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::Juniper;
|
||||
# $Id$
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
|
||||
@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 Exporter/;
|
||||
@SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::Layer3::MIBS,
|
||||
'JUNIPER-CHASSIS-DEFINES-MIB' => 'jnxChassisDefines',
|
||||
'JUNIPER-MIB' => 'jnxBoxAnatomy',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
'serial' => 'jnxBoxSerialNo.0',
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
);
|
||||
|
||||
sub vendor {
|
||||
return 'juniper';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'junos';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $juniper = shift;
|
||||
my $descr = $juniper->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
if ($descr =~ m/kernel JUNOS (\S+)/) {
|
||||
return $1;
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub model {
|
||||
my $l3 = shift;
|
||||
my $id = $l3->id();
|
||||
|
||||
unless (defined $id){
|
||||
print " SNMP::Info::Layer3::Juniper::model() - Device does not support sysObjectID\n" if $l3->debug();
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^jnxProductName//i;
|
||||
return $model;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Juniper - Perl5 Interface to L3 Juniper Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Bill Fenner
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $juniper = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myrouter',
|
||||
Community => 'public',
|
||||
Version => 2
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $juniper->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Subclass for Generic Juniper Routers running JUNOS
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See L<SNMP::Info::Layer3> for its own MIB requirements.
|
||||
|
||||
=back
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $juniper->vendor()
|
||||
|
||||
Returns 'juniper'
|
||||
|
||||
=item $juniper->os()
|
||||
|
||||
Returns 'junos'
|
||||
|
||||
=item $juniper->os_ver()
|
||||
|
||||
Returns the software version extracted from sysDescr.
|
||||
|
||||
=item $juniper->model()
|
||||
|
||||
Returns the model from sysObjectID, with jnxProductName
|
||||
removed from the beginning.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in L<SNMP::Info::Layer3> for details.
|
||||
|
||||
=cut
|
||||
320
Info/Layer3/N1600.pm
Normal file
320
Info/Layer3/N1600.pm
Normal file
@@ -0,0 +1,320 @@
|
||||
# SNMP::Info::Layer3::N1600 - SNMP Interface to Nortel N16XX devices
|
||||
# Eric Miller
|
||||
#
|
||||
# Copyright (c) 2004,2005 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::Layer3::N1600;
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
use SNMP::Info::Layer3;
|
||||
use SNMP::Info::SONMP;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
|
||||
$VERSION = '1.01';
|
||||
|
||||
@SNMP::Info::Layer3::N1600::ISA = qw/SNMP::Info::Layer3 SNMP::Info::SONMP Exporter/;
|
||||
@SNMP::Info::Layer3::N1600::EXPORT_OK = qw//;
|
||||
|
||||
%MIBS = ( %SNMP::Info::Layer3::MIBS,
|
||||
%SNMP::Info::SONMP::MIBS,
|
||||
'SWL2MGMT-MIB' => 'swL2MgmtMIB',
|
||||
'RAPID-CITY' => 'rapidCity',
|
||||
);
|
||||
|
||||
%GLOBALS = (
|
||||
%SNMP::Info::Layer3::GLOBALS,
|
||||
%SNMP::Info::SONMP::GLOBALS,
|
||||
);
|
||||
|
||||
%FUNCS = (
|
||||
%SNMP::Info::Layer3::FUNCS,
|
||||
%SNMP::Info::SONMP::FUNCS,
|
||||
# SWL2MGMT-MIB
|
||||
# swL2PortInfoTable
|
||||
'n1600_nway_status' => 'swL2PortInfoNwayStatus',
|
||||
# swL2PortCtrlTable
|
||||
'n1600_nway_state' => 'swL2PortCtrlNwayState',
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
# Inherit all the built in munging
|
||||
%SNMP::Info::Layer3::MUNGE,
|
||||
%SNMP::Info::SONMP::MUNGE,
|
||||
);
|
||||
|
||||
# Method OverRides
|
||||
|
||||
sub bulkwalk_no { 1; }
|
||||
|
||||
sub model {
|
||||
my $n1600 = shift;
|
||||
my $id = $n1600->id();
|
||||
|
||||
unless (defined $id){
|
||||
print " SNMP::Info::Layer3::N1600::model() - Device does not support sysObjectID\n" if $n1600->debug();
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^rcA//i;
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
return 'nortel';
|
||||
}
|
||||
|
||||
sub os {
|
||||
return 'passport';
|
||||
}
|
||||
|
||||
sub os_ver {
|
||||
my $n1600 = shift;
|
||||
my $descr = $n1600->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
if ($descr =~ m/(\d+\.\d+\.\d+\.\d+)/){
|
||||
return $1;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub interfaces {
|
||||
my $n1600 = shift;
|
||||
my $i_index = $n1600->i_index();
|
||||
|
||||
my %if;
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
my $slotport = "1.$index";
|
||||
$if{$iid} = $slotport;
|
||||
}
|
||||
return \%if;
|
||||
}
|
||||
|
||||
sub i_duplex {
|
||||
my $n1600 = shift;
|
||||
my $nway_status = $n1600->n1600_nway_status();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $iid (keys %$nway_status){
|
||||
my $duplex = $nway_status->{$iid};
|
||||
next unless defined $duplex;
|
||||
next if $duplex =~ /other/i;
|
||||
$i_duplex{$iid} = 'half' if $duplex =~ /half/i;
|
||||
$i_duplex{$iid} = 'full' if $duplex =~ /full/i;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
|
||||
sub i_duplex_admin {
|
||||
my $n1600 = shift;
|
||||
my $nway_state = $n1600->n1600_nway_state();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $iid (keys %$nway_state){
|
||||
my $duplex = $nway_state->{$iid};
|
||||
next unless defined $duplex;
|
||||
next if $duplex =~ /other/i;
|
||||
$i_duplex{$iid} = 'half' if $duplex =~ /half/i;
|
||||
$i_duplex{$iid} = 'full' if $duplex =~ /full/i;
|
||||
$i_duplex{$iid} = 'auto' if $duplex =~ /nway-enabled/i;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
|
||||
# Required for SNMP::Info::SONMP
|
||||
sub index_factor {
|
||||
return 64;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::N1600 - Perl5 Interface to Nortel 16XX Network Devices
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
# Let SNMP::Info determine the correct subclass for you.
|
||||
my $n1600 = new SNMP::Info(
|
||||
AutoSpecify => 1,
|
||||
Debug => 1,
|
||||
# These arguments are passed directly on to SNMP::Session
|
||||
DestHost => 'myswitch',
|
||||
Community => 'public',
|
||||
Version => 1
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $n1600->class();
|
||||
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Provides abstraction to the configuration information obtainable from a Nortel
|
||||
N16XX device through SNMP.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
|
||||
my $n1600 = new SNMP::Info::Layer3::N1600(...);
|
||||
|
||||
=head2 Inherited Classes
|
||||
|
||||
=over
|
||||
|
||||
=item SNMP::Info::Layer3
|
||||
|
||||
=item SNMP::Info::SONMP
|
||||
|
||||
=back
|
||||
|
||||
=head2 Required MIBs
|
||||
|
||||
=over
|
||||
|
||||
=item SWL2MGMT-MIB
|
||||
|
||||
=item RAPID-CITY
|
||||
|
||||
=item Inherited Classes' MIBs
|
||||
|
||||
See classes listed above for their required MIBs.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found on the CD that came with your product.
|
||||
|
||||
Or, they can be downloaded directly from Nortel regardless of support
|
||||
contract status.
|
||||
|
||||
Go to http://www.nortel.com Techninal Support, Browse Technical Support,
|
||||
Select by product, Java Device Manager, Software. Download the latest version.
|
||||
After installation, all mibs are located under the install directory under mibs
|
||||
and the repspective product line.
|
||||
|
||||
=head1 GLOBALS
|
||||
|
||||
These are methods that return scalar value from SNMP
|
||||
|
||||
=over
|
||||
|
||||
=item $n1600->bulkwalk_no
|
||||
|
||||
Return C<1>. Bulkwalk is currently turned off for this class.
|
||||
|
||||
=item $n1600->model()
|
||||
|
||||
Returns model type. Checks $n1600->id() against the
|
||||
RAPID-CITY-MIB and then parses out rcA.
|
||||
|
||||
=item $n1600->vendor()
|
||||
|
||||
Returns 'nortel'
|
||||
|
||||
=item $n1600->os()
|
||||
|
||||
Returns 'passport'
|
||||
|
||||
=back
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $n1600->index_factor()
|
||||
|
||||
Required by SNMP::Info::SONMP. Number representing the number of ports
|
||||
reserved per slot within the device MIB.
|
||||
|
||||
Returns 64 since largest switch has 48 ports. Since these switches can
|
||||
not stack, the only requirment to reserve more than the max number of ports.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Globals imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Globals imported from SNMP::Info::SONMP
|
||||
|
||||
See documentation in SNMP::SONMP::Layer3 for details.
|
||||
|
||||
=head1 TABLE ENTRIES
|
||||
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
=head2 Overrides
|
||||
|
||||
=over
|
||||
|
||||
=item $n1600->interfaces()
|
||||
|
||||
Returns reference to hash of interface names to iids.
|
||||
|
||||
Places a 1 in front of index number. This is required for compatibilty with
|
||||
SNMP::Info::SONMP.
|
||||
|
||||
=item $n1600->i_duplex()
|
||||
|
||||
Returns reference to hash of interface operational link duplex status.
|
||||
|
||||
=item $n1600->i_duplex_admin()
|
||||
|
||||
Returns reference to hash of interface administrative link duplex status.
|
||||
|
||||
=back
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::Layer3
|
||||
|
||||
See documentation in SNMP::Info::Layer3 for details.
|
||||
|
||||
=head2 Table Methods imported from SNMP::Info::SONMP
|
||||
|
||||
See documentation in SNMP::Info::SONMP for details.
|
||||
|
||||
=cut
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::Layer3::Passport
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller, Max Baker
|
||||
# All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
@@ -29,7 +29,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::Layer3::Passport;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -44,13 +44,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
|
||||
@SNMP::Info::Layer3::Passport::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::SONMP SNMP::Info::RapidCity Exporter/;
|
||||
@SNMP::Info::Layer3::Passport::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
# See SNMP::Info for the details of these data structures and
|
||||
# the interworkings.
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
%SNMP::Info::MIBS,
|
||||
%SNMP::Info::Bridge::MIBS,
|
||||
@@ -63,7 +56,7 @@ $INIT = 0;
|
||||
%SNMP::Info::GLOBALS,
|
||||
%SNMP::Info::Bridge::GLOBALS,
|
||||
%SNMP::Info::SONMP::GLOBALS,
|
||||
%SNMP::Info::RapidCity::GLOBALS,
|
||||
%SNMP::Info::RapidCity::GLOBALS,
|
||||
'router_ip' => 'ospfRouterId'
|
||||
);
|
||||
|
||||
@@ -74,14 +67,14 @@ $INIT = 0;
|
||||
%SNMP::Info::RapidCity::FUNCS,
|
||||
'i_index2' => 'ifIndex',
|
||||
'i_mac2' => 'ifPhysAddress',
|
||||
'i_description2' => 'ifDescr',
|
||||
'i_description2' => 'ifDescr',
|
||||
'i_name2' => 'ifName',
|
||||
'ip_index2' => 'ipAdEntIfIndex',
|
||||
# From RFC1213-MIB
|
||||
'at_index' => 'ipNetToMediaIfIndex',
|
||||
'at_paddr' => 'ipNetToMediaPhysAddress',
|
||||
'at_netaddr' => 'ipNetToMediaNetAddress',
|
||||
'i_name2' => 'ifName'
|
||||
'i_name2' => 'ifName'
|
||||
);
|
||||
|
||||
%MUNGE = (
|
||||
@@ -95,15 +88,19 @@ $INIT = 0;
|
||||
|
||||
sub model {
|
||||
my $passport = shift;
|
||||
my $desc = $passport->description();
|
||||
return undef unless defined $desc;
|
||||
|
||||
return '8603' if ($desc =~ /8603/);
|
||||
return '8606' if ($desc =~ /8606/);
|
||||
return '8610co' if ($desc =~ /8610co/);
|
||||
return '8610' if ($desc =~ /8610/);
|
||||
my $id = $passport->id();
|
||||
|
||||
return $desc;
|
||||
unless (defined $id){
|
||||
print " SNMP::Info::Layer3::Passport::model() - Device does not support sysObjectID\n" if $passport->debug();
|
||||
return undef;
|
||||
}
|
||||
|
||||
my $model = &SNMP::translateObj($id);
|
||||
|
||||
return $id unless defined $model;
|
||||
|
||||
$model =~ s/^rcA//i;
|
||||
return $model;
|
||||
}
|
||||
|
||||
sub vendor {
|
||||
@@ -119,14 +116,21 @@ sub os_ver {
|
||||
my $descr = $passport->description();
|
||||
return undef unless defined $descr;
|
||||
|
||||
#Passport
|
||||
if ($descr =~ m/(\d+\.\d+\.\d+\.\d+)/){
|
||||
return $1;
|
||||
}
|
||||
#Accelar
|
||||
if ($descr =~ m/(\d+\.\d+\.\d+)/){
|
||||
return $1;
|
||||
}
|
||||
|
||||
return undef;
|
||||
}
|
||||
|
||||
sub i_index {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $i_index = $passport->i_index2();
|
||||
my $vlan_index = $passport->rc_vlan_if();
|
||||
my $cpu_index = $passport->rc_cpu_ifindex();
|
||||
@@ -136,8 +140,8 @@ sub i_index {
|
||||
foreach my $iid (keys %$i_index){
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
$if_index{$iid} = $index;
|
||||
|
||||
$if_index{$iid} = $index;
|
||||
}
|
||||
|
||||
# Get VLAN Virtual Router Interfaces
|
||||
@@ -149,19 +153,22 @@ sub i_index {
|
||||
$if_index{$v_index} = $v_index;
|
||||
}
|
||||
|
||||
# Get CPU Ethernet Interfaces
|
||||
foreach my $cid (keys %$cpu_index){
|
||||
my $c_index = $cpu_index->{$cid};
|
||||
next unless defined $c_index;
|
||||
next if $c_index == 0;
|
||||
if (defined $model and $model =~ /(86)/) {
|
||||
|
||||
$if_index{$c_index} = $c_index;
|
||||
}
|
||||
# Get CPU Ethernet Interfaces
|
||||
foreach my $cid (keys %$cpu_index){
|
||||
my $c_index = $cpu_index->{$cid};
|
||||
next unless defined $c_index;
|
||||
next if $c_index == 0;
|
||||
|
||||
# Check for Virtual Mgmt Interface
|
||||
unless ($virt_ip eq '0.0.0.0') {
|
||||
# Make up an index number, 1 is not reserved AFAIK
|
||||
$if_index{1} = 1;
|
||||
$if_index{$c_index} = $c_index;
|
||||
}
|
||||
|
||||
# Check for Virtual Mgmt Interface
|
||||
unless ($virt_ip eq '0.0.0.0') {
|
||||
# Make up an index number, 1 is not reserved AFAIK
|
||||
$if_index{1} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return \%if_index;
|
||||
@@ -169,10 +176,12 @@ sub i_index {
|
||||
|
||||
sub interfaces {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $index_factor = $passport->index_factor();
|
||||
my $port_offset = $passport->port_offset();
|
||||
my $i_index = $passport->i_index();
|
||||
my $vlan_id = $passport->rc_vlan_id();
|
||||
my $vlan_index = $passport->rc_vlan_if();
|
||||
my $model = $passport->model();
|
||||
|
||||
my %reverse_vlan = reverse %$vlan_index;
|
||||
|
||||
@@ -181,37 +190,37 @@ sub interfaces {
|
||||
my $index = $i_index->{$iid};
|
||||
next unless defined $index;
|
||||
|
||||
if ($index == 1) {
|
||||
$if{$index} = 'CPU.Virtual';
|
||||
if (($index == 1) and ($model =~ /(86)/)) {
|
||||
$if{$index} = 'Cpu.Virtual';
|
||||
}
|
||||
|
||||
elsif (($index == 192) and ($model eq '8603')) {
|
||||
$if{$index} = 'CPU3';
|
||||
$if{$index} = 'Cpu.3';
|
||||
}
|
||||
|
||||
elsif ($index == 320) {
|
||||
$if{$index} = 'CPU5';
|
||||
elsif (($index == 320) and ($model =~ /(8606|8610|8610co)/)) {
|
||||
$if{$index} = 'Cpu.5';
|
||||
}
|
||||
|
||||
elsif ($index == 384) {
|
||||
$if{$index} = 'CPU6';
|
||||
elsif (($index == 384) and ($model =~ /(8606|8610|8610co)/)) {
|
||||
$if{$index} = 'Cpu.6';
|
||||
}
|
||||
|
||||
elsif ($index > 2000) {
|
||||
my $vlan_index = $reverse_vlan{$iid};
|
||||
my $v_id = $vlan_id->{$vlan_index};
|
||||
next unless defined $v_id;
|
||||
|
||||
my $v_port = 'V'."$v_id";
|
||||
$if{$index} = $v_port;
|
||||
elsif (($index > 2000 and $model =~ /(86|81)/) or
|
||||
($index > 256 and $model =~ /(105|11|12)/)) {
|
||||
my $vlan_index = $reverse_vlan{$iid};
|
||||
my $v_id = $vlan_id->{$vlan_index};
|
||||
next unless defined $v_id;
|
||||
my $v_port = 'Vlan'."$v_id";
|
||||
$if{$index} = $v_port;
|
||||
}
|
||||
|
||||
else {
|
||||
my $port = ($index % 64) + 1;
|
||||
my $slot = int($index / 64);
|
||||
my $port = ($index % $index_factor) + $port_offset;
|
||||
my $slot = int($index / $index_factor);
|
||||
|
||||
my $slotport = "$slot.$port";
|
||||
$if{$iid} = $slotport;
|
||||
my $slotport = "$slot.$port";
|
||||
$if{$iid} = $slotport;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -220,6 +229,7 @@ sub interfaces {
|
||||
|
||||
sub i_mac {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $i_mac = $passport->i_mac2();
|
||||
my $vlan_mac = $passport->rc_vlan_mac();
|
||||
my $vlan_index = $passport->rc_vlan_if();
|
||||
@@ -232,7 +242,7 @@ sub i_mac {
|
||||
my $mac = $i_mac->{$iid};
|
||||
next unless defined $mac;
|
||||
|
||||
$if_mac{$iid} = $mac;
|
||||
$if_mac{$iid} = $mac;
|
||||
}
|
||||
|
||||
# Get VLAN Virtual Router Interfaces
|
||||
@@ -243,28 +253,30 @@ sub i_mac {
|
||||
|
||||
$if_mac{$v_id} = $v_mac;
|
||||
}
|
||||
|
||||
if (defined $model and $model =~ /(86)/) {
|
||||
# Get CPU Ethernet Interfaces
|
||||
foreach my $iid (keys %$cpu_mac){
|
||||
my $mac = $cpu_mac->{$iid};
|
||||
next unless defined $mac;
|
||||
|
||||
# Get CPU Ethernet Interfaces
|
||||
foreach my $iid (keys %$cpu_mac){
|
||||
my $mac = $cpu_mac->{$iid};
|
||||
next unless defined $mac;
|
||||
$if_mac{$iid} = $mac;
|
||||
}
|
||||
|
||||
$if_mac{$iid} = $mac;
|
||||
}
|
||||
# Check for Virtual Mgmt Interface
|
||||
unless ($virt_ip eq '0.0.0.0'){
|
||||
my @virt_mac = split /:/, $chassis_base_mac;
|
||||
$virt_mac[0] = hex($virt_mac[0]);
|
||||
$virt_mac[1] = hex($virt_mac[1]);
|
||||
$virt_mac[2] = hex($virt_mac[2]);
|
||||
$virt_mac[3] = hex($virt_mac[3]);
|
||||
$virt_mac[4] = hex($virt_mac[4]) + 0x03;
|
||||
$virt_mac[5] = hex($virt_mac[5]) + 0xF8;
|
||||
|
||||
# Check for Virtual Mgmt Interface
|
||||
unless ($virt_ip eq '0.0.0.0'){
|
||||
my @virt_mac = split /:/, $chassis_base_mac;
|
||||
$virt_mac[0] = hex($virt_mac[0]);
|
||||
$virt_mac[1] = hex($virt_mac[1]);
|
||||
$virt_mac[2] = hex($virt_mac[2]);
|
||||
$virt_mac[3] = hex($virt_mac[3]);
|
||||
$virt_mac[4] = hex($virt_mac[4]) + 0x03;
|
||||
$virt_mac[5] = hex($virt_mac[5]) + 0xF8;
|
||||
my $mac = join(':',map { sprintf "%02x",$_ } @virt_mac);
|
||||
|
||||
my $mac = join(':',map { sprintf "%02x",$_ } @virt_mac);
|
||||
|
||||
$if_mac{1} = $mac;
|
||||
$if_mac{1} = $mac;
|
||||
}
|
||||
}
|
||||
|
||||
return \%if_mac;
|
||||
@@ -281,7 +293,7 @@ sub i_description {
|
||||
my $if_descr = $i_descr->{$iid};
|
||||
next unless defined $if_descr;
|
||||
|
||||
$descr{$iid} = $if_descr;
|
||||
$descr{$iid} = $if_descr;
|
||||
}
|
||||
|
||||
# Get VLAN Virtual Router Interfaces
|
||||
@@ -297,49 +309,51 @@ sub i_description {
|
||||
|
||||
sub i_name {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $i_index = $passport->i_index();
|
||||
my $rc_alias = $passport->rc_alias();
|
||||
my $i_name2 = $passport->i_name2();
|
||||
my $v_name = $passport->rc_vlan_name();
|
||||
my $vlan_index = $passport->rc_vlan_if();
|
||||
my $model = $passport->model();
|
||||
|
||||
|
||||
my %reverse_vlan = reverse %$vlan_index;
|
||||
|
||||
my %i_name;
|
||||
foreach my $iid (keys %$i_index){
|
||||
|
||||
if ($iid == 1) {
|
||||
$i_name{$iid} = 'CPU Virtual Management IP';
|
||||
|
||||
if (($iid == 1) and ($model =~ /(86)/)) {
|
||||
$i_name{$iid} = 'CPU Virtual Management IP';
|
||||
}
|
||||
|
||||
elsif (($iid == 192) and ($model eq '8603')) {
|
||||
$i_name{$iid} = 'CPU 3 Ethernet Port';
|
||||
}
|
||||
|
||||
elsif ($iid == 320) {
|
||||
$i_name{$iid} = 'CPU 5 Ethernet Port';
|
||||
elsif (($iid == 320) and ($model =~ /(8606|8610|8610co)/)) {
|
||||
$i_name{$iid} = 'CPU 5 Ethernet Port';
|
||||
}
|
||||
|
||||
elsif ($iid == 384) {
|
||||
$i_name{$iid} = 'CPU 5 Ethernet Port';
|
||||
elsif (($iid == 384) and ($model =~ /(8606|8610|8610co)/)) {
|
||||
$i_name{$iid} = 'CPU 6 Ethernet Port';
|
||||
}
|
||||
|
||||
elsif ($iid > 2000) {
|
||||
my $vlan_index = $reverse_vlan{$iid};
|
||||
my $vlan_name = $v_name->{$vlan_index};
|
||||
next unless defined $vlan_name;
|
||||
elsif (($iid > 2000 and defined $model and $model =~ /(86|81)/) or
|
||||
($iid > 256 and defined $model and $model =~ /(105|11|12)/)) {
|
||||
my $vlan_index = $reverse_vlan{$iid};
|
||||
my $vlan_name = $v_name->{$vlan_index};
|
||||
next unless defined $vlan_name;
|
||||
|
||||
$i_name{$iid} = $vlan_name;
|
||||
}
|
||||
$i_name{$iid} = $vlan_name;
|
||||
}
|
||||
|
||||
else {
|
||||
my $name = $i_name2->{$iid};
|
||||
my $alias = $rc_alias->{$iid};
|
||||
$i_name{$iid} = (defined $alias and $alias !~ /^\s*$/) ?
|
||||
my $name = $i_name2->{$iid};
|
||||
my $alias = $rc_alias->{$iid};
|
||||
$i_name{$iid} = (defined $alias and $alias !~ /^\s*$/) ?
|
||||
$alias :
|
||||
$name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return \%i_name;
|
||||
@@ -347,6 +361,7 @@ sub i_name {
|
||||
|
||||
sub ip_index {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $ip_index = $passport->ip_index2();
|
||||
my $cpu_ip = $passport->rc_cpu_ip();
|
||||
my $virt_ip = $passport->rc_virt_ip();
|
||||
@@ -356,25 +371,29 @@ sub ip_index {
|
||||
my $iid = $ip_index->{$ip};
|
||||
next unless defined $iid;
|
||||
|
||||
$ip_index{$ip} = $iid;
|
||||
$ip_index{$ip} = $iid;
|
||||
}
|
||||
|
||||
# Get CPU Ethernet IP
|
||||
foreach my $cid (keys %$cpu_ip){
|
||||
my $c_ip = $cpu_ip->{$cid};
|
||||
next unless defined $c_ip;
|
||||
# Only 8600 has CPU and Virtual Management IP
|
||||
if (defined $model and $model =~ /(86)/) {
|
||||
# Get CPU Ethernet IP
|
||||
foreach my $cid (keys %$cpu_ip){
|
||||
my $c_ip = $cpu_ip->{$cid};
|
||||
next unless defined $c_ip;
|
||||
|
||||
$ip_index{$c_ip} = $cid;
|
||||
$ip_index{$c_ip} = $cid;
|
||||
}
|
||||
|
||||
# Get Virtual Mgmt IP
|
||||
$ip_index{$virt_ip} = 1;
|
||||
}
|
||||
|
||||
# Get Virtual Mgmt IP
|
||||
$ip_index{$virt_ip} = 1;
|
||||
|
||||
return \%ip_index;
|
||||
}
|
||||
|
||||
sub root_ip {
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $rc_ip_addr = $passport->rc_ip_addr();
|
||||
my $rc_ip_type = $passport->rc_ip_type();
|
||||
my $virt_ip = $passport->rc_virt_ip();
|
||||
@@ -382,35 +401,51 @@ sub root_ip {
|
||||
my $sonmp_topo_port = $passport->sonmp_topo_port();
|
||||
my $sonmp_topo_ip = $passport->sonmp_topo_ip();
|
||||
|
||||
# Return CLIP (CircuitLess IP)
|
||||
foreach my $iid (keys %$rc_ip_type){
|
||||
my $ip_type = $rc_ip_type->{$iid};
|
||||
next unless ((defined $ip_type) and ($ip_type =~ /circuitLess/i));
|
||||
my $ip = $rc_ip_addr->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
return $ip;
|
||||
# Only 8600 has CLIP or Management Virtual IP
|
||||
if (defined $model and $model =~ /(86)/) {
|
||||
# Return CLIP (CircuitLess IP)
|
||||
foreach my $iid (keys %$rc_ip_type){
|
||||
my $ip_type = $rc_ip_type->{$iid};
|
||||
next unless ((defined $ip_type) and ($ip_type =~ /circuitLess/i));
|
||||
my $ip = $rc_ip_addr->{$iid};
|
||||
next unless defined $ip;
|
||||
|
||||
return $ip if $passport->snmp_connect_ip($ip);
|
||||
}
|
||||
|
||||
# Return Management Virtual IP address
|
||||
if ( (defined $virt_ip) and ($virt_ip ne '0.0.0.0') ) {
|
||||
return $virt_ip if $passport->snmp_connect_ip($virt_ip);
|
||||
}
|
||||
}
|
||||
|
||||
# Return Management Virtual IP address
|
||||
return $virt_ip if ((defined $virt_ip) and ($virt_ip ne '0.0.0.0'));
|
||||
|
||||
# Return OSPF Router ID
|
||||
return $router_ip if ((defined $router_ip) and ($router_ip ne '0.0.0.0'));
|
||||
if ((defined $router_ip) and ($router_ip ne '0.0.0.0')) {
|
||||
foreach my $iid (keys %$rc_ip_addr){
|
||||
my $ip = $rc_ip_addr->{$iid};
|
||||
next unless $router_ip eq $ip;
|
||||
return $router_ip if $passport->snmp_connect_ip($router_ip);
|
||||
}
|
||||
}
|
||||
|
||||
# Otherwise Return SONMP Advertised IP Address
|
||||
foreach my $entry (keys %$sonmp_topo_port){
|
||||
my $port = $sonmp_topo_port->{$entry};
|
||||
next unless $port == 0;
|
||||
my $ip = $sonmp_topo_ip->{$entry};
|
||||
return $ip if ((defined $ip) and ($ip ne '0.0.0.0'));
|
||||
return $ip if ( (defined $ip) and ($ip ne '0.0.0.0') and ($passport->snmp_connect_ip($ip)) );
|
||||
}
|
||||
return undef;
|
||||
}
|
||||
|
||||
# Required for SNMP::Info::SONMP
|
||||
sub index_factor {
|
||||
return 64;
|
||||
my $passport = shift;
|
||||
my $model = $passport->model();
|
||||
my $index_factor = 64;
|
||||
# Older Accelar models use base 16 instead of 64
|
||||
$index_factor = 16 if (defined $model and $model =~ /(105|11|12)/);
|
||||
return $index_factor;
|
||||
}
|
||||
|
||||
sub slot_offset {
|
||||
@@ -421,17 +456,29 @@ sub port_offset {
|
||||
return 1;
|
||||
}
|
||||
|
||||
# Bridge MIB does not map Bridge Port to ifIndex correctly
|
||||
sub bp_index {
|
||||
my $passport = shift;
|
||||
my $if_index = $passport->i_index();
|
||||
|
||||
my %bp_index;
|
||||
foreach my $iid (keys %$if_index){
|
||||
$bp_index{$iid} = $iid;
|
||||
}
|
||||
return \%bp_index;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer3::Passport - Perl5 Interface to Nortel Networks' Passport
|
||||
8600 Series Switches
|
||||
SNMP::Info::Layer3::Passport - Perl5 Interface to modular Nortel Ethernet Routing
|
||||
Switches (formerly Passport / Accelar)
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -446,18 +493,20 @@ Eric Miller (C<eric@jeneric.org>)
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $passport->class();
|
||||
my $class = $passport->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
Abstraction subclass for Nortel Networks' Passport 8600 Series Switches.
|
||||
Abstraction subclass for modular Nortel Ethernet Routing Switches (formerly
|
||||
Passport and Accelar Series Switches).
|
||||
|
||||
These devices run Passport OS but have some of the same charactersitics as the Baystack family.
|
||||
For example, extended interface information is gleened from RAPID-CITY.
|
||||
These devices have some of the same charactersitics as the stackable Nortel
|
||||
Ethernet Switches (Baystack). For example, extended interface information is
|
||||
gleened from RAPID-CITY.
|
||||
|
||||
For speed or debugging purposes you can call the subclass directly, but not after determining
|
||||
a more specific class using the method above.
|
||||
For speed or debugging purposes you can call the subclass directly, but not after
|
||||
determining a more specific class using the method above.
|
||||
|
||||
my $passport = new SNMP::Info::Layer3::Passport(...);
|
||||
|
||||
@@ -503,15 +552,16 @@ These are methods that return scalar value from SNMP
|
||||
|
||||
=item $passport->model()
|
||||
|
||||
Returns the model extracted from B<sysDescr>
|
||||
Returns model type. Checks $passport->id() against the
|
||||
RAPID-CITY-MIB and then parses out rcA.
|
||||
|
||||
=item $passport->vendor()
|
||||
|
||||
Returns 'Nortel'
|
||||
Returns 'nortel'
|
||||
|
||||
=item $passport->os()
|
||||
|
||||
Returns 'Passport'
|
||||
Returns 'passport'
|
||||
|
||||
=item $passport->os_ver()
|
||||
|
||||
@@ -535,7 +585,7 @@ OSPF Router ID (B<ospfRouterId>), SONMP Advertised IP Address.
|
||||
|
||||
=item $passport->index_factor()
|
||||
|
||||
Required by SNMP::Info::SONMP. Returns 64.
|
||||
Required by SNMP::Info::SONMP. Returns 64 for 8600, 16 for Accelar.
|
||||
|
||||
=item $passport->port_offset()
|
||||
|
||||
@@ -583,10 +633,10 @@ to ensure the virtual router ports are captured.
|
||||
Returns reference to the map between IID and physical Port.
|
||||
|
||||
Slot and port numbers on the Passport switches are determined by the formula:
|
||||
port = (ifIndex % 64) + 1, slot = int(ifIndex / 64).
|
||||
port = (ifIndex % index_factor) + port_offset, slot = int(ifIndex / index_factor).
|
||||
|
||||
The physical port name is returned as slot.port. CPU Ethernet ports are prefixed
|
||||
with CPU and VLAN interfaces are returned as the VLAN ID prefixed with V.
|
||||
with CPU and VLAN interfaces are returned as the VLAN ID prefixed with Vlan.
|
||||
|
||||
=item $passport->i_mac()
|
||||
|
||||
@@ -608,6 +658,13 @@ name if exists.
|
||||
Maps the IP Table to the IID. Extends (B<ipAdEntIfIndex>) by adding the index of
|
||||
the CPU virtual management IP (if present) and each CPU Ethernet port.
|
||||
|
||||
=item $passport->bp_index()
|
||||
|
||||
Returns reference to hash of bridge port table entries map back to interface identifier (iid)
|
||||
|
||||
Returns (B<ifIndex>) for both key and value since some devices seem to have
|
||||
problems with BRIDGE-MIB
|
||||
|
||||
=back
|
||||
|
||||
=head2 RFC1213 Arp Cache Table (B<ipNetToMediaTable>)
|
||||
|
||||
197
Info/MAU.pm
197
Info/MAU.pm
@@ -1,7 +1,7 @@
|
||||
# SNMP::Info::MAU - Media Access Unit - RFC2668
|
||||
# Max Baker <max@warped.org>
|
||||
# SNMP::Info::MAU - Media Access Unit - RFC 2668
|
||||
# Max Baker
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker changes from version 0.8 and beyond.
|
||||
# Copyright (c) 2004,2005 Max Baker changes from version 0.8 and beyond.
|
||||
#
|
||||
# Copyright (c) 2002,2003 Regents of the University of California
|
||||
# All rights reserved.
|
||||
@@ -30,7 +30,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::MAU;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
# $Id$
|
||||
|
||||
use strict;
|
||||
@@ -42,11 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
|
||||
@SNMP::Info::MAU::ISA = qw/SNMP::Info Exporter/;
|
||||
@SNMP::Info::MAU::EXPORT_OK = qw//;
|
||||
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = ('MAU-MIB' => 'mauMod');
|
||||
|
||||
%GLOBALS = (
|
||||
@@ -105,17 +100,162 @@ sub _ishalfduplex{
|
||||
return 0;
|
||||
}
|
||||
|
||||
my %_mau_i_speed_map = (
|
||||
'10' => '10 Mbps',
|
||||
'100' => '100 Mbps',
|
||||
'1000' => '1.0 Gbps',
|
||||
'10Gig' => '10 Gbps',
|
||||
);
|
||||
|
||||
sub mau_i_speed_admin {
|
||||
my $mau = shift;
|
||||
|
||||
my $mau_index = $mau->mau_index();
|
||||
my $mau_type_admin = $mau->mau_type_admin();
|
||||
|
||||
my %i_speed_admin;
|
||||
foreach my $mau_port (keys %$mau_type_admin){
|
||||
my $iid = $mau_index->{$mau_port};
|
||||
next unless defined $iid;
|
||||
|
||||
my $type_adminoid = $mau_type_admin->{$mau_port};
|
||||
my $type_admin = &SNMP::translateObj($type_adminoid);
|
||||
next unless defined $type_admin;
|
||||
|
||||
if ($type_adminoid eq '.0.0') {
|
||||
$i_speed_admin{$iid} = 'auto';
|
||||
} elsif ($type_admin =~ /^dot3MauType(.*)Base/ && $_mau_i_speed_map{$1}) {
|
||||
$i_speed_admin{$iid} = $_mau_i_speed_map{$1};
|
||||
}
|
||||
}
|
||||
return \%i_speed_admin;
|
||||
}
|
||||
|
||||
sub mau_i_duplex {
|
||||
my $mau = shift;
|
||||
|
||||
my $mau_index = $mau->mau_index();
|
||||
my $mau_link = $mau->mau_link();
|
||||
|
||||
my %i_duplex;
|
||||
foreach my $mau_port (keys %$mau_link){
|
||||
my $iid = $mau_index->{$mau_port};
|
||||
next unless defined $iid;
|
||||
|
||||
my $linkoid = $mau_link->{$mau_port};
|
||||
my $link = &SNMP::translateObj($linkoid);
|
||||
next unless defined $link;
|
||||
|
||||
my $duplex = undef;
|
||||
|
||||
if ($link =~ /fd$/i) {
|
||||
$duplex = 'full';
|
||||
} elsif ($link =~ /hd$/i){
|
||||
$duplex = 'half';
|
||||
}
|
||||
|
||||
$i_duplex{$iid} = $duplex if defined $duplex;
|
||||
}
|
||||
return \%i_duplex;
|
||||
}
|
||||
|
||||
sub mau_i_duplex_admin {
|
||||
my $mau = shift;
|
||||
|
||||
my $mau_index = $mau->mau_index();
|
||||
my $mau_autostat = $mau->mau_autostat();
|
||||
my $mau_type_admin = $mau->mau_type_admin();
|
||||
|
||||
# Older HP4000's don't implement ifMauDefaultType, but we can
|
||||
# figure out from ifMauAutoNegCapAdvertised what we'd like.
|
||||
if (!defined($mau_type_admin)) {
|
||||
return mau_i_duplex_admin_old($mau,$mau_index,$mau_autostat);
|
||||
}
|
||||
|
||||
my %i_duplex_admin;
|
||||
foreach my $mau_port (keys %$mau_type_admin){
|
||||
my $iid = $mau_index->{$mau_port};
|
||||
next unless defined $iid;
|
||||
|
||||
my $autostat = $mau_autostat->{$mau_port};
|
||||
if (defined $autostat and $autostat =~ /enabled/i){
|
||||
$i_duplex_admin{$iid} = 'auto';
|
||||
next;
|
||||
}
|
||||
|
||||
my $type_adminoid = $mau_type_admin->{$mau_port};
|
||||
my $type_admin = &SNMP::translateObj($type_adminoid);
|
||||
next unless defined $type_admin;
|
||||
|
||||
my $duplex = undef;
|
||||
|
||||
if ($type_admin =~ /fd$/i) {
|
||||
$duplex = 'full';
|
||||
} elsif ($type_admin =~ /hd$/i){
|
||||
$duplex = 'half';
|
||||
}
|
||||
|
||||
$i_duplex_admin{$iid} = $duplex if defined $duplex;
|
||||
}
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
sub mau_i_duplex_admin_old {
|
||||
my $mau = shift;
|
||||
my $mau_index = shift;
|
||||
my $mau_autostat = shift;
|
||||
|
||||
my $interfaces = $mau->interfaces();
|
||||
my $mau_autosent = $mau->mau_autosent();
|
||||
|
||||
my %mau_reverse = reverse %$mau_index;
|
||||
|
||||
my %i_duplex_admin;
|
||||
foreach my $iid (keys %$interfaces){
|
||||
my $mau_index = $mau_reverse{$iid};
|
||||
next unless defined $mau_index;
|
||||
|
||||
my $autostat = $mau_autostat->{$mau_index};
|
||||
|
||||
# HP25xx has this value
|
||||
if (defined $autostat and $autostat =~ /enabled/i){
|
||||
$i_duplex_admin{$iid} = 'auto';
|
||||
next;
|
||||
}
|
||||
|
||||
my $type = $mau_autosent->{$mau_index};
|
||||
|
||||
next unless defined $type;
|
||||
|
||||
if ($type == 0) {
|
||||
$i_duplex_admin{$iid} = 'none';
|
||||
next;
|
||||
}
|
||||
|
||||
my $full = $mau->_isfullduplex($type);
|
||||
my $half = $mau->_ishalfduplex($type);
|
||||
|
||||
if ($full and !$half){
|
||||
$i_duplex_admin{$iid} = 'full';
|
||||
} elsif ($half) {
|
||||
$i_duplex_admin{$iid} = 'half';
|
||||
}
|
||||
}
|
||||
|
||||
return \%i_duplex_admin;
|
||||
}
|
||||
|
||||
1;
|
||||
__END__
|
||||
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::MAU - Perl5 Interface to Medium Access Unit (MAU) MIB (RFC2668) via SNMP
|
||||
SNMP::Info::MAU - Perl5 Interface to Medium Access Unit (MAU) MIB (RFC 2668) via SNMP
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>)
|
||||
Max Baker
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -133,7 +273,7 @@ Max Baker (C<max@warped.org>)
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::MAU is a sublcass of SNMP::Info that supplies access to the
|
||||
MAU-MIB (RFC2668). This MIB is sometimes implemented on Layer 2 network devices like HP Switches.
|
||||
MAU-MIB (RFC 2668). This MIB is sometimes implemented on Layer 2 network devices like HP Switches.
|
||||
MAU = Media Access Unit.
|
||||
|
||||
The MAU table contains link and duplex info for the port itself and the device
|
||||
@@ -172,6 +312,31 @@ These are methods that return scalar value from SNMP
|
||||
These are methods that return tables of information in the form of a reference
|
||||
to a hash.
|
||||
|
||||
|
||||
=over
|
||||
|
||||
=item $mau->mau_i_duplex()
|
||||
|
||||
Parses mau_index and mau_link to return the duplex information for
|
||||
interfaces.
|
||||
|
||||
=item $mau->mau_i_duplex_admin()
|
||||
|
||||
Parses C<mac_index>,C<mau_autostat>,C<mau_type_admin> in
|
||||
order to find the admin duplex setting for all the interfaces.
|
||||
|
||||
Returns either (auto,full,half).
|
||||
|
||||
=item $mau->mau_i_duplex_admin_old()
|
||||
|
||||
Called by mau_i_duplex_admin() if C<mau_type_admin> is empty.
|
||||
Parses C<mau_index>,C<mau_autostat>,C<mau_autosent> in
|
||||
order to find the admin duplex setting for all the interfaces.
|
||||
|
||||
Returns either (auto,none,full,half).
|
||||
|
||||
=back
|
||||
|
||||
=head2 MAU INTERFACE TABLE ENTRIES
|
||||
|
||||
=over
|
||||
@@ -234,10 +399,18 @@ of the port from a MAU POV.
|
||||
|
||||
(B<ifMauTypeList>)
|
||||
|
||||
=item $mau->mau_type_admin()
|
||||
|
||||
(C<ifMauDefaultType>)
|
||||
|
||||
=item $mau->mau_auto() - Returns status of auto-negotiation mode for ports.
|
||||
|
||||
(B<ifMauAutoNegAdminStatus>)
|
||||
|
||||
=item $mau->mau_autostat()
|
||||
|
||||
(C<ifMauAutoNegAdminStatus>)
|
||||
|
||||
=item $mau->mau_autosent() - Returns a 32 bit bit-string representing the
|
||||
capabilities we are broadcasting on that port
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::NortelStack
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004-6 Eric Miller, Max Baker
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::NortelStack;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -39,12 +39,6 @@ use SNMP::Info;
|
||||
@SNMP::Info::NortelStack::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
# Debug
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
# S5-ROOT-MIB and S5-TCS-MIB required by the MIBs below
|
||||
@@ -131,7 +125,7 @@ SNMP::Info::NortelStack - Perl5 Interface to Nortel Stack information using SNMP
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -146,15 +140,15 @@ Eric Miller (C<eric@jeneric.org>)
|
||||
)
|
||||
or die "Can't connect to DestHost.\n";
|
||||
|
||||
my $class = $stack->class();
|
||||
my $class = $stack->class();
|
||||
print "SNMP::Info determined this device to fall under subclass : $class\n";
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::NortelStack is a subclass of SNMP::Info that provides an interface
|
||||
to C<S5-AGENT-MIB> and C<S5-CHASSIS-MIB>. These MIBs are used across the
|
||||
Nortel BayStack family, as well as, older Nortel devices such as the Centillion
|
||||
family of ATM switches.
|
||||
Nortel Stackable Ethernet Switches (BayStack), as well as, older Nortel devices
|
||||
such as the Centillion family of ATM switches.
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
@@ -174,20 +168,6 @@ None.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found on the CD that came with your product.
|
||||
|
||||
Or, they can be downloaded directly from Nortel Networks regardless of support
|
||||
contract status.
|
||||
|
||||
Go to http://www.nortelnetworks.com Techninal Support, Browse Technical Support,
|
||||
Select by product, Java Device Manager, Software. Download the latest version.
|
||||
After installation, all mibs are located under the install directory under mibs
|
||||
and the repspective product line.
|
||||
|
||||
Note: Recommend versions (located in JDM\mibs\bps2000\v3100.zip)
|
||||
S5-AGENT-MIB s5age154.mib
|
||||
S5-CHASSIS-MIB s5cha135.mib
|
||||
|
||||
=head1 GLOBAL METHODS
|
||||
|
||||
These are methods that return scalar values from SNMP
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# SNMP::Info::RapidCity
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004-6 Eric Miller, Max Baker
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +27,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::RapidCity;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
use strict;
|
||||
|
||||
use Exporter;
|
||||
@@ -39,12 +38,6 @@ use Carp;
|
||||
@SNMP::Info::RapidCity::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
# Debug
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
'RAPID-CITY' => 'rapidCity',
|
||||
@@ -70,7 +63,7 @@ $INIT = 0;
|
||||
'rc_duplex_admin' => 'rcPortAdminDuplex',
|
||||
'rc_speed_admin' => 'rcPortAdminSpeed',
|
||||
'rc_auto' => 'rcPortAutoNegotiate',
|
||||
'rc_alias' => 'rcPortName',
|
||||
'rc_alias' => 'rcPortName',
|
||||
# From RAPID-CITY::rc2kCpuEthernetPortTable
|
||||
'rc_cpu_ifindex' => 'rc2kCpuEthernetPortIfIndex',
|
||||
'rc_cpu_admin' => 'rc2kCpuEthernetPortAdminStatus',
|
||||
@@ -194,7 +187,7 @@ sub i_duplex_admin {
|
||||
next unless defined $duplex;
|
||||
my $auto = $rc_auto->{$if}||'false';
|
||||
|
||||
my $string = 'other';
|
||||
my $string = 'other';
|
||||
$string = 'half' if ($duplex =~ /half/i and $auto =~ /false/i);
|
||||
$string = 'full' if ($duplex =~ /full/i and $auto =~ /false/i);
|
||||
$string = 'auto' if $auto =~ /true/i;
|
||||
@@ -257,11 +250,11 @@ __END__
|
||||
|
||||
=head1 NAME
|
||||
|
||||
SNMP::Info::Layer2::RapidCity - SNMP Interface to Nortel Networks' RapidCity MIB
|
||||
SNMP::Info::Layer2::RapidCity - SNMP Interface to the Nortel RapidCity MIB
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
@@ -282,8 +275,9 @@ Eric Miller (C<eric@jeneric.org>)
|
||||
=head1 DESCRIPTION
|
||||
|
||||
SNMP::Info::RapidCity is a subclass of SNMP::Info that provides an interface
|
||||
to the C<RAPID-CITY> MIB. This MIB is used across the Nortel Networks' Passport
|
||||
LAN, as well as, the BayStack and Acclear families.
|
||||
to the C<RAPID-CITY> MIB. This MIB is used across the Nortel Ethernet Routing
|
||||
Switch and Ethernet Switch product lines (Formerly known as Passport,
|
||||
BayStack, and Acclear).
|
||||
|
||||
Use or create in a subclass of SNMP::Info. Do not use directly.
|
||||
|
||||
@@ -299,19 +293,6 @@ None.
|
||||
|
||||
=back
|
||||
|
||||
MIBs can be found on the CD that came with your product.
|
||||
|
||||
Or, they can be downloaded directly from Nortel Networks regardless of support
|
||||
contract status.
|
||||
|
||||
Go to http://www.nortelnetworks.com Techninal Support, Browse Technical Support,
|
||||
Select by product, Java Device Manager, Software. Download the latest version.
|
||||
After installation, all mibs are located under the install directory under mibs
|
||||
and the repspective product line.
|
||||
|
||||
Note: Required version of RAPID-CITY, rapid_city.mib, must be from the Passport
|
||||
8600 version 3.3 or higher (located in JDM\mibs\passport8k\).
|
||||
|
||||
=head1 GLOBAL METHODS
|
||||
|
||||
These are methods that return scalar values from SNMP
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# SNMP::Info::SONMP
|
||||
# Eric Miller <eric@jeneric.org>
|
||||
# Eric Miller
|
||||
# $Id$
|
||||
#
|
||||
# Copyright (c) 2004 Max Baker
|
||||
# Copyright (c) 2004 Eric Miller, Max Baker
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions are met:
|
||||
@@ -28,7 +28,7 @@
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
package SNMP::Info::SONMP;
|
||||
$VERSION = 0.9;
|
||||
$VERSION = '1.01';
|
||||
|
||||
use strict;
|
||||
|
||||
@@ -40,12 +40,6 @@ use Carp;
|
||||
@SNMP::Info::SONMP::EXPORT_OK = qw//;
|
||||
|
||||
use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/;
|
||||
# Debug
|
||||
$DEBUG=0;
|
||||
$SNMP::debugging=$DEBUG;
|
||||
|
||||
# Five data structures required by SNMP::Info
|
||||
$INIT = 0;
|
||||
|
||||
%MIBS = (
|
||||
'SYNOPTICS-ROOT-MIB' => 'synoptics',
|
||||
@@ -229,7 +223,7 @@ sub c_port {
|
||||
else {
|
||||
# Segment id is (256 * remote slot_num) + (remote_port)
|
||||
my $remote_port = $seg % 256;
|
||||
my $remote_slot = int($seg / 256);
|
||||
my $remote_slot = int($seg / 256);
|
||||
|
||||
$c_port{"$index.1"} = "$remote_slot.$remote_port";
|
||||
}
|
||||
@@ -288,8 +282,10 @@ sub mac {
|
||||
my $port = $sonmp_topo_port->{$entry};
|
||||
next unless $port == 0;
|
||||
my $mac = $sonmp_topo_mac->{$entry};
|
||||
return $mac;
|
||||
return $mac;
|
||||
}
|
||||
# Topology turned off, not supported.
|
||||
return undef;
|
||||
}
|
||||
|
||||
1;
|
||||
@@ -301,8 +297,7 @@ SNMP::Info::SONMP - Perl5 Interface to SynOptics Network Management Protocol (SO
|
||||
|
||||
=head1 AUTHOR
|
||||
|
||||
Max Baker (C<max@warped.org>),
|
||||
Eric Miller (C<eric@jeneric.org>)
|
||||
Eric Miller
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
|
||||
19
MANIFEST
19
MANIFEST
@@ -1,9 +1,13 @@
|
||||
COPYRIGHT
|
||||
ChangeLog
|
||||
COPYRIGHT
|
||||
DeviceMatrix.txt
|
||||
Info.pm
|
||||
Info/Airespace.pm
|
||||
Info/Bridge.pm
|
||||
Info/CDP.pm
|
||||
Info/CiscoImage.pm
|
||||
Info/CiscoQOS.pm
|
||||
Info/CiscoRTT.pm
|
||||
Info/CiscoStack.pm
|
||||
Info/CiscoStats.pm
|
||||
Info/CiscoVTP.pm
|
||||
@@ -14,16 +18,20 @@ Info/Layer1.pm
|
||||
Info/Layer1/Allied.pm
|
||||
Info/Layer1/Asante.pm
|
||||
Info/Layer1/Bayhub.pm
|
||||
Info/Layer1/S3000.pm
|
||||
Info/Layer2.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
|
||||
Info/Layer2/C2900.pm
|
||||
Info/Layer2/Catalyst.pm
|
||||
Info/Layer2/Centillion.pm
|
||||
Info/Layer2/Foundry.pm
|
||||
Info/Layer2/HP.pm
|
||||
Info/Layer2/N2270.pm
|
||||
Info/Layer2/NAP222x.pm
|
||||
Info/Layer2/Orinoco.pm
|
||||
Info/Layer2/ZyXEL_DSLAM.pm
|
||||
@@ -32,21 +40,22 @@ Info/Layer3/Aironet.pm
|
||||
Info/Layer3/AlteonAD.pm
|
||||
Info/Layer3/BayRS.pm
|
||||
Info/Layer3/C3550.pm
|
||||
Info/Layer3/C4000.pm
|
||||
Info/Layer3/C6500.pm
|
||||
Info/Layer3/Cisco.pm
|
||||
Info/Layer3/Contivity.pm
|
||||
Info/Layer3/Extreme.pm
|
||||
Info/Layer3/Foundry.pm
|
||||
Info/Layer3/Juniper.pm
|
||||
Info/Layer3/N1600.pm
|
||||
Info/Layer3/Passport.pm
|
||||
Info/MAU.pm
|
||||
Info/NortelStack.pm
|
||||
Info/RapidCity.pm
|
||||
Info/SONMP.pm
|
||||
MANIFEST
|
||||
Makefile.PL
|
||||
MANIFEST This list of files
|
||||
README
|
||||
t/DeviceMatrix.html
|
||||
t/DeviceMatrix.png
|
||||
t/lucon.ttf
|
||||
t/make_dev_matrix.pl
|
||||
t/prereq.t
|
||||
t/test_class.pl
|
||||
|
||||
290
README
290
README
@@ -5,12 +5,15 @@ NAME
|
||||
|
||||
VERSION
|
||||
|
||||
SNMP::Info - Version 0.9
|
||||
SNMP::Info - Version 1.0
|
||||
|
||||
AUTHOR
|
||||
|
||||
SNMP::Info was created at UCSC for the netdisco project
|
||||
(www.netdisco.org) and is written and maintained by Max Baker.
|
||||
(www.netdisco.org) and was orginally written by Max Baker.
|
||||
|
||||
Currently being maintained by team of Open Source authors headed by Eric
|
||||
Miller and Bill Fenner.
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
@@ -48,16 +51,22 @@ SYNOPSIS
|
||||
# Print out physical port name, not snmp iid
|
||||
my $port = $interfaces->{$iid};
|
||||
|
||||
print "$port: ";
|
||||
print "$duplex duplex" if defined $duplex;
|
||||
|
||||
# The CDP Table has table entries different than the interface tables.
|
||||
# So we use c_if to get the map from cdp table to interface table.
|
||||
|
||||
my %c_map = reverse %$c_if;
|
||||
my $c_key = $c_map{$iid};
|
||||
unless (defined $c_key) {
|
||||
print "\n\n";
|
||||
next;
|
||||
}
|
||||
my $neighbor_ip = $c_ip->{$c_key};
|
||||
my $neighbor_port = $c_port->{$c_key};
|
||||
|
||||
print "$port: $duplex duplex";
|
||||
print " connected to $neighbor_ip / $neighbor_port\n" if defined $remote_ip;
|
||||
print " connected to $neighbor_ip / $neighbor_port\n" if defined $neighbor_ip;
|
||||
print "\n";
|
||||
|
||||
}
|
||||
@@ -136,46 +145,6 @@ REQUIREMENTS
|
||||
Make sure that your snmp.conf is updated to point to your MIB
|
||||
directory and that the MIBs are world-readable.
|
||||
|
||||
To do it by hand:
|
||||
|
||||
Then run "snmpconf" and setup that directory as default. Move
|
||||
snmp.conf into /usr/local/share/snmp when you are done.
|
||||
|
||||
Basic MIBs
|
||||
A minimum amount of MIBs to have are the Version 2 MIBs from
|
||||
Cisco, found at
|
||||
|
||||
ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
|
||||
|
||||
To install them :
|
||||
|
||||
mkdir -p /usr/local/share/snmp/mibs && cd /usr/local/share/snmp/mibs && tar xvfz /path/to/v2.tar.gz
|
||||
|
||||
Version 1 MIBs
|
||||
You will also need to install some of the version one MIBs from
|
||||
Cisco :
|
||||
|
||||
ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
|
||||
|
||||
Extract
|
||||
|
||||
BRIDGE-MIB
|
||||
SNMP-REPEATER-MIB
|
||||
STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB)
|
||||
TOKEN-RING-RMON-MIB
|
||||
|
||||
by running
|
||||
|
||||
mkdir -p /usr/local/share/snmp/mibs
|
||||
cd /usr/local/share/snmp/mibs
|
||||
tar xvfz /path/to/v1.tar.gz BRIDGE-MIB.my SNMP-REPEATER-MIB.my ESSWITCH-MIB.my TOKEN-RING-RMON-MIB.my
|
||||
|
||||
More Specific MIBs
|
||||
Some non-cisco subclasses will need MIBs other than the basic
|
||||
one available from Cisco.
|
||||
|
||||
Check below under each subclass for requirements.
|
||||
|
||||
DESIGN GOALS
|
||||
|
||||
1. Use of textual MIB leaf identifier and enumerated values
|
||||
@@ -218,13 +187,29 @@ SUBCLASSES
|
||||
|
||||
For more info run "perldoc" on any of the following module names.
|
||||
|
||||
SNMP::Info::Airespace
|
||||
AIRESPACE-WIRELESS-MIB and AIRESPACE-SWITCHING-MIB. Inherited by
|
||||
devices based on the Airespace wireless platform.
|
||||
|
||||
SNMP::Info::Bridge
|
||||
BRIDGE-MIB (RFC1286). QBRIDGE-MIB. Inherited by devices with Layer2
|
||||
support.
|
||||
|
||||
SNMP::Info::CDP
|
||||
CISCO-CDP-MIB. Cisco Discovery Protocol (CDP) Support. Inherited by
|
||||
devices serving Layer2 or Layer3.
|
||||
Cisco and HP devices.
|
||||
|
||||
SNMP::Info::CiscoImage
|
||||
CISCO-IMAGE-MIB. A collection of OIDs providing IOS image
|
||||
characteristics.
|
||||
|
||||
SNMP::Info::CiscoQOS
|
||||
CISCO-CLASS-BASED-QOS-MIB. A collection of OIDs providing
|
||||
information about a Cisco device's QOS config.
|
||||
|
||||
SNMP::Info::CiscoRTT
|
||||
CISCO-RTTMON-MIB. A collection of OIDs providing information about a
|
||||
Cisco device's RTT values.
|
||||
|
||||
SNMP::Info::CiscoStack
|
||||
CISCO-STACK-MIB and CISCO-PORT-SECURITY-MIB
|
||||
@@ -256,13 +241,13 @@ SUBCLASSES
|
||||
S5-AGENT-MIB, S5-CHASSIS-MIB.
|
||||
|
||||
SNMP::Info::RapidCity
|
||||
RAPID-CITY. Inhertited by Nortel Networks switches for duplex and
|
||||
VLAN information.
|
||||
RAPID-CITY. Inhertited by Nortel switches for duplex and VLAN
|
||||
information.
|
||||
|
||||
SNMP::Info::SONMP
|
||||
SYNOPTICS-ROOT-MIB, S5-ETH-MULTISEG-TOPOLOGY-MIB. Provides
|
||||
translation from Nortel Networks Topology Table information to CDP.
|
||||
Inherited by Nortel/Bay switches and hubs.
|
||||
translation from Nortel Topology Table information to CDP. Inherited
|
||||
by Nortel/Bay/Synoptics switches and hubs.
|
||||
|
||||
Device Subclasses
|
||||
|
||||
@@ -280,20 +265,18 @@ SUBCLASSES
|
||||
|
||||
Requires ATI-MIB
|
||||
|
||||
See SNMP::Info::Layer1::Allied for where to get MIBs required.
|
||||
|
||||
SNMP::Info::Layer1::Asante
|
||||
Subclass for Asante 1012 Hubs.
|
||||
|
||||
Requires ASANTE-HUB1012-MIB
|
||||
|
||||
See SNMP::Info::Layer1::Asante for where to get MIBs required.
|
||||
|
||||
SNMP::Info::Layer1::Bayhub
|
||||
Subclass for Nortel/Bay hubs. This includes System 5000, 100
|
||||
series, 200 series, and probably more.
|
||||
|
||||
See SNMP::Info::Layer1::Bayhub for where to get MIBs required.
|
||||
SNMP::Info::Layer1::S3000
|
||||
Subclass for Bay/Synoptics hubs. This includes System 3000,
|
||||
281X, and probably more.
|
||||
|
||||
SNMP::Info::Layer2
|
||||
Generic Layer2 Device subclass.
|
||||
@@ -305,15 +288,16 @@ SUBCLASSES
|
||||
SNMP::Info::Layer2::Allied
|
||||
Allied Telesys switches.
|
||||
|
||||
SNMP::Info::Layer2::Aruba
|
||||
Subclass for Aruba wireless switches.
|
||||
|
||||
SNMP::Info::Layer2::Bay
|
||||
Depricated. Use BayStack.
|
||||
Depreciated. Use BayStack.
|
||||
|
||||
SNMP::Info::Layer2::Baystack
|
||||
Subclass for Nortel/Bay Baystack switches. This includes 303,
|
||||
304, 350, 380, 410, 420, 425, 450, 460, 470, 5510, 5520,
|
||||
Business Policy Switch (BPS) and probably others.
|
||||
|
||||
See SNMP::Info::Layer2::Baystack for where to get MIBs required.
|
||||
Subclass for Nortel/Bay Ethernet Switch/Baystack switches. This
|
||||
includes 303, 304, 350, 380, 410, 420, 425, 450, 460, 470, 5510,
|
||||
5520, 5530, Business Policy Switch (BPS) and probably others.
|
||||
|
||||
SNMP::Info::Layer2::C1900
|
||||
Subclass for Cisco Catalyst 1900 and 1900c Devices running
|
||||
@@ -332,8 +316,8 @@ SUBCLASSES
|
||||
SNMP::Info::Layer2::Centillion
|
||||
Subclass for Nortel/Bay Centillion and 5000BH ATM switches.
|
||||
|
||||
See SNMP::Info::Layer2::Centillion for where to get MIBs
|
||||
required.
|
||||
SNMP::Info::Layer2::Foundry
|
||||
Subclass for Foundry Switches. Tested on EdgeIron 24G.
|
||||
|
||||
SNMP::Info::Layer2::HP
|
||||
Subclass for HP Procurve Switches
|
||||
@@ -342,14 +326,14 @@ SUBCLASSES
|
||||
|
||||
See SNMP::Info::Layer2::HP for more info.
|
||||
|
||||
SNMP::Info::Layer2::NAP222x
|
||||
Subclass for Nortel Networks' 222x series wireless access
|
||||
points.
|
||||
SNMP::Info::Layer2::N2270
|
||||
Subclass for Nortel 2270 wireless switches.
|
||||
|
||||
See SNMP::Info::Layer2::NAP222x for where to get MIBs required.
|
||||
SNMP::Info::Layer2::NAP222x
|
||||
Subclass for Nortel 222x series wireless access points.
|
||||
|
||||
SNMP::Info::Layer2::Orinoco
|
||||
Subclass for Orinoco wireless access points.
|
||||
Subclass for Orinoco/Proxim wireless access points.
|
||||
|
||||
SNMP::Info::Layer2::ZyXEL_DSLAM
|
||||
Zyxel DSLAMs. Need I say more?
|
||||
@@ -367,21 +351,19 @@ SUBCLASSES
|
||||
Note Layer2::Aironet
|
||||
|
||||
SNMP::Info::Layer3::AlteonAD
|
||||
Subclass for Nortel Networks' Alteon Ace Director series L2-7
|
||||
switches.
|
||||
|
||||
See SNMP::Info::Layer3::AlteonAD for where to get MIBs required.
|
||||
Subclass for Nortel Alteon Ace Director series L2-7 switches.
|
||||
|
||||
SNMP::Info::Layer3::BayRS
|
||||
Subclass for Nortel Networks' BayRS routers. This includes BCN,
|
||||
BLN, ASN, ARN, and AN routers.
|
||||
|
||||
See SNMP::Info::Layer3::BayRS for where to get MIBs required.
|
||||
Subclass for Nortel Multiprotocol/BayRS routers. This includes
|
||||
BCN, BLN, ASN, ARN, AN, 2430, and 5430 routers.
|
||||
|
||||
SNMP::Info::Layer3::C3550
|
||||
Subclass for Cisco Catalyst 3550,3540,3560 2/3 switches running
|
||||
IOS.
|
||||
|
||||
SNMP::Info::Layer3::C4000
|
||||
This class covers Catalyst 4000s and 4500s.
|
||||
|
||||
SNMP::Info::Layer3::C6500
|
||||
This class covers Catalyst 6500s in native mode, hybrid mode.
|
||||
Catalyst 4000's, 3750's, 2970's and probably others.
|
||||
@@ -391,10 +373,12 @@ SUBCLASSES
|
||||
on CiscoVTP.
|
||||
|
||||
SNMP::Info::Layer3::Contivity
|
||||
Subclass for Nortel Networks' Contivity VPN concentrators.
|
||||
Subclass for Nortel Contivity/VPN Routers.
|
||||
|
||||
See SNMP::Info::Layer3::Contivity for where to get MIBs
|
||||
required.
|
||||
SNMP::Info::Layer3::Extreme
|
||||
Subclass for Extreme Networks switches.
|
||||
|
||||
See SNMP::Info::Layer3::Extreme for more info.
|
||||
|
||||
SNMP::Info::Layer3::Foundry
|
||||
Subclass for older Foundry Network devices. Outdated, but being
|
||||
@@ -404,16 +388,22 @@ SUBCLASSES
|
||||
|
||||
See SNMP::Info::Layer3::Foundry for more info.
|
||||
|
||||
SNMP::Info::Layer3::Passport
|
||||
Subclass for Nortel Networks' Passport 8600 series switches.
|
||||
SNMP::Info::Layer3::Juniper
|
||||
Subclass for Juniper devices.
|
||||
|
||||
See SNMP::Info::Layer3::Passport for where to get MIBs required.
|
||||
SNMP::Info::Layer3::N1600
|
||||
Subclass for Nortel Ethernet Routing Switch 1600 series.
|
||||
|
||||
SNMP::Info::Layer3::Passport
|
||||
Subclass for Nortel Ethernet Routing Switch/Passport 8000 series
|
||||
and Accelar series switches.
|
||||
|
||||
Thanks
|
||||
|
||||
Thanks for testing and coding help (in no particular order) to : Andy
|
||||
Ford, Brian Wilson, Jean-Philippe Luiggi, D<>na Watanabe, Bradley Baetz,
|
||||
Eric Miller, and people listed on the Netdisco README!
|
||||
Mike Hunter, Justin Hunter, Brian Chow and people listed on the Netdisco
|
||||
README!
|
||||
|
||||
USAGE
|
||||
|
||||
@@ -424,7 +414,9 @@ USAGE
|
||||
|
||||
my $info = new SNMP::Info( 'Debug' => 1,
|
||||
'AutoSpecify' => 1,
|
||||
'BigInt' => 1
|
||||
'BigInt' => 1,
|
||||
'BulkWalk' => 1,
|
||||
'BulkRepeaters'=> 20,
|
||||
'DestHost' => 'myrouter',
|
||||
'Community' => 'public',
|
||||
'Version' => 2,
|
||||
@@ -433,23 +425,67 @@ USAGE
|
||||
|
||||
SNMP::Info Specific Arguments :
|
||||
|
||||
AutoSpecify = Returns an object of a more specific device class
|
||||
*See specify() entry*
|
||||
BigInt = Return Math::BigInt objects for 64 bit counters. Sets on a global scope, not object.
|
||||
Debug = Prints Lots of debugging messages
|
||||
MibDirs = Array ref to list of directories in which to look for MIBs. Note this will
|
||||
be in addition to the ones setup in snmp.conf at the system level.
|
||||
RetryNoSuch = When using SNMP Version 1, try reading values even if they come back
|
||||
as "no such variable in this MIB". Defaults to true, set to false if
|
||||
so desired. This feature lets you read SNMPv2 data from an SNMP version
|
||||
1 connection, and should probably be left on.
|
||||
Session = SNMP::Session object to use instead of connecting on own.
|
||||
AutoSpecify
|
||||
Returns an object of a more specific device class
|
||||
|
||||
All other arguments are passed to SNMP::Session.
|
||||
(default on)
|
||||
|
||||
See SNMP::Session for a list of other possible arguments.
|
||||
BigInt
|
||||
Return Math::BigInt objects for 64 bit counters. Sets on a
|
||||
global scope, not object.
|
||||
|
||||
A Note about the wrong Community string or wrong SNMP Version :
|
||||
(default off)
|
||||
|
||||
BulkWalk
|
||||
Set to 0 to turn off BULKWALK commands for SNMPv2 connections.
|
||||
|
||||
Note that BULKWALK is turned off for Net-SNMP versions 5.1.x
|
||||
because of a bug.
|
||||
|
||||
(default on)
|
||||
|
||||
BulkRepeaters
|
||||
Set number of MaxRepeaters for BULKWALK operation. See "perldoc
|
||||
SNMP" -> bulkwalk() for more info.
|
||||
|
||||
(default 20)
|
||||
|
||||
Debug
|
||||
Prints Lots of debugging messages
|
||||
|
||||
(default off)
|
||||
|
||||
DebugSNMP
|
||||
Set $SNMP::debugging level for Net-SNMP.
|
||||
|
||||
See SNMP for more details.
|
||||
|
||||
MibDirs
|
||||
Array ref to list of directories in which to look for MIBs. Note
|
||||
this will be in addition to the ones setup in snmp.conf at the
|
||||
system level.
|
||||
|
||||
(default use net-snmp settings only)
|
||||
|
||||
RetryNoSuch
|
||||
When using SNMP Version 1, try reading values even if they come
|
||||
back as "no such variable in this MIB". Set to false if so
|
||||
desired. This feature lets you read SNMPv2 data from an SNMP
|
||||
version 1 connection, and should probably be left on.
|
||||
|
||||
(default true)
|
||||
|
||||
Session
|
||||
SNMP::Session object to use instead of connecting on own.
|
||||
|
||||
(default creates session automatically)
|
||||
|
||||
OTHER
|
||||
All other arguments are passed to SNMP::Session.
|
||||
|
||||
See SNMP::Session for a list of other possible arguments.
|
||||
|
||||
A Note about the wrong Community string or wrong SNMP Version:
|
||||
|
||||
If a connection is using the wrong community string or the wrong
|
||||
SNMP version, the creation of the object will not fail. The device
|
||||
@@ -491,6 +527,11 @@ USAGE
|
||||
Returns current debug status, and optionally toggles debugging info
|
||||
for this object.
|
||||
|
||||
$info->bulkwalk([1|0])
|
||||
Returns if bulkwalk is currently turned on for this object.
|
||||
|
||||
Optionally sets the bulkwalk parameter.
|
||||
|
||||
$info->device_type()
|
||||
Returns the Subclass name for this device. "SNMP::Info" is returned
|
||||
if no more specific class is available.
|
||||
@@ -510,31 +551,41 @@ USAGE
|
||||
Aironet (BR500,AP340,350,1200) -> SNMP::Info::Layer3::Aironet
|
||||
AP4800... All Non IOS
|
||||
Catalyst 3550,3548,3560 -> SNMP::Info::Layer3::C3550
|
||||
Catalyst 6500, 4000, 3750 -> SNMP::Info::Layer3::C6500
|
||||
Catalyst 4000,4500 -> SNMP::Info::Layer3::C4000
|
||||
Catalyst 6500, 3750 -> SNMP::Info::Layer3::C6500
|
||||
Cisco Generic L3 IOS device -> SNMP::Info::Layer3::Cisco
|
||||
Extreme -> SNMP::Info::Layer3::Extreme
|
||||
Foundry -> SNMP::Info::Layer3::Foundry
|
||||
Nortel Passport LAN -> SNMP::Info::Layer3::Passport
|
||||
Juniper -> SNMP::Info::Layer3::Juniper
|
||||
Nortel Passport/Accelar LAN -> SNMP::Info::Layer3::Passport
|
||||
Nortel/Bay Baystack -> SNMP::Info::Layer2::Baystack
|
||||
Alteon Ace Director -> SNMP::Info::Layer3::AlteonAD
|
||||
Nortel Contivity -> SNMP::Info::Layer3::Contivity
|
||||
Nortel BayRS Router -> SNMP::Info::Layer3::BayRS
|
||||
Elsif Layer2 (no Layer3) -> SNMP::Info::Layer2
|
||||
Elsif Layer2 (no Layer3) -> SNMP::Info::Layer2
|
||||
Aironet - IOS Devices -> SNMP::Info::Layer2::Aironet
|
||||
Catalyst 1900 -> SNMP::Info::Layer2::C1900
|
||||
Catalyst 2900XL,2950,3500XL -> SNMP::Info::Layer2::C2900
|
||||
Catalyst 2970 -> SNMP::Info::Layer3::C6500
|
||||
Catalyst 3550/3548 -> SNMP::Info::Layer3::C3550
|
||||
Catalyst WS-C 2926,5xxx -> SNMP::Info::Layer2::Catalyst
|
||||
Extreme -> SNMP::Info::Layer3::Extreme
|
||||
Foundry (EdgeIron,????) -> SNMP::Info::Layer2::Foundry
|
||||
HP Procurve -> SNMP::Info::Layer2::HP
|
||||
Nortel/Bay Centillion ATM -> SNMP::Info::Layer2::Centillion
|
||||
Nortel/Bay Baystack -> SNMP::Info::Layer2::Baystack
|
||||
Nortel Passport/Accelar 8100 -> SNMP::Info::Layer3::Passport
|
||||
Nortel AP 222x -> SNMP::Info::Layer2::NAP222x
|
||||
Orinco AP -> SNMP::Info::Layer2::Orinoco
|
||||
Nortel 2270 WSS -> SNMP::Info::Layer2::N2270
|
||||
Elsif Layer1 Support -> SNMP::Info::Layer1
|
||||
Allied -> SNMP::Info::Layer1::Allied
|
||||
Asante -> SNMP::Info::Layer1::Asante
|
||||
Nortel/Bay Hub -> SNMP::Info::Layer1::Bayhub
|
||||
Bay/Synoptics Hub -> SNMP::Info::Layer1::S3000
|
||||
Else -> SNMP::Info
|
||||
ZyXEL_DSLAM -> SNMP::Info::Layer2::ZyXEL_DSLAM
|
||||
Aruba wireless -> SNMP::Info::Layer2::Aruba
|
||||
|
||||
$info->error(no_clear)
|
||||
Returns Error message if there is an error, or undef if there is
|
||||
@@ -616,6 +667,13 @@ USAGE
|
||||
|
||||
(ifNumber)
|
||||
|
||||
$info->ipforwarding()
|
||||
The indication of whether the entity is acting as an IP gateway
|
||||
|
||||
Returns either forwarding or not-forwarding
|
||||
|
||||
(ipForwarding)
|
||||
|
||||
Table Methods
|
||||
|
||||
Each of these methods returns a hash_reference to a hash keyed on the
|
||||
@@ -684,7 +742,14 @@ USAGE
|
||||
Speed of the link, human format. See munge_speed() later in document
|
||||
for details.
|
||||
|
||||
(ifSpeed)
|
||||
(ifSpeed, ifHighSpeed if necessary)
|
||||
|
||||
$info->i_speed_high()
|
||||
Speed of a high-speed link, human format. See munge_highspeed()
|
||||
later in document for details. You should not need to call this
|
||||
directly, as i_speed() will call it if it needs to.
|
||||
|
||||
(ifHighSpeed)
|
||||
|
||||
$info->i_mac()
|
||||
MAC address of the interface. Note this is just the MAC of the port,
|
||||
@@ -706,7 +771,7 @@ USAGE
|
||||
$info->i_lastchange()
|
||||
The value of sysUpTime when this port last changed states (up,down).
|
||||
|
||||
(IfLastChange)
|
||||
(ifLastChange)
|
||||
|
||||
$info->i_name()
|
||||
Interface Name field. Supported by a smaller subset of devices, this
|
||||
@@ -1133,6 +1198,10 @@ SNMP::INFO INTERNALS
|
||||
Default 1. Set to false to disable RetryNoSuch option for
|
||||
SNMP::Session. Or see method in new() to do it on an object scope.
|
||||
|
||||
$REPEATERS
|
||||
Default 20. MaxRepeaters for BULKWALK operations. See "perldoc SNMP"
|
||||
for more info. Can change by passing BulkRepeaters option in new()
|
||||
|
||||
Data Munging Callback Subroutines
|
||||
|
||||
munge_speed()
|
||||
@@ -1141,6 +1210,7 @@ SNMP::INFO INTERNALS
|
||||
%SPEED_MAP = (
|
||||
'56000' => '56 kbps',
|
||||
'64000' => '64 kbps',
|
||||
'115000' => '115 kpbs',
|
||||
'1500000' => '1.5 Mbps',
|
||||
'1536000' => 'T1',
|
||||
'1544000' => 'T1',
|
||||
@@ -1159,6 +1229,8 @@ SNMP::INFO INTERNALS
|
||||
'45000000' => '45 Mbps',
|
||||
'45045000' => 'DS3',
|
||||
'46359642' => 'DS3',
|
||||
'51850000' => 'OC-1',
|
||||
'54000000' => '54 Mbps',
|
||||
'64000000' => '64 Mbps',
|
||||
'100000000' => '100 Mbps',
|
||||
'149760000' => 'ATM on OC-3',
|
||||
@@ -1172,6 +1244,9 @@ SNMP::INFO INTERNALS
|
||||
'1000000000' => '1.0 Gbps',
|
||||
)
|
||||
|
||||
munge_highspeed()
|
||||
Makes human friendly speed ratings for ifHighSpeed
|
||||
|
||||
munge_ip()
|
||||
Takes a binary IP and makes it dotted ASCII
|
||||
|
||||
@@ -1192,6 +1267,14 @@ SNMP::INFO INTERNALS
|
||||
If $BIGINT is set to true, then a Math::BigInt object is returned.
|
||||
See Math::BigInt for details.
|
||||
|
||||
munge_i_up
|
||||
There is a collision between data in IF-MIB and RFC-1213. For
|
||||
devices that fully implement IF-MIB it might return 7 for a port
|
||||
that is down. This munges the data against the IF-MIB by hand.
|
||||
|
||||
TODO: Get the precidence of MIBs and overriding of MIB data in
|
||||
Net-SNMP figured out. Heirarchy/precendence of MIBS in SNMP::Info.
|
||||
|
||||
Internaly Used Functions
|
||||
|
||||
$info->init()
|
||||
@@ -1279,6 +1362,9 @@ SNMP::INFO INTERNALS
|
||||
The first time ran, it will call $info->load_METHOD(). Every time
|
||||
after it will return cached data.
|
||||
|
||||
$info->snmp_connect_ip()
|
||||
Returns true or false based upon snmp connectivity to an IP.
|
||||
|
||||
AUTOLOAD
|
||||
|
||||
Each entry in either %FUNCS or %GLOBALS is used by AUTOLOAD() to create
|
||||
|
||||
@@ -280,6 +280,7 @@ be assumed working.
|
||||
<LI><tt>no</tt> - Can't recover current or admin setting.
|
||||
<LI><tt>link</tt> - Can get current setting only.
|
||||
<LI><tt>both</tt> - Can get admin and link setting.
|
||||
<LI><tt>write</tt> - Can get admin and link setting and perform sets.
|
||||
</UL>
|
||||
</TD>
|
||||
</TR>
|
||||
@@ -304,6 +305,16 @@ be assumed working.
|
||||
<TD>Ver</TD>
|
||||
<TD>SNMP Protocol Version the device has to use.</TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TD>Vlan</TD>
|
||||
<TD>Ability to get VLAN port assignments.<BR>
|
||||
<UL>
|
||||
<LI><TT>no</TT> - Have not found an SNMP method to get data yet.
|
||||
<LI><TT>yes</TT> - Can read information.
|
||||
<LI><TT>write</TT> - Can read and write (set).
|
||||
</UL>
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# Test a device class in SNMP::Info against a device.
|
||||
#
|
||||
# Max Baker <max@warped.org>
|
||||
# Max Baker
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
@@ -13,7 +13,7 @@ use lib '/usr/local/netdisco';
|
||||
use SNMP::Info;
|
||||
use Getopt::Long;
|
||||
use strict;
|
||||
use vars qw/$Class $Dev $Comm $Ver @Dump/;
|
||||
use vars qw/$Class $Dev $Comm $Ver @Dump %Dumped/;
|
||||
|
||||
# Default Values
|
||||
$Class = '';
|
||||
@@ -51,6 +51,7 @@ my $dev = new $Class( 'AutoSpecify' => 0,
|
||||
) or die "\n";
|
||||
|
||||
print "Connected to $Dev.\n";
|
||||
print "It's a ", $dev->device_type(), ".\n";
|
||||
|
||||
my $layers = $dev->layers();
|
||||
|
||||
@@ -83,6 +84,10 @@ foreach my $fn (@misc){
|
||||
test_fn($dev,$fn);
|
||||
}
|
||||
|
||||
foreach my $fn (@Dump) {
|
||||
test_fn($dev,$fn) unless $Dumped{$fn};
|
||||
}
|
||||
|
||||
#--------------------------------
|
||||
sub test_global {
|
||||
my $dev = shift;
|
||||
@@ -137,6 +142,7 @@ sub test_fn {
|
||||
|
||||
printf "%-20s %d rows.\n",$method, scalar(keys %$results);
|
||||
if (grep(/^$method$/,@Dump)) {
|
||||
$Dumped{$method} = 1;
|
||||
foreach my $iid (keys %$results){
|
||||
print " $iid : $results->{$iid}\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user