From 3bcc5225907ba5139d60f80989928f05f508aa19 Mon Sep 17 00:00:00 2001 From: nick n <39005454+inphobia@users.noreply.github.com> Date: Sun, 25 Aug 2019 06:47:10 +0200 Subject: [PATCH] documentation overhaul (#353) * ident * remove $Id$ tags from rcs software which has been retired * make an effort to sync required mib docs with actual code * sync even more docs with what code actually does * some whitespace nits * fixup example to use snmpv2 for all but the most ancient devices * remove blurb to find more specific snmp::info classes for classes which alrdy are as specific as they can get (eg snmp::info::layer3::vmware doesn't need info on to find a specific module since there ain't none) * rename all sub {vendor} strings to lowercase vendor, if cisco, juniper and arista can be lowercase, so can be all the rest. * fix tests * spread some use warnings around * use $ instead of @ * remove defines that are included via parent classes * use strict + warnings * remove alrdy included modules * add comma after last list item * typos * mibs are found in our mib repo, not on the cisco site * documentation fixes --- lib/SNMP/Info.pm | 56 +++++++++++----------- lib/SNMP/Info/AMAP.pm | 15 +++--- lib/SNMP/Info/AdslLine.pm | 3 +- lib/SNMP/Info/Aggregate.pm | 1 + lib/SNMP/Info/Airespace.pm | 2 +- lib/SNMP/Info/Bridge.pm | 27 +++++------ lib/SNMP/Info/CDP.pm | 8 ++-- lib/SNMP/Info/CiscoAgg.pm | 6 +-- lib/SNMP/Info/CiscoConfig.pm | 2 +- lib/SNMP/Info/CiscoPortSecurity.pm | 4 +- lib/SNMP/Info/CiscoPower.pm | 7 ++- lib/SNMP/Info/CiscoQOS.pm | 4 +- lib/SNMP/Info/CiscoRTT.pm | 6 +-- lib/SNMP/Info/CiscoStack.pm | 11 ++--- lib/SNMP/Info/CiscoStats.pm | 4 +- lib/SNMP/Info/CiscoStpExtensions.pm | 6 +-- lib/SNMP/Info/CiscoVTP.pm | 4 +- lib/SNMP/Info/DocsisHE.pm | 11 +++-- lib/SNMP/Info/EDP.pm | 13 ++--- lib/SNMP/Info/Entity.pm | 6 +-- lib/SNMP/Info/EtherLike.pm | 8 ++-- lib/SNMP/Info/FDP.pm | 8 ++-- lib/SNMP/Info/IEEE802dot11.pm | 2 +- lib/SNMP/Info/IEEE802dot3ad.pm | 1 + lib/SNMP/Info/IPv6.pm | 3 ++ lib/SNMP/Info/LLDP.pm | 4 +- lib/SNMP/Info/Layer1.pm | 19 ++++---- lib/SNMP/Info/Layer1/Allied.pm | 15 ++++-- lib/SNMP/Info/Layer1/Asante.pm | 8 ++-- lib/SNMP/Info/Layer1/Bayhub.pm | 9 +--- lib/SNMP/Info/Layer1/Cyclades.pm | 13 ++--- lib/SNMP/Info/Layer1/S3000.pm | 7 +-- lib/SNMP/Info/Layer2.pm | 12 +++-- lib/SNMP/Info/Layer2/3Com.pm | 23 ++++----- lib/SNMP/Info/Layer2/Adtran.pm | 38 +++++++-------- lib/SNMP/Info/Layer2/Aerohive.pm | 12 ++--- lib/SNMP/Info/Layer2/Airespace.pm | 7 +-- lib/SNMP/Info/Layer2/Aironet.pm | 41 ++++++++-------- lib/SNMP/Info/Layer2/Allied.pm | 9 ++-- lib/SNMP/Info/Layer2/Atmedia.pm | 11 +++-- lib/SNMP/Info/Layer2/Baystack.pm | 32 +++---------- lib/SNMP/Info/Layer2/C1900.pm | 15 +----- lib/SNMP/Info/Layer2/C2900.pm | 9 +--- lib/SNMP/Info/Layer2/Catalyst.pm | 4 +- lib/SNMP/Info/Layer2/Centillion.pm | 18 +++---- lib/SNMP/Info/Layer2/Cisco.pm | 8 +--- lib/SNMP/Info/Layer2/CiscoSB.pm | 20 +------- lib/SNMP/Info/Layer2/HP.pm | 2 +- lib/SNMP/Info/Layer2/HP4000.pm | 9 +--- lib/SNMP/Info/Layer2/HPVC.pm | 15 +----- lib/SNMP/Info/Layer2/Kentrox.pm | 13 ++--- lib/SNMP/Info/Layer2/N2270.pm | 56 ++++++++-------------- lib/SNMP/Info/Layer2/NAP222x.pm | 7 +-- lib/SNMP/Info/Layer2/NWSS2300.pm | 47 +++++------------- lib/SNMP/Info/Layer2/Netgear.pm | 39 ++++----------- lib/SNMP/Info/Layer2/Nexans.pm | 6 +-- lib/SNMP/Info/Layer2/Orinoco.pm | 9 +--- lib/SNMP/Info/Layer2/Sixnet.pm | 6 +-- lib/SNMP/Info/Layer2/Trapeze.pm | 50 +++++-------------- lib/SNMP/Info/Layer2/Ubiquiti.pm | 20 ++++---- lib/SNMP/Info/Layer2/ZyXEL_DSLAM.pm | 20 ++++---- lib/SNMP/Info/Layer3.pm | 34 +++++++++++-- lib/SNMP/Info/Layer3/Aironet.pm | 5 +- lib/SNMP/Info/Layer3/AlcatelLucent.pm | 8 ++-- lib/SNMP/Info/Layer3/AlteonAD.pm | 7 +-- lib/SNMP/Info/Layer3/Altiga.pm | 10 +++- lib/SNMP/Info/Layer3/Arista.pm | 35 ++++---------- lib/SNMP/Info/Layer3/Aruba.pm | 23 +++------ lib/SNMP/Info/Layer3/BayRS.pm | 54 ++++----------------- lib/SNMP/Info/Layer3/BlueCoatSG.pm | 13 ++--- lib/SNMP/Info/Layer3/C3550.pm | 8 +--- lib/SNMP/Info/Layer3/C4000.pm | 6 --- lib/SNMP/Info/Layer3/C6500.pm | 21 ++++---- lib/SNMP/Info/Layer3/CheckPoint.pm | 28 ++++------- lib/SNMP/Info/Layer3/Cisco.pm | 22 +-------- lib/SNMP/Info/Layer3/CiscoASA.pm | 3 +- lib/SNMP/Info/Layer3/CiscoFWSM.pm | 1 - lib/SNMP/Info/Layer3/CiscoSwitch.pm | 5 -- lib/SNMP/Info/Layer3/Contivity.pm | 48 +++---------------- lib/SNMP/Info/Layer3/Cumulus.pm | 30 ++++-------- lib/SNMP/Info/Layer3/DLink.pm | 44 +++++++++++------ lib/SNMP/Info/Layer3/Dell.pm | 20 ++------ lib/SNMP/Info/Layer3/ERX.pm | 9 ++-- lib/SNMP/Info/Layer3/Enterasys.pm | 32 +++---------- lib/SNMP/Info/Layer3/Extreme.pm | 25 +--------- lib/SNMP/Info/Layer3/F5.pm | 6 +-- lib/SNMP/Info/Layer3/Force10.pm | 21 +------- lib/SNMP/Info/Layer3/Fortinet.pm | 6 +-- lib/SNMP/Info/Layer3/Foundry.pm | 32 ++----------- lib/SNMP/Info/Layer3/Genua.pm | 16 ++++--- lib/SNMP/Info/Layer3/H3C.pm | 21 ++------ lib/SNMP/Info/Layer3/HP9300.pm | 31 ++---------- lib/SNMP/Info/Layer3/Huawei.pm | 9 ++-- lib/SNMP/Info/Layer3/IBMGbTor.pm | 10 +--- lib/SNMP/Info/Layer3/Juniper.pm | 27 ++--------- lib/SNMP/Info/Layer3/Lantronix.pm | 23 +++------ lib/SNMP/Info/Layer3/Lenovo.pm | 1 - lib/SNMP/Info/Layer3/Microsoft.pm | 6 +-- lib/SNMP/Info/Layer3/Mikrotik.pm | 2 +- lib/SNMP/Info/Layer3/N1600.pm | 7 +-- lib/SNMP/Info/Layer3/NetSNMP.pm | 19 +------- lib/SNMP/Info/Layer3/Netscreen.pm | 8 +--- lib/SNMP/Info/Layer3/Nexus.pm | 2 +- lib/SNMP/Info/Layer3/OneAccess.pm | 3 +- lib/SNMP/Info/Layer3/PacketFront.pm | 4 +- lib/SNMP/Info/Layer3/PaloAlto.pm | 9 ++-- lib/SNMP/Info/Layer3/Passport.pm | 2 +- lib/SNMP/Info/Layer3/Pf.pm | 24 ++-------- lib/SNMP/Info/Layer3/Pica8.pm | 32 ++++--------- lib/SNMP/Info/Layer3/SonicWALL.pm | 13 +++-- lib/SNMP/Info/Layer3/Steelhead.pm | 5 +- lib/SNMP/Info/Layer3/Sun.pm | 2 +- lib/SNMP/Info/Layer3/Tasman.pm | 2 +- lib/SNMP/Info/Layer3/Timetra.pm | 9 ++-- lib/SNMP/Info/Layer3/VMware.pm | 2 +- lib/SNMP/Info/Layer3/VyOS.pm | 1 + lib/SNMP/Info/Layer7.pm | 11 +++-- lib/SNMP/Info/Layer7/APC.pm | 6 +-- lib/SNMP/Info/Layer7/Arbor.pm | 5 +- lib/SNMP/Info/Layer7/CiscoIPS.pm | 3 +- lib/SNMP/Info/Layer7/Gigamon.pm | 1 + lib/SNMP/Info/Layer7/Liebert.pm | 3 +- lib/SNMP/Info/Layer7/Neoteris.pm | 1 + lib/SNMP/Info/Layer7/Netscaler.pm | 1 + lib/SNMP/Info/MAU.pm | 8 ++-- lib/SNMP/Info/NortelStack.pm | 4 +- lib/SNMP/Info/PowerEthernet.pm | 2 +- lib/SNMP/Info/RapidCity.pm | 10 ++-- lib/SNMP/Info/SONMP.pm | 10 ++-- t/00_load.t | 1 - xt/00_local_distribution.t | 1 - xt/00_local_docininfo.t | 1 - xt/00_local_perlcritic.t | 1 - xt/00_local_pod-coverage.t | 1 - xt/00_local_pod.t | 1 - xt/00_local_prereq.t | 1 - xt/00_local_spelling.t | 1 - xt/00_local_versionsync.t | 1 - xt/lib/My/Test/Class.pm | 4 +- xt/lib/Test/SNMP/Info.pm | 2 + xt/lib/Test/SNMP/Info/Layer2/3Com.pm | 2 +- xt/lib/Test/SNMP/Info/Layer2/Aironet.pm | 1 - xt/lib/Test/SNMP/Info/Layer2/Kentrox.pm | 4 +- xt/lib/Test/SNMP/Info/Layer2/Ubiquiti.pm | 4 +- xt/lib/Test/SNMP/Info/Layer3/BlueCoatSG.pm | 2 +- xt/lib/Test/SNMP/Info/Layer3/Cumulus.pm | 2 +- xt/lib/Test/SNMP/Info/Layer3/ERX.pm | 2 +- xt/lib/Test/SNMP/Info/Layer3/Huawei.pm | 2 +- xt/lib/Test/SNMP/Info/Layer3/Pica8.pm | 2 +- 149 files changed, 630 insertions(+), 1168 deletions(-) diff --git a/lib/SNMP/Info.pm b/lib/SNMP/Info.pm index 9f021307..38d0486e 100644 --- a/lib/SNMP/Info.pm +++ b/lib/SNMP/Info.pm @@ -583,7 +583,7 @@ See documentation in L for details. =item SNMP::Info::Layer2::Cisco Generic Cisco subclass for layer 2 devices that are not yet supported -in more specific subclassesand the base layer 2 Cisco class for +in more specific subclasses and the base layer 2 Cisco class for other device specific layer 2 Cisco classes. See documentation in L for details. @@ -651,7 +651,7 @@ See documentation in L for details. Subclass for Nexans switches -See documetion in L for details. +See documentation in L for details. =item SNMP::Info::Layer2::NWSS2300 @@ -704,8 +704,6 @@ See documentation in L for details. Subclass for Cisco Aironet wireless access points (AP) not running IOS. These are usually older devices. -MIBs for these devices now included in v2.tar.gz available from ftp.cisco.com. - Note L See documentation in L for details. @@ -764,8 +762,9 @@ See documentation in L for details. =item SNMP::Info::Layer3::C6500 -This class covers Catalyst 6500s in native mode, hybrid mode. Catalyst -3750's, 2970's and probably others. +This class covers Catalyst 6500 series running CatOS or IOS, as well as +Catalyst 2960, 2970, 3750 and 3850 series, including blade switches +CBS30x0 and CBS31x0 series, all running IOS. See documentation in L for details. @@ -1005,7 +1004,7 @@ See documentation in L for details. =item SNMP::Info::Layer3::Steelhead -Subclass for Riverbed Steelhead WAN optimization appliances. +Subclass for Riverbed Steelhead WAN optimization appliances. See documentation in L for details. @@ -1261,7 +1260,7 @@ Some older devices don't support SNMP version 2, and will not return anything when a connection under Version 2 is attempted. Some newer devices will support Version 1, but will not return all the data -they might have if you had connected under Version 1 +they might have if you had connected under Version 1. When trying to get info from a new device, you may have to try version 2 and then fallback to version 1. @@ -1673,6 +1672,7 @@ sub device_type { 3375 => 'SNMP::Info::Layer3::F5', 3417 => 'SNMP::Info::Layer3::BlueCoatSG', 3717 => 'SNMP::Info::Layer3::Genua', + 4413 => 'SNMP::Info::Layer2::Ubiquiti', 4526 => 'SNMP::Info::Layer2::Netgear', 4874 => 'SNMP::Info::Layer3::ERX', 5624 => 'SNMP::Info::Layer3::Enterasys', @@ -1694,17 +1694,16 @@ sub device_type { 17163 => 'SNMP::Info::Layer3::Steelhead', 19046 => 'SNMP::Info::Layer3::Lenovo', 21091 => 'SNMP::Info::Layer2::Exinda', - 25506 => 'SNMP::Info::Layer3::H3C', 25461 => 'SNMP::Info::Layer3::PaloAlto', + 25506 => 'SNMP::Info::Layer3::H3C', 26543 => 'SNMP::Info::Layer3::IBMGbTor', - 30065 => 'SNMP::Info::Layer3::Arista', - 35098 => 'SNMP::Info::Layer3::Pica8', - 41112 => 'SNMP::Info::Layer2::Ubiquiti', - 4413 => 'SNMP::Info::Layer2::Ubiquiti', 26928 => 'SNMP::Info::Layer2::Aerohive', + 30065 => 'SNMP::Info::Layer3::Arista', 30803 => 'SNMP::Info::Layer3::VyOS', - 44641 => 'SNMP::Info::Layer3::VyOS', + 35098 => 'SNMP::Info::Layer3::Pica8', 40310 => 'SNMP::Info::Layer3::Cumulus', + 41112 => 'SNMP::Info::Layer2::Ubiquiti', + 44641 => 'SNMP::Info::Layer3::VyOS', ); my %l2sysoidmap = ( @@ -1753,8 +1752,8 @@ sub device_type { 476 => 'SNMP::Info::Layer7::Liebert', 5951 => 'SNMP::Info::Layer7::Netscaler', 9694 => 'SNMP::Info::Layer7::Arbor', - 14525 => 'SNMP::Info::Layer2::Trapeze', 12532 => 'SNMP::Info::Layer7::Neoteris', + 14525 => 'SNMP::Info::Layer2::Trapeze', 26866 => 'SNMP::Info::Layer7::Gigamon', ); @@ -1787,7 +1786,7 @@ sub device_type { $objtype = 'SNMP::Info::Layer3::Aironet' if ( $desc =~ /Aironet/ and $desc =~ /\D(AP4800)\D/ ); - # Override voice gateway device (VG350) showing up as Aironet + # Override voice gateway device (VG350) showing up as Aironet $objtype = 'SNMP::Info::Layer3::Cisco' if $desc =~ /VG350/; # Cat6k with older SUPs (hybrid CatOS/IOS?) @@ -2243,7 +2242,7 @@ sub cisco_comm_indexing { =back -=head2 Globals (Scalar Methods) +=head2 GLOBALS (Scalar Methods) These are methods to return scalar data from RFC1213. @@ -3234,7 +3233,7 @@ A class inheriting this class must implement these data structures : =over -=item $INIT +=item $INIT Used to flag if the MIBs have been loaded yet. @@ -3381,7 +3380,7 @@ $info->init() will throw an exception if a MIB does not load. %MIBS = ( # Include these here for cases where the Net-SNMP default MIB list has - # been overridden during the compliation of the local Net-SNMP library. + # been overridden during the compilation of the local Net-SNMP library. # These cover the globals and funcs defined in this file. 'SNMPv2-MIB' => 'sysObjectID', # (#325) 'RFC1213-MIB' => 'ipRouteIfIndex', @@ -3438,6 +3437,7 @@ will inherit the Cisco Vlan module as an example. $VERSION = 0.1; use strict; + use warnings; use Exporter; use SNMP::Info::Layer2; @@ -3451,14 +3451,14 @@ will inherit the Cisco Vlan module as an example. %MIBS = (%SNMP::Info::Layer2::MIBS, %SNMP::Info::CiscoVTP::MIBS, - 'SUPER-DOOPER-MIB' => 'supermibobject' + 'SUPER-DOOPER-MIB' => 'supermibobject', ); %GLOBALS = (%SNMP::Info::Layer2::GLOBALS, %SNMP::Info::CiscoVTP::GLOBALS, 'name' => 'supermib_supername', 'favorite_color' => 'supermib_fav_color_object', - 'favorite_movie' => 'supermib_fav_movie_val' + 'favorite_movie' => 'supermib_fav_movie_val', ); %FUNCS = (%SNMP::Info::Layer2::FUNCS, @@ -3466,16 +3466,16 @@ will inherit the Cisco Vlan module as an example. # Super Dooper MIB - Super Hero Table 'super_hero_index' => 'SuperHeroIfIndex', 'super_hero_name' => 'SuperHeroIfName', - 'super_hero_powers' => 'SuperHeroIfPowers' + 'super_hero_powers' => 'SuperHeroIfPowers', ); %MUNGE = (%SNMP::Info::Layer2::MUNGE, %SNMP::Info::CiscoVTP::MUNGE, - 'super_hero_powers' => \&munge_powers + 'super_hero_powers' => \&munge_powers, ); - # OverRide uptime() method from %SNMP::Info::GLOBALS + # Override uptime() method from %SNMP::Info::GLOBALS sub uptime { my $sample = shift; @@ -3826,7 +3826,7 @@ updated enumeration for C in C. This munge handles the "newer" definitions for the enumeration in IF-MIB. TODO: Get the precedence of MIBs and overriding of MIB data in Net-SNMP -figured out. Heirarchy/precendence of MIBS in SNMP::Info. +figured out. Hierarchy/precedence of MIBS in SNMP::Info. =cut @@ -3898,7 +3898,7 @@ sub munge_e_type { Takes the SNMP::Session C argument and determines if it is an 'IPv4' or 'IPv6' host. 'IPv6' hosts are prefixed with the C -C as required by the undelying C library. +C as required by the underlying C library. If unable to determine the type of address or resolve a DNS name, dies with C. @@ -4611,7 +4611,7 @@ sub _load_attr { # Another check for SNMPv1 - noSuchName return may results in an $iid # we've already seen and $val an empty string. If we don't catch - # this here we erronously report a loop below. + # this here we erroneously report a loop below. if ( defined $seen{$iid} and $seen{$iid} and $val eq '' ) { last; } @@ -4886,7 +4886,7 @@ sub _validate_autoload_method { || ($method !~ /^set/ && $access eq 'NoAccess')) { print - "SNMP::Info::_validate_autoload_method($attr : $oid) Not accessable for requested operation.\n" + "SNMP::Info::_validate_autoload_method($attr : $oid) Not accessible for requested operation.\n" if $self->debug(); return; diff --git a/lib/SNMP/Info/AMAP.pm b/lib/SNMP/Info/AMAP.pm index 855a8b7f..bfe267a7 100644 --- a/lib/SNMP/Info/AMAP.pm +++ b/lib/SNMP/Info/AMAP.pm @@ -30,6 +30,7 @@ package SNMP::Info::AMAP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -40,16 +41,16 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); $VERSION = '3.68'; -%MIBS - = ( 'ALCATEL-IND1-INTERSWITCH-PROTOCOL-MIB' => 'aipAMAPRemDeviceType', ); +%MIBS = ( + 'ALCATEL-IND1-INTERSWITCH-PROTOCOL-MIB' => 'aipAMAPRemDeviceType', +); %GLOBALS = ( ); %FUNCS = ( - - # EXTREME-EDP-MIB::extremeEdpTable + # ALCATEL-IND1-INTERSWITCH-PROTOCOL-MIB::aipAMAPRemHostname 'amap_rem_sysname' => 'aipAMAPRemHostname', ); @@ -91,7 +92,7 @@ sub _conn_table_mac { # address since they should all originate from the same device, but we don't # know if they would all be reachable from the network management application. # -# We don't inplement partials since this is private index function +# We don't implement partials since this is private index function sub _amap_index { my $amap = shift; @@ -253,7 +254,7 @@ Eric Miller $hasamap = $amap->hasAMAP() ? 'yes' : 'no'; - # Print out a map of device ports with LLDP neighbors: + # Print out a map of device ports with AMAP neighbors: my $interfaces = $amap->interfaces(); my $amap_if = $amap->amap_if(); my $amap_ip = $amap->amap_ip(); @@ -291,7 +292,7 @@ None. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/AdslLine.pm b/lib/SNMP/Info/AdslLine.pm index 4c935c33..9c2e6386 100644 --- a/lib/SNMP/Info/AdslLine.pm +++ b/lib/SNMP/Info/AdslLine.pm @@ -30,6 +30,7 @@ package SNMP::Info::AdslLine; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -105,8 +106,6 @@ none. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS =over diff --git a/lib/SNMP/Info/Aggregate.pm b/lib/SNMP/Info/Aggregate.pm index e1e86cab..587ecb5c 100644 --- a/lib/SNMP/Info/Aggregate.pm +++ b/lib/SNMP/Info/Aggregate.pm @@ -30,6 +30,7 @@ package SNMP::Info::Aggregate; use strict; +use warnings; use Exporter; use SNMP::Info; diff --git a/lib/SNMP/Info/Airespace.pm b/lib/SNMP/Info/Airespace.pm index cf3ba7f5..c595402c 100644 --- a/lib/SNMP/Info/Airespace.pm +++ b/lib/SNMP/Info/Airespace.pm @@ -1,5 +1,4 @@ # SNMP::Info::Airespace -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Airespace; use strict; +use warnings; use Exporter; use SNMP::Info; diff --git a/lib/SNMP/Info/Bridge.pm b/lib/SNMP/Info/Bridge.pm index a583cd6e..b36fc9d2 100644 --- a/lib/SNMP/Info/Bridge.pm +++ b/lib/SNMP/Info/Bridge.pm @@ -1,5 +1,4 @@ # SNMP::Info::Bridge -# $Id$ # # Changes since Version 0.7 Copyright (c) 2004 Max Baker # All rights reserved. @@ -34,6 +33,7 @@ package SNMP::Info::Bridge; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -296,11 +296,11 @@ sub i_stp_port { my %i_stp_port; foreach my $index ( keys %$stp_p_port ) { - my $bridge = $stp_p_port->{$index}; + my $bport = $stp_p_port->{$index}; my $iid = $bp_index->{$index}; next unless defined $iid; - next unless defined $bridge; - $i_stp_port{$iid} = $bridge; + next unless defined $bport; + $i_stp_port{$iid} = $bport; } return \%i_stp_port; } @@ -315,11 +315,11 @@ sub i_stp_id { my %i_stp_id; foreach my $index ( keys %$stp_p_id ) { - my $bridge = $stp_p_id->{$index}; + my $bport = $stp_p_id->{$index}; my $iid = $bp_index->{$index}; next unless defined $iid; - next unless defined $bridge; - $i_stp_id{$iid} = $bridge; + next unless defined $bport; + $i_stp_id{$iid} = $bport; } return \%i_stp_id; } @@ -334,11 +334,11 @@ sub i_stp_bridge { my %i_stp_bridge; foreach my $index ( keys %$stp_p_bridge ) { - my $bridge = $stp_p_bridge->{$index}; + my $bport = $stp_p_bridge->{$index}; my $iid = $bp_index->{$index}; next unless defined $iid; - next unless defined $bridge; - $i_stp_bridge{$iid} = $bridge; + next unless defined $bport; + $i_stp_bridge{$iid} = $bport; } return \%i_stp_bridge; } @@ -609,12 +609,11 @@ None. =item F +=item F + =back -F needs to be extracted from -ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz - -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/CDP.pm b/lib/SNMP/Info/CDP.pm index 712a3628..c93b8b1a 100644 --- a/lib/SNMP/Info/CDP.pm +++ b/lib/SNMP/Info/CDP.pm @@ -1,5 +1,4 @@ # SNMP::Info::CDP -# $Id$ # # Changes since Version 0.7 Copyright (c) 2004 Max Baker # All rights reserved. @@ -34,6 +33,7 @@ package SNMP::Info::CDP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -259,7 +259,7 @@ Max Baker $hascdp = $cdp->hasCDP() ? 'yes' : 'no'; # Print out a map of device ports with CDP neighbors: - my $interfaces = $cdp->interfaces(); + my $interfaces = $cdp->interfaces(); my $cdp_if = $cdp->cdp_if(); my $cdp_ip = $cdp->cdp_ip(); my $cdp_port = $cdp->cdp_port(); @@ -299,9 +299,7 @@ None. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/CiscoAgg.pm b/lib/SNMP/Info/CiscoAgg.pm index 2070460b..82f1e2ad 100644 --- a/lib/SNMP/Info/CiscoAgg.pm +++ b/lib/SNMP/Info/CiscoAgg.pm @@ -30,7 +30,7 @@ package SNMP::Info::CiscoAgg; use strict; -#use warnings; +use warnings; use Exporter; use SNMP::Info::IEEE802dot3ad; @@ -191,9 +191,7 @@ L =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - -=head1 METHODS +=head1 TABLE METHODS =over 4 diff --git a/lib/SNMP/Info/CiscoConfig.pm b/lib/SNMP/Info/CiscoConfig.pm index 239d55c9..183bdac7 100644 --- a/lib/SNMP/Info/CiscoConfig.pm +++ b/lib/SNMP/Info/CiscoConfig.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoConfig -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoConfig; use strict; +use warnings; use Exporter; use SNMP::Info; diff --git a/lib/SNMP/Info/CiscoPortSecurity.pm b/lib/SNMP/Info/CiscoPortSecurity.pm index bb0ec4bf..50de33bb 100644 --- a/lib/SNMP/Info/CiscoPortSecurity.pm +++ b/lib/SNMP/Info/CiscoPortSecurity.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoPortSecurity -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoPortSecurity; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -110,7 +110,7 @@ $VERSION = '3.68'; %PAECAPABILITIES = ( 0 => 'dot1xPaePortAuthCapable', - 1 => 'dot1xPaePortSuppCapable' + 1 => 'dot1xPaePortSuppCapable', ); sub munge_pae_capabilities { diff --git a/lib/SNMP/Info/CiscoPower.pm b/lib/SNMP/Info/CiscoPower.pm index 75648244..8d0ec32c 100644 --- a/lib/SNMP/Info/CiscoPower.pm +++ b/lib/SNMP/Info/CiscoPower.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoPower -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoPower; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -42,7 +42,8 @@ our ($VERSION, %MIBS, %FUNCS, %GLOBALS, %MUNGE); $VERSION = '3.68'; %MIBS = ( 'CISCO-POWER-ETHERNET-EXT-MIB' => 'cpeExtPsePortEntPhyIndex', - 'CISCO-CDP-MIB' => 'cdpCachePowerConsumption' ); + 'CISCO-CDP-MIB' => 'cdpCachePowerConsumption', +); %GLOBALS = (); @@ -153,6 +154,8 @@ Note that it requires that the device inherits from Info::Entity. =item F +=item F + =back =head1 GLOBALS diff --git a/lib/SNMP/Info/CiscoQOS.pm b/lib/SNMP/Info/CiscoQOS.pm index d0b57b71..ac43b107 100644 --- a/lib/SNMP/Info/CiscoQOS.pm +++ b/lib/SNMP/Info/CiscoQOS.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoQOS -# $Id$ # # Copyright (c) 2005 Alexander Hartmaier # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoQOS; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -118,8 +118,6 @@ none. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS =over diff --git a/lib/SNMP/Info/CiscoRTT.pm b/lib/SNMP/Info/CiscoRTT.pm index df67fa0c..ddcfc51d 100644 --- a/lib/SNMP/Info/CiscoRTT.pm +++ b/lib/SNMP/Info/CiscoRTT.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoRTT -# $Id$ # # Copyright (c) 2005 Alexander Hartmaier # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoRTT; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -99,8 +99,6 @@ none. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS =over @@ -113,7 +111,7 @@ None =head2 Overall Control Group Table -This table is from C +This table is from C =over diff --git a/lib/SNMP/Info/CiscoStack.pm b/lib/SNMP/Info/CiscoStack.pm index 39fdddbd..e4293a3f 100644 --- a/lib/SNMP/Info/CiscoStack.pm +++ b/lib/SNMP/Info/CiscoStack.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoStack -# $Id$ # # Copyright (c) 2008 Max Baker # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::CiscoStack; use strict; +use warnings; use Exporter; @SNMP::Info::CiscoStack::ISA = qw/Exporter/; @@ -106,7 +106,7 @@ $VERSION = '3.68'; 1 => 'other', 2 => 'ok', 3 => 'minorFault', - 4 => 'majorFault' + 4 => 'majorFault', ); # Changes binary byte describing each port into ascii, and returns @@ -286,8 +286,7 @@ __END__ =head1 NAME -SNMP::Info::CiscoStack - SNMP Interface to data from F and -F +SNMP::Info::CiscoStack - SNMP Interface to data from F =head1 AUTHOR @@ -296,7 +295,7 @@ Max Baker =head1 SYNOPSIS # Let SNMP::Info determine the correct subclass for you. - my $ciscostats = new SNMP::Info( + my $ciscostack = new SNMP::Info( AutoSpecify => 1, Debug => 1, DestHost => 'myswitch', @@ -305,7 +304,7 @@ Max Baker ) or die "Can't connect to DestHost.\n"; - my $class = $ciscostats->class(); + my $class = $ciscostack->class(); print "SNMP::Info determined this device to fall under subclass : $class\n"; =head1 DESCRIPTION diff --git a/lib/SNMP/Info/CiscoStats.pm b/lib/SNMP/Info/CiscoStats.pm index ef718cdf..bd17ddb8 100644 --- a/lib/SNMP/Info/CiscoStats.pm +++ b/lib/SNMP/Info/CiscoStats.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoStats -# $Id$ # # Changes since Version 0.7 Copyright (c) 2008-2009 Max Baker and SNMP::Info Developers # All rights reserved. @@ -34,6 +33,7 @@ package SNMP::Info::CiscoStats; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -385,8 +385,6 @@ None. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS =over diff --git a/lib/SNMP/Info/CiscoStpExtensions.pm b/lib/SNMP/Info/CiscoStpExtensions.pm index 8f682c50..c8d5fea4 100644 --- a/lib/SNMP/Info/CiscoStpExtensions.pm +++ b/lib/SNMP/Info/CiscoStpExtensions.pm @@ -29,7 +29,7 @@ package SNMP::Info::CiscoStpExtensions; use strict; - +use warnings; use Exporter; use SNMP::Info; use SNMP::Info::Bridge; @@ -317,9 +317,7 @@ For debugging you can call new() directly as you would in SNMP::Info =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/CiscoVTP.pm b/lib/SNMP/Info/CiscoVTP.pm index cd8a0101..f0229f6f 100644 --- a/lib/SNMP/Info/CiscoVTP.pm +++ b/lib/SNMP/Info/CiscoVTP.pm @@ -1,5 +1,4 @@ # SNMP::Info::CiscoVTP -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::CiscoVTP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -565,8 +565,6 @@ None. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS =over diff --git a/lib/SNMP/Info/DocsisHE.pm b/lib/SNMP/Info/DocsisHE.pm index b947e178..cc7a6aff 100644 --- a/lib/SNMP/Info/DocsisHE.pm +++ b/lib/SNMP/Info/DocsisHE.pm @@ -1,6 +1,7 @@ package SNMP::Info::DocsisHE; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -14,7 +15,7 @@ $VERSION = '3.68'; %MIBS = ( 'DOCS-IF3-MIB' => 'docsIf3Mib', - 'DOCS-IF-MIB' => 'docsIfMib' + 'DOCS-IF-MIB' => 'docsIfMib', ); %GLOBALS = (); @@ -26,12 +27,12 @@ $VERSION = '3.68'; 'docs_if_cmts_cm_status_inet_address_type' => 'docsIfCmtsCmStatusInetAddressType', 'docs_if_cmts_cm_status_inet_address' => 'docsIfCmtsCmStatusInetAddress', 'docs_cmts_cm_down_channel_if_index' => 'docsIfCmtsCmStatusDownChannelIfIndex', - 'docs_cmts_cm_up_channel_if_index' => 'docsIfCmtsCmStatusUpChannelIfIndex' + 'docs_cmts_cm_up_channel_if_index' => 'docsIfCmtsCmStatusUpChannelIfIndex', ); %MUNGE = (); - 1; +1; __END__ =head1 NAME @@ -74,7 +75,7 @@ CableLabs MIBs for DOCSIS 3 =back -=head1 GLOBAL METHODS +=head1 GLOBALS None. @@ -119,3 +120,5 @@ cable modem. (C) =back + +=cut diff --git a/lib/SNMP/Info/EDP.pm b/lib/SNMP/Info/EDP.pm index f984c6f2..2f4e5a34 100644 --- a/lib/SNMP/Info/EDP.pm +++ b/lib/SNMP/Info/EDP.pm @@ -31,6 +31,7 @@ package SNMP::Info::EDP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -75,7 +76,7 @@ sub hasEDP { # address since they should all originate from the same device, but we don't # know if they would all be reachable from the network management application. # -# We don't inplement partials since this is private index function +# We don't implement partials since this is private index function sub _edp_index { my $edp = shift; @@ -204,10 +205,10 @@ Eric Miller my $class = $edp->class(); print " Using device sub class : $class\n"; - $haslldp = $edp->hasLLDP() ? 'yes' : 'no'; + $hasedp = $edp->hasEDP() ? 'yes' : 'no'; - # Print out a map of device ports with LLDP neighbors: - my $interfaces = $edp->interfaces(); + # Print out a map of device ports with EDP neighbors: + my $interfaces = $edp->interfaces(); my $edp_if = $edp->edp_if(); my $edp_ip = $edp->edp_ip(); my $edp_port = $edp->edp_port(); @@ -243,7 +244,7 @@ None. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP @@ -251,7 +252,7 @@ These are methods that return scalar values from SNMP =item $edp->hasEDP() -Is EDP is active in this device? +Is EDP active on this device? =back diff --git a/lib/SNMP/Info/Entity.pm b/lib/SNMP/Info/Entity.pm index 227b272b..579d00b4 100644 --- a/lib/SNMP/Info/Entity.pm +++ b/lib/SNMP/Info/Entity.pm @@ -1,5 +1,4 @@ # SNMP::Info::Entity -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Entity; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -75,7 +75,7 @@ sub e_index { my $entity = shift; my $partial = shift; - # Force use of MIB leaf to avoid inheritance issues in psuedo classes + # Force use of MIB leaf to avoid inheritance issues in pseudo classes my $e_descr = $entity->entPhysicalDescr($partial); return unless ($e_descr); @@ -213,8 +213,6 @@ none. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS none. diff --git a/lib/SNMP/Info/EtherLike.pm b/lib/SNMP/Info/EtherLike.pm index 0671aa8f..532e5a72 100644 --- a/lib/SNMP/Info/EtherLike.pm +++ b/lib/SNMP/Info/EtherLike.pm @@ -1,5 +1,4 @@ # SNMP::Info::EtherLike -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::EtherLike; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -68,7 +68,7 @@ $VERSION = '3.68'; 'el_xmit_defer' => 'dot3StatsDeferredTransmissions', # Ethernet-like Collision Statistics Group - 'el_coll_freq' => 'dot3CollFrequencies' + 'el_coll_freq' => 'dot3CollFrequencies', ); %MUNGE = ( %SNMP::Info::MUNGE, 'el_duplex' => \&munge_el_duplex, ); @@ -103,7 +103,7 @@ Max Baker Version => 2 ); - my $class = $cdp->class(); + my $class = $el->class(); print " Using device sub class : $class\n"; # Find the duplex setting for a port on a device that implements @@ -143,8 +143,6 @@ None. =back -MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz - =head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/FDP.pm b/lib/SNMP/Info/FDP.pm index 580b7678..004e3ed4 100644 --- a/lib/SNMP/Info/FDP.pm +++ b/lib/SNMP/Info/FDP.pm @@ -1,5 +1,4 @@ # SNMP::Info::FDP -# $Id$ # # Copyright (c) 2008 Bruce Rodger, Max Baker # All rights reserved. @@ -34,6 +33,7 @@ package SNMP::Info::FDP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -65,7 +65,7 @@ $VERSION = '3.68'; %MUNGE = ( 'fdp_capabilities' => \&SNMP::Info::munge_bits, - 'fdp_ip' => \&SNMP::Info::munge_ip + 'fdp_ip' => \&SNMP::Info::munge_ip, ); sub fdp_run { @@ -146,7 +146,7 @@ Bruce Rodger, Max Baker $hasfdp = $fdp->hasFDP() ? 'yes' : 'no'; # Print out a map of device ports with FDP neighbors: - my $interfaces = $fdp->interfaces(); + my $interfaces = $fdp->interfaces(); my $fdp_if = $fdp->fdp_if(); my $fdp_ip = $fdp->fdp_ip(); my $fdp_port = $fdp->fdp_port(); @@ -190,7 +190,7 @@ work with B2R07600C. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/IEEE802dot11.pm b/lib/SNMP/Info/IEEE802dot11.pm index 1eb8ae9e..ec95b6a1 100644 --- a/lib/SNMP/Info/IEEE802dot11.pm +++ b/lib/SNMP/Info/IEEE802dot11.pm @@ -1,5 +1,4 @@ # SNMP::Info::IEEE802dot11 -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::IEEE802dot11; use strict; +use warnings; use Exporter; use SNMP::Info; diff --git a/lib/SNMP/Info/IEEE802dot3ad.pm b/lib/SNMP/Info/IEEE802dot3ad.pm index eb74fff7..e6c7647f 100644 --- a/lib/SNMP/Info/IEEE802dot3ad.pm +++ b/lib/SNMP/Info/IEEE802dot3ad.pm @@ -30,6 +30,7 @@ package SNMP::Info::IEEE802dot3ad; use strict; +use warnings; use Exporter; use SNMP::Info::Aggregate; diff --git a/lib/SNMP/Info/IPv6.pm b/lib/SNMP/Info/IPv6.pm index ec0be40a..2b1b26f6 100644 --- a/lib/SNMP/Info/IPv6.pm +++ b/lib/SNMP/Info/IPv6.pm @@ -30,6 +30,7 @@ package SNMP::Info::IPv6; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -479,7 +480,9 @@ none. =over =item F + =item F + =item F =back diff --git a/lib/SNMP/Info/LLDP.pm b/lib/SNMP/Info/LLDP.pm index 291851f2..a8e6356d 100644 --- a/lib/SNMP/Info/LLDP.pm +++ b/lib/SNMP/Info/LLDP.pm @@ -1,5 +1,4 @@ # SNMP::Info::LLDP -# $Id$ # # Copyright (c) 2018 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::LLDP; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -512,7 +512,7 @@ None. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/Layer1.pm b/lib/SNMP/Info/Layer1.pm index 1beefd40..0cb34d22 100644 --- a/lib/SNMP/Info/Layer1.pm +++ b/lib/SNMP/Info/Layer1.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1 - SNMP Interface to Layer1 Devices -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer1; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -49,7 +49,7 @@ $VERSION = '3.68'; %SNMP::Info::GLOBALS, 'ports_managed' => 'ifNumber', 'rptr_slots' => 'rptrGroupCapacity', - 'slots' => 'rptrGroupCapacity' + 'slots' => 'rptrGroupCapacity', ); %FUNCS = ( @@ -86,7 +86,7 @@ sub ports { } # $l1->model() - Looks at sysObjectID which gives the oid of the system -# name, contained in a propriatry MIB. +# name, contained in a proprietary MIB. sub model { my $l1 = shift; my $id = $l1->id(); @@ -178,7 +178,7 @@ Max Baker Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -227,12 +227,9 @@ after determining a more specific class using the method above. =back -MIBs required for L +MIBs required for L -See L for its MIB requirements. - -F needs to be extracted from -ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz +See L for its MIB requirements. =head1 GLOBALS @@ -278,7 +275,7 @@ Number of 'groups' in the Repeater MIB =head2 Global Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head1 TABLE METHODS @@ -341,6 +338,6 @@ Group (slot) Number for given port. =head2 Table Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =cut diff --git a/lib/SNMP/Info/Layer1/Allied.pm b/lib/SNMP/Info/Layer1/Allied.pm index 82784f50..4806c1da 100644 --- a/lib/SNMP/Info/Layer1/Allied.pm +++ b/lib/SNMP/Info/Layer1/Allied.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1::Allied -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer1::Allied; use strict; +use warnings; use Exporter; use SNMP::Info::Layer1; @@ -52,9 +52,14 @@ $VERSION = '3.68'; 'ati_up' => 'linkTestLED', ); -%MIBS = ( %SNMP::Info::Layer1::MIBS, 'ATI-MIB' => 'atiPortGroupIndex' ); +%MIBS = ( + %SNMP::Info::Layer1::MIBS, + 'ATI-MIB' => 'atiPortGroupIndex', +); -%MUNGE = ( %SNMP::Info::Layer1::MUNGE, ); +%MUNGE = ( + %SNMP::Info::Layer1::MUNGE, +); sub vendor { return 'allied'; @@ -68,7 +73,7 @@ sub os_ver { my $allied = shift; my $descr = $allied->description(); - if ( $descr =~ m/version (\d+\.\d+)/ ) { + if ( defined ($descr) && $descr =~ m/version (\d+\.\d+)/ ) { return $1; } return; @@ -79,7 +84,7 @@ sub model { my $desc = $allied->description(); - if ( $desc =~ /(AT-\d{4}\S{1})/ ) { + if ( defined ($desc) && $desc =~ /(AT-\d{4}\S{1})/ ) { return $1; } return; diff --git a/lib/SNMP/Info/Layer1/Asante.pm b/lib/SNMP/Info/Layer1/Asante.pm index 6a881211..06c4e6ed 100644 --- a/lib/SNMP/Info/Layer1/Asante.pm +++ b/lib/SNMP/Info/Layer1/Asante.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1::Asante -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer1::Asante; use strict; +use warnings; use Exporter; use SNMP::Info::Layer1; @@ -81,7 +81,7 @@ sub os_ver { my $asante = shift; my $descr = $asante->description(); - if ( $descr =~ /software v(\d+\.\d+)/ ) { + if ( defined ($descr) && $descr =~ /software v(\d+\.\d+)/ ) { return $1; } return; @@ -188,7 +188,7 @@ Max Baker =head1 DESCRIPTION -Provides abstraction to the configuration information obtainable from a +Provides abstraction to the configuration information obtainable from an Asante device through SNMP. =head2 Inherited Classes @@ -227,7 +227,7 @@ Culls software version from description() =item $asante->vendor() -Returns 'asante' :) +Returns 'asante' =item $asante->model() diff --git a/lib/SNMP/Info/Layer1/Bayhub.pm b/lib/SNMP/Info/Layer1/Bayhub.pm index 6923e859..5ff8b81d 100644 --- a/lib/SNMP/Info/Layer1/Bayhub.pm +++ b/lib/SNMP/Info/Layer1/Bayhub.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1::Bayhub -# $Id$ # # Copyright (c) 2008 Eric Miller, Max Baker # All rights reserved. @@ -31,13 +30,14 @@ package SNMP::Info::Layer1::Bayhub; use strict; +use warnings; use Exporter; use SNMP::Info::SONMP; use SNMP::Info::NortelStack; use SNMP::Info::Layer2; @SNMP::Info::Layer1::Bayhub::ISA - = qw/SNMP::Info::SONMP SNMP::Info::NortelStack SNMP::Info::Layer2 Exporter/; + = qw/SNMP::Info::SONMP SNMP::Info::NortelStack SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer1::Bayhub::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); @@ -505,11 +505,6 @@ Provides abstraction to the configuration information obtainable from a Bay hub device through SNMP. Also provides device MAC to port mapping through the proprietary 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 $bayhub = new SNMP::Info::Layer1::Bayhub(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer1/Cyclades.pm b/lib/SNMP/Info/Layer1/Cyclades.pm index a4645337..34fe78e4 100644 --- a/lib/SNMP/Info/Layer1/Cyclades.pm +++ b/lib/SNMP/Info/Layer1/Cyclades.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1::Cyclades -# $Id$ # # Copyright (c) 2018 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer1::Cyclades; use strict; +use warnings; use Exporter; use SNMP::Info::Layer1; @@ -498,11 +498,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from a Cyclades/Avocent 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 $cyclades = new SNMP::Info::Layer1::Cyclades(...); - =head2 Inherited Classes =over @@ -515,6 +510,10 @@ my $cyclades = new SNMP::Info::Layer1::Cyclades(...); =over +=item F + +=item F + =item F =item F @@ -527,8 +526,6 @@ my $cyclades = new SNMP::Info::Layer1::Cyclades(...); =item F -=item F - =back =head2 Inherited MIBs diff --git a/lib/SNMP/Info/Layer1/S3000.pm b/lib/SNMP/Info/Layer1/S3000.pm index 5833fa64..9636a524 100644 --- a/lib/SNMP/Info/Layer1/S3000.pm +++ b/lib/SNMP/Info/Layer1/S3000.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer1::S3000 -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer1::S3000; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -386,11 +386,6 @@ Provides abstraction to the configuration information obtainable from a Bay hub device through SNMP. Also provides device MAC to port mapping through the proprietary 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 diff --git a/lib/SNMP/Info/Layer2.pm b/lib/SNMP/Info/Layer2.pm index e741bc8d..7f7c94f1 100644 --- a/lib/SNMP/Info/Layer2.pm +++ b/lib/SNMP/Info/Layer2.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2 - SNMP Interface to Layer2 Devices -# $Id$ # # Copyright (c) 2008 Max Baker -- All changes from Version 0.7 on # @@ -33,6 +32,7 @@ package SNMP::Info::Layer2; use strict; +use warnings; use Exporter; use SNMP::Info; use SNMP::Info::Bridge; @@ -86,7 +86,7 @@ $VERSION = '3.68'; # Method OverRides # $l2->model() - Looks at sysObjectID which gives the oid of the system -# name, contained in a propriatry MIB. +# name, contained in a proprietary MIB. sub model { my $l2 = shift; my $id = $l2->id(); @@ -228,10 +228,14 @@ after determining a more specific class using the method above. =item SNMP::Info::Bridge +=item SNMP::Info::DocsisHE + =item SNMP::Info::Entity =item SNMP::Info::LLDP +=item SNMP::Info::PowerEthernet + =back =head2 Required MIBs @@ -275,7 +279,7 @@ Returns a serial number if found from F and F... MIB. =head2 Globals imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head2 Globals imported from SNMP::Info::Bridge @@ -309,7 +313,7 @@ Defaults to C but checks and overrides with C =head2 Table Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head2 Table Methods imported from SNMP::Info::Bridge diff --git a/lib/SNMP/Info/Layer2/3Com.pm b/lib/SNMP/Info/Layer2/3Com.pm index cd6a9298..010e2c16 100644 --- a/lib/SNMP/Info/Layer2/3Com.pm +++ b/lib/SNMP/Info/Layer2/3Com.pm @@ -29,12 +29,12 @@ package SNMP::Info::Layer2::3Com; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; -use SNMP::Info::LLDP; use SNMP::Info::CDP; -@SNMP::Info::Layer2::3Com::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer2 Exporter/; +@SNMP::Info::Layer2::3Com::ISA = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::3Com::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD); @@ -42,27 +42,22 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::LLDP::MIBS, %SNMP::Info::Layer2::MIBS, 'A3Com-products-MIB' => 'wlanAP7760', ); %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer2::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); - sub os { return '3Com'; } @@ -94,17 +89,19 @@ sub os_ver { } sub vendor { - return '3Com'; + return '3com'; } sub model { - my $dsmodel = shift; my $descr = $dsmodel->description(); - if ( $descr =~ /^([\S ]+) Software.*/){ + + if (defined ($descr)) { + if ($descr =~ /^([\S ]+) Software.*/) { return $1; - } else { + } else { return $descr; + } } return; } @@ -128,7 +125,7 @@ Max Kosmach Debug => 1, DestHost => 'myrouter', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -169,7 +166,7 @@ These are methods that return scalar value from SNMP =item $device->vendor() -Returns '3Com' +Returns '3com' =item $device->os() diff --git a/lib/SNMP/Info/Layer2/Adtran.pm b/lib/SNMP/Info/Layer2/Adtran.pm index 7d56609b..fe42fe19 100644 --- a/lib/SNMP/Info/Layer2/Adtran.pm +++ b/lib/SNMP/Info/Layer2/Adtran.pm @@ -29,12 +29,12 @@ package SNMP::Info::Layer2::Adtran; use strict; +use warnings; use Exporter; -use SNMP::Info::LLDP; use SNMP::Info::Layer2; use SNMP::Info::Layer3; -@SNMP::Info::Layer2::Adtran::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer2 Exporter/; +@SNMP::Info::Layer2::Adtran::ISA = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::Adtran::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -58,14 +58,12 @@ our $index = undef; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'serial' => 'adProdSerialNumber', 'ad_mgmtevcvid' => 'adGenEVCSysMgmtEVCSTagVID', ); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, 'ad_evcstag' => 'adGenEVCLookupName', 'ad_menport' => 'adGenMenPortRowStatus', 'ad_evcnamevid' => 'adGenEVCSTagVID', @@ -75,7 +73,7 @@ our $index = undef; 'ad_genportcustuse' => 'adGenPortCustomerUse', ); -%MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::LLDP::MUNGE, %SNMP::Info::Layer3::MUNGE ); +%MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::Layer3::MUNGE ); sub vendor { return 'adtran'; @@ -130,8 +128,8 @@ sub i_name { my $adname = $adtran->ad_genportcustuse() || undef; if (defined $adname) { foreach my $port (keys %$adname) { - my @split = split(/\./,$port); - $i_name->{@split[1]} = $adname->{$port}; + my @splitout = split(/\./,$port); + $i_name->{$splitout[1]} = $adname->{$port}; } } return $i_name; @@ -170,9 +168,9 @@ sub i_vlan_membership { } my $if_vlans = {}; foreach my $entry (keys %$i_vlan) { - my @split = split(/(\.0)+\./,$entry); - my $name = pack("C*", split(/\./,@split[0])); - push @{$if_vlans->{@split[2]}}, $vlans->{$name}; + my @splitout = split(/(\.0)+\./,$entry); + my $name = pack("C*", split(/\./,$splitout[0])); + push @{$if_vlans->{$splitout[2]}}, $vlans->{$name}; } my $mgmtevcports = $adtran->ad_mgmtevcports(); my $mgmtevcid = $adtran->ad_mgmtevcvid(); @@ -223,17 +221,17 @@ Subclass for adtran Devices running JUNOS =over -=item SNMP::Info::Layer3 +=item SNMP::Info::Layer2 -=item SNMP::Info::LLDP +=item SNMP::Info::Layer3 =back =head2 Inherited Classes' MIBs -See L for its own MIB requirements. +See L for its own MIB requirements. -See L for its own MIB requirements. +See L for its own MIB requirements. =head1 GLOBALS @@ -273,10 +271,6 @@ Returns serial number. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -303,12 +297,12 @@ IDs. These are the VLANs which are members of the egress list for the port. =back +=head2 Table Methods imported from SNMP::Info::Layer2 + +See documentation in L for details. + =head2 Table Methods imported from SNMP::Info::Layer3 See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer2/Aerohive.pm b/lib/SNMP/Info/Layer2/Aerohive.pm index 361949be..38646281 100644 --- a/lib/SNMP/Info/Layer2/Aerohive.pm +++ b/lib/SNMP/Info/Layer2/Aerohive.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer2::Aerohive; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -107,13 +108,12 @@ sub os_ver { my $aerohive = shift; my $descr = $aerohive->description(); - if ( $descr =~ m/\bHiveOS\s(\d\.\w+)\b/ix ) { + if ( defined ($descr) && $descr =~ m/\bHiveOS\s(\d\.\w+)\b/ix ) { return $1; } return; } - sub mac { my $aerohive = shift; my $ahmac = $aerohive->ah_mac(); @@ -137,12 +137,11 @@ sub mac { return $macs[0]; } - sub model { my $aerohive = shift; my $descr = $aerohive->description(); - if ( $descr =~ m/\b(?:Hive|)(AP\d+)\b/ix ) { + if ( defined ($descr) && $descr =~ m/\b(?:Hive|)(AP\d+)\b/ix ) { return $1; } return; @@ -345,11 +344,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from an Aerohive wireless Access Point 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 $aerohive = new SNMP::Info::Layer2::Aerohive(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/Airespace.pm b/lib/SNMP/Info/Layer2/Airespace.pm index a825a31d..5a629235 100644 --- a/lib/SNMP/Info/Layer2/Airespace.pm +++ b/lib/SNMP/Info/Layer2/Airespace.pm @@ -29,8 +29,8 @@ package SNMP::Info::Layer2::Airespace; use strict; +use warnings; use Exporter; -use SNMP::Info::Bridge; use SNMP::Info::CDP; use SNMP::Info::Airespace; @@ -272,11 +272,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from Cisco (Airespace) Wireless Controllers 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 $airespace = new SNMP::Info::Layer2::Airespace(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/Aironet.pm b/lib/SNMP/Info/Layer2/Aironet.pm index 8cfce520..ec4caad5 100644 --- a/lib/SNMP/Info/Layer2/Aironet.pm +++ b/lib/SNMP/Info/Layer2/Aironet.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Aironet -# $Id$ # # Copyright (c) 2008-2009 Max Baker changes from version 0.8 and beyond. # @@ -33,9 +32,9 @@ package SNMP::Info::Layer2::Aironet; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; -use SNMP::Info::Entity; use SNMP::Info::EtherLike; use SNMP::Info::CiscoStats; use SNMP::Info::CiscoConfig; @@ -43,7 +42,7 @@ use SNMP::Info::CDP; use SNMP::Info::IEEE802dot11; @SNMP::Info::Layer2::Aironet::ISA - = qw/SNMP::Info::Layer2 SNMP::Info::Entity SNMP::Info::EtherLike + = qw/SNMP::Info::Layer2 SNMP::Info::EtherLike SNMP::Info::CiscoStats SNMP::Info::CiscoConfig SNMP::Info::CDP Exporter/; @SNMP::Info::Layer2::Aironet::EXPORT_OK = qw//; @@ -54,19 +53,17 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::IEEE802dot11::GLOBALS, %SNMP::Info::Layer2::GLOBALS, - %SNMP::Info::Entity::GLOBALS, %SNMP::Info::EtherLike::GLOBALS, %SNMP::Info::CiscoStats::GLOBALS, %SNMP::Info::CiscoConfig::GLOBALS, %SNMP::Info::CDP::GLOBALS, 'serial' => 'entPhysicalSerialNum.1', - 'ps1_type' => 'cpoePdCurrentPowerSource' + 'ps1_type' => 'cpoePdCurrentPowerSource', ); %FUNCS = ( %SNMP::Info::IEEE802dot11::FUNCS, %SNMP::Info::Layer2::FUNCS, - %SNMP::Info::Entity::FUNCS, %SNMP::Info::EtherLike::FUNCS, %SNMP::Info::CiscoStats::FUNCS, %SNMP::Info::CiscoConfig::FUNCS, @@ -88,7 +85,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::IEEE802dot11::MIBS, %SNMP::Info::Layer2::MIBS, - %SNMP::Info::Entity::MIBS, %SNMP::Info::EtherLike::MIBS, %SNMP::Info::CiscoStats::MIBS, %SNMP::Info::CiscoConfig::MIBS, @@ -103,7 +99,6 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::IEEE802dot11::MUNGE, %SNMP::Info::Layer2::MUNGE, - %SNMP::Info::Entity::MUNGE, %SNMP::Info::EtherLike::MUNGE, %SNMP::Info::CiscoStats::MUNGE, %SNMP::Info::CiscoConfig::MUNGE, @@ -118,7 +113,6 @@ $VERSION = '3.68'; = \&SNMP::Info::IEEE802dot11::dot11_cur_tx_pwr_mw; sub vendor { - # Sorry, but it's true. return 'cisco'; } @@ -138,8 +132,13 @@ sub description { my $descr = $aironet->SUPER::description(); my $e_descr = $aironet->e_descr(); - $descr = "$e_descr->{1} $descr" if defined $e_descr->{1}; - + if (defined $e_descr->{1}) { + if (defined $descr) { + $descr = "$e_descr->{1} $descr" + } else { + $descr = "$e_descr->{1}" + } + } return $descr; } @@ -527,8 +526,6 @@ my $aironet = new SNMP::Info::Layer2::Aironet(...); =item SNMP::Info::Layer2 -=item SNMP::Info::Entity - =item SNMP::Info::EtherLike =item SNMP::Info::CiscoStats @@ -541,6 +538,16 @@ my $aironet = new SNMP::Info::Layer2::Aironet(...); =over +=item F + +=item F + +=item F + +=item F + +=item F + =item Inherited Classes MIBs required by the inherited classes listed above. @@ -567,10 +574,6 @@ System description. Adds info from method e_descr() from SNMP::Info::Entity See documentation in L for details. -=head2 Globals imported from SNMP::Info::Entity - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::EtherLike See documentation in L for details. @@ -668,10 +671,6 @@ C. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::Entity - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::EtherLike See documentation in L for details. diff --git a/lib/SNMP/Info/Layer2/Allied.pm b/lib/SNMP/Info/Layer2/Allied.pm index 28fa95ac..a2aab5d3 100644 --- a/lib/SNMP/Info/Layer2/Allied.pm +++ b/lib/SNMP/Info/Layer2/Allied.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Allied -# $Id$ # # Copyright (c) 2008 Max Baker # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer2::Allied; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; use SNMP::Info::Layer1; @@ -70,7 +70,7 @@ sub os_ver { my $allied = shift; my $descr = $allied->description(); - if ( $descr =~ m/version (\d+\.\d+)/ ) { + if ( defined ($descr) && $descr =~ m/version (\d+\.\d+)/ ) { return $1; } return; @@ -78,10 +78,9 @@ sub os_ver { sub model { my $allied = shift; - my $desc = $allied->description(); - if ( $desc =~ /(AT-80\d{2}\S*)/ ) { + if ( defined ($desc) && $desc =~ /(AT-80\d{2}\S*)/ ) { return $1; } return; @@ -191,7 +190,7 @@ These are methods that return scalar value from SNMP =item $allied->vendor() -Returns 'allied' :) +Returns 'allied' =item $allied->os() diff --git a/lib/SNMP/Info/Layer2/Atmedia.pm b/lib/SNMP/Info/Layer2/Atmedia.pm index e437902e..b50543fe 100644 --- a/lib/SNMP/Info/Layer2/Atmedia.pm +++ b/lib/SNMP/Info/Layer2/Atmedia.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer2::Atmedia; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -68,10 +69,12 @@ sub model { my $atmedia = shift; my $atmedia_model = $atmedia->atm_model(); - $atmedia_model =~ s/\<|\>//g; - $atmedia_model =~ s/\//_/g; - - return $atmedia_model; + if (defined $atmedia_model) { + $atmedia_model =~ s/\<|\>//g; + $atmedia_model =~ s/\//_/g; + return $atmedia_model; + } + return; } sub vendor { diff --git a/lib/SNMP/Info/Layer2/Baystack.pm b/lib/SNMP/Info/Layer2/Baystack.pm index 81982e0a..352dcfa8 100644 --- a/lib/SNMP/Info/Layer2/Baystack.pm +++ b/lib/SNMP/Info/Layer2/Baystack.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Baystack -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # All rights reserved. @@ -31,16 +30,16 @@ package SNMP::Info::Layer2::Baystack; use strict; +use warnings; use Exporter; use SNMP::Info::SONMP; use SNMP::Info::NortelStack; use SNMP::Info::RapidCity; -use SNMP::Info::LLDP; use SNMP::Info::Layer3; @SNMP::Info::Layer2::Baystack::ISA = qw/SNMP::Info::SONMP SNMP::Info::NortelStack - SNMP::Info::RapidCity SNMP::Info::LLDP + SNMP::Info::RapidCity SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer2::Baystack::EXPORT_OK = qw//; @@ -49,20 +48,20 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::Layer3::MIBS, %SNMP::Info::LLDP::MIBS, + %SNMP::Info::Layer3::MIBS, %SNMP::Info::RapidCity::MIBS, %SNMP::Info::NortelStack::MIBS, %SNMP::Info::SONMP::MIBS, 'BAY-STACK-PETH-EXT-MIB' => 'bspePethPsePortExtMeasuredPower', ); %GLOBALS = ( - %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::LLDP::GLOBALS, + %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::RapidCity::GLOBALS, %SNMP::Info::NortelStack::GLOBALS, %SNMP::Info::SONMP::GLOBALS, ); %FUNCS = ( - %SNMP::Info::Layer3::FUNCS, %SNMP::Info::LLDP::FUNCS, + %SNMP::Info::Layer3::FUNCS, %SNMP::Info::RapidCity::FUNCS, %SNMP::Info::NortelStack::FUNCS, %SNMP::Info::SONMP::FUNCS, 'peth_port_power' => 'bspePethPsePortExtMeasuredPower', @@ -74,7 +73,7 @@ $SNMP::Info::SPEED_MAP{200_000_000} = '100 Mbps'; $SNMP::Info::SPEED_MAP{2_000_000_000} = '1.0 Gbps'; %MUNGE = ( - %SNMP::Info::Layer3::MUNGE, %SNMP::Info::LLDP::MUNGE, + %SNMP::Info::Layer3::MUNGE, %SNMP::Info::RapidCity::MUNGE, %SNMP::Info::NortelStack::MUNGE, %SNMP::Info::SONMP::MUNGE, ); @@ -429,11 +428,6 @@ Provides abstraction to the configuration information obtainable from an Avaya Ethernet Switch (formerly Nortel/Bay Baystack) and VSP 7000 series 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 $baystack = new SNMP::Info::Layer2::Baystack(...); - =head2 Inherited Classes =over @@ -444,8 +438,6 @@ my $baystack = new SNMP::Info::Layer2::Baystack(...); =item SNMP::Info::RapidCity -=item SNMP::Info::LLDP - =item SNMP::Info::Layer3 =back @@ -454,7 +446,7 @@ my $baystack = new SNMP::Info::Layer2::Baystack(...); =over -=item F +=item F =back @@ -466,8 +458,6 @@ See L for its MIB requirements. See L for its MIB requirements. -See L for its MIB requirements. - See L for its MIB requirements. =head1 GLOBALS @@ -537,10 +527,6 @@ See L for details. See L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::Layer3 See L for details. @@ -700,10 +686,6 @@ See L for details. See L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::Layer3 See L for details. diff --git a/lib/SNMP/Info/Layer2/C1900.pm b/lib/SNMP/Info/Layer2/C1900.pm index 69116ee3..2ee726f0 100644 --- a/lib/SNMP/Info/Layer2/C1900.pm +++ b/lib/SNMP/Info/Layer2/C1900.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::C1900 -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer2::C1900; use strict; +use warnings; use Exporter; use SNMP::Info::CDP; use SNMP::Info::CiscoStats; @@ -311,11 +311,6 @@ Catalyst 1900 device through SNMP. See SNMP::Info for full documentation Note that most of these devices only talk SNMP version 1, but not all. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $c1900 = new SNMP::Info::Layer2::C1900(...); - =head2 Inherited classes =over @@ -342,8 +337,6 @@ after determining a more specific class using the method above. F is included in the Version 1 MIBs from Cisco. -They can be found at ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz - =back =head2 Inherited MIBs @@ -386,7 +379,7 @@ the version from there. =item $c1900->vendor() -Returns 'cisco' :) +Returns 'cisco' =back @@ -420,10 +413,6 @@ See L for details. See L for details. -=head2 Globals imported from SNMP::Info::CiscoAgg - -See L for details. - =head2 Globals imported from SNMP::Info::Layer2 See L for details. diff --git a/lib/SNMP/Info/Layer2/C2900.pm b/lib/SNMP/Info/Layer2/C2900.pm index 25a3eb59..8e541664 100644 --- a/lib/SNMP/Info/Layer2/C2900.pm +++ b/lib/SNMP/Info/Layer2/C2900.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::C2900 -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer2::C2900; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2::Cisco; @@ -244,11 +244,6 @@ Max Baker Provides abstraction to the configuration information obtainable from a C2900 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 $c2900 = new SNMP::Info::Layer2::C2900(...); - =head2 Inherited Classes =over @@ -281,7 +276,7 @@ These are methods that return scalar value from SNMP =item $c2900->vendor() -Returns 'cisco' :) +Returns 'cisco' =item $c2900->cisco_comm_indexing() diff --git a/lib/SNMP/Info/Layer2/Catalyst.pm b/lib/SNMP/Info/Layer2/Catalyst.pm index f3dad862..aef25fe5 100644 --- a/lib/SNMP/Info/Layer2/Catalyst.pm +++ b/lib/SNMP/Info/Layer2/Catalyst.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Catalyst -# $Id$ # # Copyright (c) 2002,2003 Regents of the University of California # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond @@ -32,6 +31,7 @@ package SNMP::Info::Layer2::Catalyst; use strict; +use warnings; use Exporter; use SNMP::Info::CiscoStack; use SNMP::Info::Layer2::Cisco; @@ -64,7 +64,7 @@ $VERSION = '3.68'; %SNMP::Info::CiscoStack::MUNGE, ); -# Overidden Methods +# Overridden Methods # i_physical sets a hash entry as true if the iid is a physical port sub i_physical { diff --git a/lib/SNMP/Info/Layer2/Centillion.pm b/lib/SNMP/Info/Layer2/Centillion.pm index d4fb222d..6e0ba1c8 100644 --- a/lib/SNMP/Info/Layer2/Centillion.pm +++ b/lib/SNMP/Info/Layer2/Centillion.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Centillion -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,9 +30,9 @@ package SNMP::Info::Layer2::Centillion; use strict; +use warnings; use Exporter; use SNMP::Info; -use SNMP::Info::Bridge; use SNMP::Info::NortelStack; use SNMP::Info::SONMP; @@ -292,11 +291,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from a Centillion 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 $centillion = new SNMP::Info::Layer2::centillion(...); - Note: This class supports version 4.X and 5.X which are VLAN based rather than bridge group based. @@ -328,7 +322,7 @@ than bridge group based. =item Inherited Classes' MIBs -See L for its own MIB requirements. +See L for its own MIB requirements. See L for its own MIB requirements. @@ -346,7 +340,7 @@ These are methods that return scalar value from SNMP =item $centillion->vendor() -Returns 'Nortel' +Returns 'nortel' =item $centillion->model() @@ -357,7 +351,7 @@ Removes C from the model name =item $centillion->os() -Returns 'Centillion' +Returns 'centillion' =item $centillion->tftp_action() @@ -399,7 +393,7 @@ start at 0. Returns 0. =head2 Globals imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head2 Globals imported from SNMP::Info::Bridge @@ -513,7 +507,7 @@ Returns reference to hash. Key: Table entry, Value: VLAN Type =head2 Table Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head2 Table Methods imported from SNMP::Info::Bridge diff --git a/lib/SNMP/Info/Layer2/Cisco.pm b/lib/SNMP/Info/Layer2/Cisco.pm index cb389979..6b9ad0b1 100644 --- a/lib/SNMP/Info/Layer2/Cisco.pm +++ b/lib/SNMP/Info/Layer2/Cisco.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Cisco -# $Id$ # # Copyright (c) 2008 Max Baker # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer2::Cisco; use strict; +use warnings; use Exporter; use SNMP::Info::CiscoVTP; use SNMP::Info::CDP; @@ -194,7 +194,7 @@ These are methods that return scalar value from SNMP =item $cisco->vendor() - Returns 'cisco' +Returns 'cisco' =back @@ -226,10 +226,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Globals imported from SNMP::Info::CiscoAgg - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::Layer2 See documentation in L for details. diff --git a/lib/SNMP/Info/Layer2/CiscoSB.pm b/lib/SNMP/Info/Layer2/CiscoSB.pm index d48523e7..2dcc4f81 100644 --- a/lib/SNMP/Info/Layer2/CiscoSB.pm +++ b/lib/SNMP/Info/Layer2/CiscoSB.pm @@ -37,14 +37,13 @@ use strict; use warnings; use Exporter; use SNMP::Info::Layer2; -use SNMP::Info::Entity; use SNMP::Info::EtherLike; use SNMP::Info::CiscoStats; use SNMP::Info::CiscoConfig; use SNMP::Info::CDP; @SNMP::Info::Layer2::CiscoSB::ISA - = qw/SNMP::Info::Layer2 SNMP::Info::Entity SNMP::Info::EtherLike + = qw/SNMP::Info::Layer2 SNMP::Info::EtherLike SNMP::Info::CiscoStats SNMP::Info::CiscoConfig SNMP::Info::CDP Exporter/; @SNMP::Info::Layer2::CiscoSB::EXPORT_OK = qw//; @@ -54,17 +53,15 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - %SNMP::Info::Entity::GLOBALS, %SNMP::Info::EtherLike::GLOBALS, %SNMP::Info::CiscoStats::GLOBALS, %SNMP::Info::CiscoConfig::GLOBALS, %SNMP::Info::CDP::GLOBALS, - 'descr' => 'sysDescr' + 'descr' => 'sysDescr', ); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, - %SNMP::Info::Entity::FUNCS, %SNMP::Info::EtherLike::FUNCS, %SNMP::Info::CiscoStats::FUNCS, %SNMP::Info::CiscoConfig::FUNCS, @@ -73,7 +70,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer2::MIBS, - %SNMP::Info::Entity::MIBS, %SNMP::Info::EtherLike::MIBS, %SNMP::Info::CiscoStats::MIBS, %SNMP::Info::CiscoConfig::MIBS, @@ -82,14 +78,12 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer2::MUNGE, - %SNMP::Info::Entity::MUNGE, %SNMP::Info::EtherLike::MUNGE, %SNMP::Info::CiscoStats::MUNGE, %SNMP::Info::CiscoConfig::MUNGE, %SNMP::Info::CDP::MUNGE, ); - sub vendor { return 'cisco'; } @@ -210,8 +204,6 @@ managed switches. [i.e. those matching enterprises(1).cisco(9).otherEnterprises( =item SNMP::Info::CiscoStats -=item SNMP::Info::Entity - =item SNMP::Info::EtherLike =item SNMP::Info::Layer2 @@ -267,10 +259,6 @@ Returns 'ros'. See documentation in L for details. -=head2 Globals imported from SNMP::Info::Entity - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::EtherLike See documentation in L for details. @@ -299,10 +287,6 @@ Uses the i_name() field. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::Entity - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::EtherLike See documentation in L for details. diff --git a/lib/SNMP/Info/Layer2/HP.pm b/lib/SNMP/Info/Layer2/HP.pm index ebd5f5ea..72bee0ab 100644 --- a/lib/SNMP/Info/Layer2/HP.pm +++ b/lib/SNMP/Info/Layer2/HP.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::HP - SNMP Interface to HP ProCurve Switches -# $Id$ # # Copyright (c) 2008-2009 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer2::HP; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::MAU; diff --git a/lib/SNMP/Info/Layer2/HP4000.pm b/lib/SNMP/Info/Layer2/HP4000.pm index 21640bfb..07cae972 100644 --- a/lib/SNMP/Info/Layer2/HP4000.pm +++ b/lib/SNMP/Info/Layer2/HP4000.pm @@ -32,6 +32,7 @@ package SNMP::Info::Layer2::HP4000; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::MAU; @@ -49,7 +50,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::MAU::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::CDP::MIBS, 'RFC1271-MIB' => 'logDescription', 'HP-ICF-OID' => 'hpSwitch4000', @@ -427,7 +427,7 @@ sub set_i_vlan { $hp->error_throw("Error removing previous untagged vlan from port, should never happen...\n") unless defined $rv; } } else { - # If vlan change was not succesful, try to revert to the old situation. + # If vlan change was not successful, try to revert to the old situation. if (defined $old_untagged) { $rv = $hp->set_hp_v_if_tag(2, $old_untagged) if defined $old_untagged; if (defined $rv) { @@ -504,11 +504,6 @@ Note: Some HP Switches will connect via SNMP version 1, but a lot of config data will not be available. Make sure you try and connect with Version 2 first, and then fail back to version 1. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $hp = new SNMP::Info::Layer2::HP4000(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/HPVC.pm b/lib/SNMP/Info/Layer2/HPVC.pm index e4369df5..f22a8087 100644 --- a/lib/SNMP/Info/Layer2/HPVC.pm +++ b/lib/SNMP/Info/Layer2/HPVC.pm @@ -31,12 +31,12 @@ package SNMP::Info::Layer2::HPVC; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; -use SNMP::Info::LLDP; @SNMP::Info::Layer2::HPVC::ISA - = qw/SNMP::Info::Layer2 SNMP::Info::LLDP Exporter/; + = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::HPVC::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -45,7 +45,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer2::MIBS, - %SNMP::Info::LLDP::MIBS, 'HPVC-MIB' => 'vcDomainName', 'CPQSINFO-MIB' => 'cpqSiSysSerialNum', 'HPVCMODULE-MIB' => 'vcModuleDomainName', @@ -53,7 +52,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer2::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'serial1' => 'cpqSiSysSerialNum.0', 'os_ver' => 'cpqHoSWRunningVersion.1', 'os_bin' => 'cpqHoFwVerVersion.1', @@ -62,17 +60,13 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer2::FUNCS, - %SNMP::Info::LLDP::FUNCS, - ); %MUNGE = ( # Inherit all the built in munging %SNMP::Info::Layer2::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); - # Method Overrides sub os { @@ -120,11 +114,6 @@ Jeroen van Ingen Provides abstraction to the configuration information obtainable from a HP Virtual Connect Switch via 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 $hp = new SNMP::Info::Layer2::HPVC(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/Kentrox.pm b/lib/SNMP/Info/Layer2/Kentrox.pm index 1334f559..1d0756bc 100644 --- a/lib/SNMP/Info/Layer2/Kentrox.pm +++ b/lib/SNMP/Info/Layer2/Kentrox.pm @@ -28,6 +28,7 @@ package SNMP::Info::Layer2::Kentrox; # POSSIBILITY OF SUCH DAMAGE. use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -57,13 +58,13 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer2::MUNGE, ); sub os { - return 'Kentrox'; + return 'kentrox'; } sub os_ver { my $dsver = shift; my $descr = $dsver->description(); - if ( $descr =~ /^\S+\s\S+\s\S+\s(\S+)/){ + if ( defined ($descr) && $descr =~ /^\S+\s\S+\s\S+\s(\S+)/){ return $1; } return; @@ -72,20 +73,20 @@ sub os_ver { sub serial { my $dsserial = shift; my $serial = $dsserial->ds_sysinfo(); - if ( $serial =~ /SERIAL\s(\S+)/){ + if ( defined ($serial) && $serial =~ /SERIAL\s(\S+)/){ my $str = substr($1,8,10); return $str; } return; } sub vendor { - return 'Kentrox'; + return 'kentrox'; } sub model { my $dsmodel = shift; my $descr = $dsmodel->description(); - if ( $descr =~ /^(\S+\s\S+)/){ + if ( defined ($descr) && $descr =~ /^(\S+\s\S+)/){ return $1; } return; @@ -110,7 +111,7 @@ phishphreek@gmail.com Debug => 1, DestHost => 'myrouter', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; diff --git a/lib/SNMP/Info/Layer2/N2270.pm b/lib/SNMP/Info/Layer2/N2270.pm index b740c99d..536b22b3 100644 --- a/lib/SNMP/Info/Layer2/N2270.pm +++ b/lib/SNMP/Info/Layer2/N2270.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::N2270 -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,14 +30,14 @@ package SNMP::Info::Layer2::N2270; use strict; +use warnings; use Exporter; -use SNMP::Info; -use SNMP::Info::Bridge; +use SNMP::Info::Layer2; 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/; + = qw/SNMP::Info::Layer2 SNMP::Info::SONMP SNMP::Info::Airespace Exporter/; @SNMP::Info::Layer2::N2270::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD, $INIT, $DEBUG); @@ -46,23 +45,27 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE, $AUTOLOAD, $INIT, $DEBUG); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS, - %SNMP::Info::SONMP::MIBS, %SNMP::Info::Airespace::MIBS, + %SNMP::Info::Layer2::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, + %SNMP::Info::Layer2::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, + %SNMP::Info::Layer2::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, + %SNMP::Info::Layer2::MUNGE, + %SNMP::Info::SONMP::MUNGE, + %SNMP::Info::Airespace::MUNGE, ); sub os { @@ -126,18 +129,11 @@ Eric Miller 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::Layer2 =item SNMP::Info::SONMP @@ -151,9 +147,7 @@ my $n2270 = new SNMP::Info::Layer2::N2270(...); =item Inherited Classes' MIBs -See L for its own MIB requirements. - -See L for its own MIB requirements. +See L for its own MIB requirements. See L for its own MIB requirements. @@ -200,13 +194,9 @@ start at 0. Returns 0. =back -=head2 Globals imported from SNMP::Info +=head2 Globals imported from SNMP::Info::Layer2 -See documentation in L for details. - -=head2 Globals imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head2 Global Methods imported from SNMP::Info::SONMP @@ -229,13 +219,9 @@ to a hash. =back -=head2 Table Methods imported from SNMP::Info +=head2 Table Methods imported from SNMP::Info::Layer2 -See documentation in L for details. - -=head2 Table Methods imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head2 Table Methods imported from SNMP::Info::SONMP diff --git a/lib/SNMP/Info/Layer2/NAP222x.pm b/lib/SNMP/Info/Layer2/NAP222x.pm index c3d82834..75d0cc50 100644 --- a/lib/SNMP/Info/Layer2/NAP222x.pm +++ b/lib/SNMP/Info/Layer2/NAP222x.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::NAP222x -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer2::NAP222x; use strict; +use warnings; use Exporter; use SNMP::Info::SONMP; use SNMP::Info::IEEE802dot11; @@ -393,11 +393,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from a Nortel 2220 series wireless Access Points 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 $nap222x = new SNMP::Info::Layer2::NAP222x(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/NWSS2300.pm b/lib/SNMP/Info/Layer2/NWSS2300.pm index f24d08d3..27d7371f 100644 --- a/lib/SNMP/Info/Layer2/NWSS2300.pm +++ b/lib/SNMP/Info/Layer2/NWSS2300.pm @@ -29,12 +29,12 @@ package SNMP::Info::Layer2::NWSS2300; use strict; +use warnings; use Exporter; -use SNMP::Info; -use SNMP::Info::Bridge; +use SNMP::Info::Layer2; @SNMP::Info::Layer2::NWSS2300::ISA - = qw/SNMP::Info SNMP::Info::Bridge Exporter/; + = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::NWSS2300::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); @@ -42,8 +42,7 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::MIBS, - %SNMP::Info::Bridge::MIBS, + %SNMP::Info::Layer2::MIBS, 'NTWS-REGISTRATION-DEVICES-MIB' => 'ntwsSwitch2380', 'NTWS-AP-STATUS-MIB' => 'ntwsApStatNumAps', 'NTWS-CLIENT-SESSION-MIB' => 'ntwsClSessTotalSessions', @@ -53,16 +52,14 @@ $VERSION = '3.68'; ); %GLOBALS = ( - %SNMP::Info::GLOBALS, - %SNMP::Info::Bridge::GLOBALS, + %SNMP::Info::Layer2::GLOBALS, 'os_ver' => 'ntwsVersionString', 'serial' => 'ntwsSerialNumber', 'mac' => 'dot1dBaseBridgeAddress', ); %FUNCS = ( - %SNMP::Info::FUNCS, - %SNMP::Info::Bridge::FUNCS, + %SNMP::Info::Layer2::FUNCS, # NTWS-AP-STATUS-MIB::ntwsApStatApStatusTable 'nwss2300_ap_mac' => 'ntwsApStatApStatusBaseMac', @@ -125,8 +122,7 @@ $VERSION = '3.68'; ); %MUNGE = ( - %SNMP::Info::MUNGE, - %SNMP::Info::Bridge::MUNGE, + %SNMP::Info::Layer2::MUNGE, 'nwss2300_apif_mac' => \&SNMP::Info::munge_mac, 'nwss2300_apif_bssid' => \&SNMP::Info::munge_mac, ); @@ -813,18 +809,11 @@ 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 $nwss2300 = new SNMP::Info::Layer2::NWSS2300(...); - =head2 Inherited Classes =over -=item SNMP::Info - -=item SNMP::Info::Bridge +=item SNMP::Info::Layer2 =back @@ -846,9 +835,7 @@ my $nwss2300 = new SNMP::Info::Layer2::NWSS2300(...); =head2 Inherited Classes' MIBs -See L for its own MIB requirements. - -See L for its own MIB requirements. +See L for its own MIB requirements. =head1 GLOBALS @@ -895,13 +882,9 @@ proprietary MIBs. =back -=head2 Global Methods imported from SNMP::Info +=head2 Global Methods imported from SNMP::Info::Layer2 -See documentation in L for details. - -=head2 Globals imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head1 TABLE METHODS @@ -1141,13 +1124,9 @@ These emulate the F =back -=head2 Table Methods imported from SNMP::Info +=head2 Table Methods imported from SNMP::Info::Layer2 -See documentation in L for details. - -=head2 Table Methods imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head2 Overrides diff --git a/lib/SNMP/Info/Layer2/Netgear.pm b/lib/SNMP/Info/Layer2/Netgear.pm index 82fb6562..4577ea15 100644 --- a/lib/SNMP/Info/Layer2/Netgear.pm +++ b/lib/SNMP/Info/Layer2/Netgear.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Netgear -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer2::Netgear; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; -use SNMP::Info::LLDP; -@SNMP::Info::Layer2::Netgear::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer2 Exporter/; +@SNMP::Info::Layer2::Netgear::ISA = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::Netgear::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -46,18 +45,18 @@ $VERSION = '3.68'; # table by the serial() function. our $index = undef; -%MIBS = ( %SNMP::Info::Layer2::MIBS, %SNMP::Info::LLDP::MIBS, ); +%MIBS = ( %SNMP::Info::Layer2::MIBS, ); %GLOBALS = ( - %SNMP::Info::Layer2::GLOBALS, %SNMP::Info::LLDP::GLOBALS, + %SNMP::Info::Layer2::GLOBALS, ng_fsosver => '.1.3.6.1.4.1.4526.11.11.1.0', ng_gsmserial => '.1.3.6.1.4.1.4526.10.1.1.1.4.0', ng_gsmosver => '.1.3.6.1.4.1.4526.10.1.1.1.13.0', ); -%FUNCS = ( %SNMP::Info::Layer2::FUNCS, %SNMP::Info::LLDP::FUNCS, ); +%FUNCS = ( %SNMP::Info::Layer2::FUNCS, ); -%MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::LLDP::MUNGE, ); +%MUNGE = ( %SNMP::Info::Layer2::MUNGE, ); sub vendor { return 'netgear'; @@ -87,7 +86,7 @@ sub serial { return $e_serial->{$index} if defined $index; } - # Without Enitity-MIB, we've got to work our way through a bunch of + # Without Entity-MIB, we've got to work our way through a bunch of # different locales... return $netgear->ng_gsmserial() if defined $netgear->model and $netgear->model =~ m/[FG]SM\d/i;; return 'none'; @@ -109,7 +108,7 @@ sub model { # ifDescr is the same for all interfaces in a class, but the ifName is # unique, so let's use that for port name. If all else fails, -# concatentate ifDesc and ifIndex. +# concatenate ifDesc and ifIndex. sub interfaces { my $netgear = shift; my $partial = shift; @@ -192,8 +191,6 @@ inherited methods. =over =item SNMP::Info::Layer2 -=item SNMP::Info::Entity -=item SNMP::Info::LLDP =back @@ -206,10 +203,6 @@ inherited methods. MIBs listed in L and its inherited classes. -See L for its MIB requirements. - -See L for its MIB requirements. - =back =head1 GLOBALS @@ -248,14 +241,6 @@ serial number). See documentation in L for details. -=head2 Globals imported from SNMP::Info::Entity - -See documentation in L for details. - -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of @@ -275,12 +260,4 @@ Uses the i_name() field. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::Entity - -See documentation in L for details. - -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer2/Nexans.pm b/lib/SNMP/Info/Layer2/Nexans.pm index 0d3fecba..4bc667f9 100644 --- a/lib/SNMP/Info/Layer2/Nexans.pm +++ b/lib/SNMP/Info/Layer2/Nexans.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer2::Nexans; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -157,11 +158,6 @@ tested devices: gigaSwitch641DeskSfpTp version 3.68, 4.14W gigaSwitchV3d2SfpSfp version 3.68, 4.02, 4.02B, 4.10C, 4,14W -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $nexans = new SNMP::Info::Layer2::Nexans(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/Orinoco.pm b/lib/SNMP/Info/Layer2/Orinoco.pm index 1bbdbe76..6c258da3 100644 --- a/lib/SNMP/Info/Layer2/Orinoco.pm +++ b/lib/SNMP/Info/Layer2/Orinoco.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::Orinoco -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer2::Orinoco; use strict; +use warnings; use Exporter; use SNMP::Info::IEEE802dot11; use SNMP::Info::Layer2; @@ -189,11 +189,6 @@ Provides abstraction to the configuration information obtainable from Orinoco Access Point through SNMP. Orinoco devices have been manufactured by Proxim, Agere, and Lucent. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $orinoco = new SNMP::Info::Layer2::Orinoco(...); - =head2 Inherited Classes =over @@ -234,7 +229,7 @@ Returns the model extracted from C. =item $orinoco->os() -Returns 'Orinoco' +Returns 'orinoco' =item $orinoco->os_ver() diff --git a/lib/SNMP/Info/Layer2/Sixnet.pm b/lib/SNMP/Info/Layer2/Sixnet.pm index 02b8243e..2ba5dbb6 100644 --- a/lib/SNMP/Info/Layer2/Sixnet.pm +++ b/lib/SNMP/Info/Layer2/Sixnet.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer2::Sixnet; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -108,11 +109,6 @@ Eric Miller SNMP::Info::Layer2::Sixnet is a subclass of SNMP::Info that provides an interface to Sixnet industrial 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 $sixnet = new SNMP::Info::Layer2::Sixnet(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer2/Trapeze.pm b/lib/SNMP/Info/Layer2/Trapeze.pm index 1d9857e7..ac59d039 100644 --- a/lib/SNMP/Info/Layer2/Trapeze.pm +++ b/lib/SNMP/Info/Layer2/Trapeze.pm @@ -29,13 +29,12 @@ package SNMP::Info::Layer2::Trapeze; use strict; +use warnings; use Exporter; -use SNMP::Info; -use SNMP::Info::Bridge; -use SNMP::Info::LLDP; +use SNMP::Info::Layer2; @SNMP::Info::Layer2::Trapeze::ISA - = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::LLDP Exporter/; + = qw/SNMP::Info::Layer2 Exporter/; @SNMP::Info::Layer2::Trapeze::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); @@ -43,9 +42,7 @@ our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::MIBS, - %SNMP::Info::Bridge::MIBS, - %SNMP::Info::LLDP::MIBS, + %SNMP::Info::Layer2::MIBS, 'TRAPEZE-NETWORKS-REGISTRATION-DEVICES-MIB' => 'wirelessLANController', 'TRAPEZE-NETWORKS-AP-STATUS-MIB' => 'trpzApStatNumAps', 'TRAPEZE-NETWORKS-CLIENT-SESSION-MIB' => 'trpzClSessTotalSessions', @@ -55,18 +52,14 @@ $VERSION = '3.68'; ); %GLOBALS = ( - %SNMP::Info::GLOBALS, - %SNMP::Info::Bridge::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, + %SNMP::Info::Layer2::GLOBALS, 'os_ver' => 'trpzVersionString', 'serial' => 'trpzSerialNumber', 'mac' => 'dot1dBaseBridgeAddress', ); %FUNCS = ( - %SNMP::Info::FUNCS, - %SNMP::Info::Bridge::FUNCS, - %SNMP::Info::LLDP::FUNCS, + %SNMP::Info::Layer2::FUNCS, # TRAPEZE-NETWORKS-AP-STATUS-MIB::trpzApStatApStatusTable 'trapeze_ap_mac' => 'trpzApStatApStatusBaseMac', 'trapeze_ap_name' => 'trpzApStatApStatusApName', @@ -128,9 +121,7 @@ $VERSION = '3.68'; ); %MUNGE = ( - %SNMP::Info::MUNGE, - %SNMP::Info::Bridge::MUNGE, - %SNMP::Info::LLDP::MUNGE, + %SNMP::Info::Layer2::MUNGE, 'trapeze_apif_mac' => \&SNMP::Info::munge_mac, 'trapeze_apif_bssid' => \&SNMP::Info::munge_mac, ); @@ -817,18 +808,11 @@ 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 $trapeze = new SNMP::Info::Layer2::Trapeze(...); - =head2 Inherited Classes =over -=item SNMP::Info - -=item SNMP::Info::Bridge +=item SNMP::Info::Layer2 =back @@ -850,9 +834,7 @@ my $trapeze = new SNMP::Info::Layer2::Trapeze(...); =head2 Inherited Classes' MIBs -See L for its own MIB requirements. - -See L for its own MIB requirements. +See L for its own MIB requirements. =head1 GLOBALS @@ -899,13 +881,9 @@ proprietary MIBs. =back -=head2 Global Methods imported from SNMP::Info +=head2 Global Methods imported from SNMP::Info::Layer2 -See documentation in L for details. - -=head2 Globals imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head1 TABLE METHODS @@ -1147,11 +1125,7 @@ These emulate the F =head2 Table Methods imported from SNMP::Info -See documentation in L for details. - -=head2 Table Methods imported from SNMP::Info::Bridge - -See documentation in L for details. +See documentation in L for details. =head2 Overrides diff --git a/lib/SNMP/Info/Layer2/Ubiquiti.pm b/lib/SNMP/Info/Layer2/Ubiquiti.pm index 4acd6ef5..4b244f96 100644 --- a/lib/SNMP/Info/Layer2/Ubiquiti.pm +++ b/lib/SNMP/Info/Layer2/Ubiquiti.pm @@ -29,6 +29,7 @@ package SNMP::Info::Layer2::Ubiquiti; use strict; +use warnings; use Exporter; use SNMP::Info::IEEE802dot11; use SNMP::Info::Layer2; @@ -47,16 +48,16 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer2::MIBS, %SNMP::Info::IEEE802dot11::MIBS, - ); -%GLOBALS - = ( %SNMP::Info::Layer2::GLOBALS, %SNMP::Info::IEEE802dot11::GLOBALS, ); +%GLOBALS = ( + %SNMP::Info::Layer2::GLOBALS, + %SNMP::Info::IEEE802dot11::GLOBALS, +); %FUNCS = ( %SNMP::Info::Layer2::FUNCS, %SNMP::Info::IEEE802dot11::FUNCS, - ); %MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::IEEE802dot11::MUNGE, ); @@ -136,7 +137,7 @@ sub os_ver { } sub vendor { - return 'Ubiquiti Networks, Inc.'; + return 'ubiquiti'; } sub model { @@ -323,11 +324,6 @@ Max Kosmach Provides abstraction to the configuration information obtainable from Ubiquiti Access Point 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 $ubnt = new SNMP::Info::Layer2::Ubiquiti(...); - =head2 Inherited Classes =over @@ -356,11 +352,11 @@ These are methods that return scalar value from SNMP =item $ubnt->vendor() -Returns 'Ubiquiti Networks, Inc.' +Returns 'ubiquiti' =item $ubnt->model() -Returns the model extracted from C, with failback to some complex logic for EdgeMax devices +Returns the model extracted from C, with fallback to some complex logic for EdgeMax devices =item $ubnt->serial() diff --git a/lib/SNMP/Info/Layer2/ZyXEL_DSLAM.pm b/lib/SNMP/Info/Layer2/ZyXEL_DSLAM.pm index 2f304288..c96be8d8 100644 --- a/lib/SNMP/Info/Layer2/ZyXEL_DSLAM.pm +++ b/lib/SNMP/Info/Layer2/ZyXEL_DSLAM.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer2::ZyXEL_DSLAM -# $Id$ # # Copyright (c) 2008 Max Baker # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer2::ZyXEL_DSLAM; use strict; +use warnings; use Exporter; use SNMP::Info::Layer2; @@ -77,7 +77,7 @@ sub os_ver { my $zyxel = shift; my $descr = $zyxel->description(); - if ( $descr =~ m/version (\S+) / ) { + if ( defined ($descr) && $descr =~ m/version (\S+) / ) { return $1; } return; @@ -88,11 +88,13 @@ sub model { my $desc = $zyxel->description(); - if ( $desc =~ /8-port ADSL Module\(Annex A\)/ ) { + if (defined $desc) { + if ($desc =~ /8-port ADSL Module\(Annex A\)/) { return "AAM1008-61"; - } - elsif ( $desc =~ /8-port ADSL Module\(Annex B\)/ ) { + } + elsif ($desc =~ /8-port ADSL Module\(Annex B\)/) { return "AAM1008-63"; + } } return; } @@ -130,11 +132,11 @@ Dmitry Sergienko (C) Debug => 1, DestHost => 'myhub', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; - my $class = $l2->class(); + my $class = $zyxel->class(); print "SNMP::Info determined this device to fall under subclass : $class\n"; =head1 DESCRIPTION @@ -174,11 +176,11 @@ These are methods that return scalar value from SNMP =item $zyxel->vendor() -Returns 'ZyXEL' :) +Returns 'zyxel' =item $zyxel->os() -Returns 'ZyXEL' +Returns 'zyxel' =item $zyxel->os_ver() diff --git a/lib/SNMP/Info/Layer3.pm b/lib/SNMP/Info/Layer3.pm index b94f5619..ee2180b8 100644 --- a/lib/SNMP/Info/Layer3.pm +++ b/lib/SNMP/Info/Layer3.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3 - SNMP Interface to Layer3 devices -# $Id$ # # Copyright (c) 2008 Max Baker -- All changes from Version 0.7 on # @@ -33,6 +32,7 @@ package SNMP::Info::Layer3; use strict; +use warnings; use Exporter; use SNMP::Info; use SNMP::Info::Bridge; @@ -463,6 +463,10 @@ after determining a more specific class using the method above. =item SNMP::Info::LLDP +=item SNMP::Info::DocsisHE + +=item SNMP::Info::AdslLine + =back =head2 Required MIBs @@ -481,7 +485,7 @@ after determining a more specific class using the method above. =head2 Inherited MIBs -See L for its MIB requirements. +See L for its MIB requirements. See L for its MIB requirements. @@ -495,6 +499,10 @@ See L for its MIB requirements. See L for its MIB requirements. +See L for its MIB requirements. + +See L for its MIB requirements. + =head1 GLOBALS These are methods that return scalar value from SNMP @@ -553,7 +561,7 @@ found: OSPF Router ID (C) or any OSPF Host IP Address =head2 Globals imported from SNMP::Info -See L for details. +See L for details. =head2 Global Methods imported from SNMP::Info::Bridge @@ -579,6 +587,14 @@ See L for details. See L for details. +=head2 Global Methods imported from SNMP::Info::DocsisHE + +See L for details. + +=head2 Global Methods imported from SNMP::Info::AdslLine + +See L for details. + =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -895,14 +911,14 @@ Note this returns hash-strings, for IPs, use $l3->isis_peers() =item $l3->isis_peers() Returns reference to hash of addresses (IPv4, IPv6) on adjacencies. -Convers hash strings from isis_adj to proper +Convert hash strings from isis_adj to proper IP (v4 and v6) formatting. =back =head2 Table Methods imported from SNMP::Info -See L for details. +See L for details. =head2 Table Methods imported from SNMP::Info::Bridge @@ -928,4 +944,12 @@ See L for details. See L for details. +=head2 Table Methods imported from SNMP::Info::DocsisHE + +See L for details. + +=head2 Table Methods imported from SNMP::Info::AdslLine + +See L for details. + =cut diff --git a/lib/SNMP/Info/Layer3/Aironet.pm b/lib/SNMP/Info/Layer3/Aironet.pm index 8d9953f2..74e28f72 100644 --- a/lib/SNMP/Info/Layer3/Aironet.pm +++ b/lib/SNMP/Info/Layer3/Aironet.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Aironet -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::Layer3::Aironet; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -279,9 +279,6 @@ after determining a more specific class using the method above. =back -These MIBs are now included in the v2.tar.gz archive available from -ftp.cisco.com. Make sure you have a current version. - =head1 GLOBALS These are methods that return scalar value from SNMP diff --git a/lib/SNMP/Info/Layer3/AlcatelLucent.pm b/lib/SNMP/Info/Layer3/AlcatelLucent.pm index 0ff71cbc..2c08f3a5 100644 --- a/lib/SNMP/Info/Layer3/AlcatelLucent.pm +++ b/lib/SNMP/Info/Layer3/AlcatelLucent.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::AlcatelLucent -# $Id$ # # Copyright (c) 2008 Bill Fenner # @@ -30,6 +29,7 @@ package SNMP::Info::Layer3::AlcatelLucent; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -115,7 +115,9 @@ sub os_ver { my $alu = shift; my $descr = $alu->description(); - return $1 if $descr =~ m/\b(\d[\.\d]+R\d+) (?:GA|Service Release), /; + if (defined ($descr)) { + return $1 if $descr =~ m/\b(\d[\.\d]+R\d+) (?:GA|Service Release), /; + } # No clue what this will try but hey return $alu->SUPER::os_ver(); @@ -370,7 +372,7 @@ These are methods that return scalar value from SNMP =item $alu->vendor() - Returns 'alcatel-lucent' +Returns 'alcatel-lucent' =item $alu->model() diff --git a/lib/SNMP/Info/Layer3/AlteonAD.pm b/lib/SNMP/Info/Layer3/AlteonAD.pm index 1b03902d..bed5b894 100644 --- a/lib/SNMP/Info/Layer3/AlteonAD.pm +++ b/lib/SNMP/Info/Layer3/AlteonAD.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::AlteonAD -# $Id$ # # Copyright (c) 2008 Eric Miller # All Rights Reserved @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::AlteonAD; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -450,11 +450,6 @@ Eric Miller Abstraction subclass for Radware Alteon Series ADC switches and Nortel BladeCenter Layer2-3 GbE Switch Modules. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $alteon = new SNMP::Info::Layer3::AlteonAD(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/Altiga.pm b/lib/SNMP/Info/Layer3/Altiga.pm index 00861762..f60fab59 100644 --- a/lib/SNMP/Info/Layer3/Altiga.pm +++ b/lib/SNMP/Info/Layer3/Altiga.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Altiga -# $Id$ # # Copyright (c) 2008 Jeroen van Ingen Schenau # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::Altiga; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -281,7 +281,7 @@ Jeroen van Ingen Schenau Debug => 1, DestHost => 'my_vpn_host', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -304,6 +304,12 @@ Subclass for Cisco (formerly Altiga) VPN concentrators =over +=item F + +=item F + +=item F + =item Inherited Classes' MIBs See L for its own MIB requirements. diff --git a/lib/SNMP/Info/Layer3/Arista.pm b/lib/SNMP/Info/Layer3/Arista.pm index 54be0ee9..e72c9ff5 100644 --- a/lib/SNMP/Info/Layer3/Arista.pm +++ b/lib/SNMP/Info/Layer3/Arista.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Arista -# $Id$ # # Copyright (c) 2008 Arista Networks, Inc. # All rights reserved. @@ -31,18 +30,17 @@ package SNMP::Info::Layer3::Arista; use strict; +use warnings; use Exporter; - use SNMP::Info::Layer3; use SNMP::Info::MAU; -use SNMP::Info::LLDP; use SNMP::Info::Aggregate 'agg_ports_ifstack'; @SNMP::Info::Layer3::Arista::ISA = qw/ SNMP::Info::Aggregate - SNMP::Info::LLDP SNMP::Info::MAU - SNMP::Info::Layer3 Exporter + SNMP::Info::Layer3 + Exporter /; @SNMP::Info::Layer3::Arista::EXPORT_OK = qw//; @@ -53,7 +51,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::MAU::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::Aggregate::MIBS, 'ARISTA-PRODUCTS-MIB' => 'aristaDCS7124S', ); @@ -61,19 +58,16 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::MAU::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, %SNMP::Info::MAU::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::MAU::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); # use MAU-MIB for admin. duplex and admin. speed @@ -92,11 +86,14 @@ sub os { sub os_ver { my $arista = shift; - my $descr = $arista->description(); - my $os_ver = undef; + my $descr = $arista->description(); - $os_ver = $1 if ( $descr =~ /\s+EOS\s+version\s+(\S+)\s+/ ); - return $os_ver; + if (defined ($descr)) { + my $os_ver = undef; + $os_ver = $1 if ($descr =~ /\s+EOS\s+version\s+(\S+)\s+/); + return $os_ver; + } + return; } sub model { @@ -174,8 +171,6 @@ Subclass for Arista Networks EOS-based devices =item SNMP::Info::MAU -=item SNMP::Info::LLDP - =back =head2 Required MIBs @@ -192,8 +187,6 @@ See L for its own MIB requirements. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -230,10 +223,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::Layer3 - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -269,8 +258,4 @@ See documentation in L for details. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Aruba.pm b/lib/SNMP/Info/Layer3/Aruba.pm index 4aaae7cd..6e2a4285 100644 --- a/lib/SNMP/Info/Layer3/Aruba.pm +++ b/lib/SNMP/Info/Layer3/Aruba.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Aruba -# $Id$ # # Copyright (c) 2013 Eric Miller # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer3::Aruba; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Aruba::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::Aruba::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Aruba::EXPORT_OK = qw//; our ($VERSION, %FUNCS, %GLOBALS, %MIBS, %MUNGE); @@ -44,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'WLSR-AP-MIB' => 'wlsrHideSSID', 'WLSX-IFEXT-MIB' => 'ifExtVlanName', 'WLSX-POE-MIB' => 'wlsxPseSlotPowerAvailable', @@ -58,7 +56,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'aruba_serial_old' => 'wlsxSwitchLicenseSerialNumber', 'aruba_serial_new' => 'wlsxSysExtLicenseSerialNumber', 'aruba_model' => 'wlsxModelName', @@ -67,7 +64,6 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, # WLSR-AP-MIB::wlsrConfigTable 'aruba_ap_ssidbcast' => 'wlsrHideSSID', @@ -143,7 +139,6 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, 'aruba_ap_fqln' => \&munge_aruba_fqln, 'aruba_ap_type' => \&SNMP::Info::munge_e_type, 'aruba_card_type' => \&SNMP::Info::munge_e_type, @@ -170,10 +165,9 @@ sub vendor { $id = $1 if ( defined($id) && $id =~ /^\.1\.3\.6\.1\.4\.1\.(\d+)/ ); if ( defined($id) and exists( $oidmap{$id} ) ) { - return $oidmap{$id}; - } - else { - return 'aruba'; + return $oidmap{$id}; + } else { + return 'aruba'; } } @@ -183,7 +177,7 @@ sub os_ver { return unless defined $descr; if ( $descr =~ m/Version\s+(\d+\.\d+\.\d+\.\d+)/ ) { - return $1; + return $1; } return; @@ -1421,11 +1415,6 @@ 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::Layer3::Aruba(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/BayRS.pm b/lib/SNMP/Info/Layer3/BayRS.pm index 22c56700..0fa93095 100644 --- a/lib/SNMP/Info/Layer3/BayRS.pm +++ b/lib/SNMP/Info/Layer3/BayRS.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::BayRS -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,13 +30,12 @@ package SNMP::Info::Layer3::BayRS; use strict; +use warnings; use Exporter; -use SNMP::Info; use SNMP::Info::Layer3; -use SNMP::Info::Bridge; -@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info SNMP::Info::Layer3 - SNMP::Info::Bridge Exporter/; +@SNMP::Info::Layer3::BayRS::ISA = qw/SNMP::Info::Layer3 + Exporter/; @SNMP::Info::Layer3::BayRS::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE, %MODEL_MAP, @@ -46,9 +44,7 @@ our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE, %MODEL_MAP, $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, - %SNMP::Info::Bridge::MIBS, 'Wellfleet-HARDWARE-MIB' => 'wfHwBpIdOpt', 'Wellfleet-OSPF-MIB' => 'wfOspfRouterId', 'Wellfleet-DOT1QTAG-CONFIG-MIB' => 'wfDot1qTagCfgVlanName', @@ -57,18 +53,14 @@ $VERSION = '3.68'; ); %GLOBALS = ( - %SNMP::Info::GLOBALS, %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::Bridge::GLOBALS, 'bp_id' => 'wfHwBpIdOpt', 'bp_serial' => 'wfHwBpSerialNumber', 'ospf_rtr_id' => 'wfOspfRouterId', ); %FUNCS = ( - %SNMP::Info::FUNCS, %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::Bridge::FUNCS, # From Wellfleet-CSMACD-MIB::wfCSMACDTable 'wf_csmacd_cct' => 'wfCSMACDCct', @@ -107,9 +99,7 @@ $VERSION = '3.68'; ); %MUNGE = ( - %SNMP::Info::MUNGE, %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::Bridge::MUNGE, 'wf_hw_boot' => \&munge_hw_rev, 'wf_hw_diag' => \&munge_hw_rev, 'wf_hw_mobo_ser' => \&munge_wf_serial, @@ -541,7 +531,10 @@ sub model { my $bayrs = shift; my $bp_id = $bayrs->bp_id(); - return defined $MODEL_MAP{$bp_id} ? $MODEL_MAP{$bp_id} : $bp_id; + if (defined $bp_id) { + return defined $MODEL_MAP{$bp_id} ? $MODEL_MAP{$bp_id} : $bp_id; + } + return; } sub vendor { @@ -776,7 +769,7 @@ sub e_index { my $bp_id = $bayrs->bp_id(); # Don't like polling all these columns to build the index, can't think of - # a better way right now. Luckly all this data will be cached for the + # a better way right now. Luckily all this data will be cached for the # rest of the e_* methods # Using mib leafs so we don't have to define everything in FUNCS @@ -805,7 +798,7 @@ sub e_index { my @slots = ( $wf_mb, $wf_db, $wf_bb, $wf_mod, $wf_mod1, $wf_mod2 ); my @mods = ( $wf_mm, $wf_dm ); - # We're going to hack an index: Slot/Module/Postion + # We're going to hack an index: Slot/Module/Position my %wf_e_index; # Chassis on BN types @@ -1406,19 +1399,10 @@ Eric Miller Abstraction subclass for routers running Avaya/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. - - my $bayrs = new SNMP::Info::Layer3::BayRS(...); - =head2 Inherited Classes =over -=item SNMP::Info - -=item SNMP::Info::Bridge - =item SNMP::Info::Layer3 =back @@ -1441,10 +1425,6 @@ after determining a more specific class using the method above. =head2 Inherited MIBs -See L for its own MIB requirements. - -See L for its own MIB requirements. - See L for its own MIB requirements. =head1 GLOBALS @@ -1500,14 +1480,6 @@ undefined. =back -=head2 Globals imported from SNMP::Info - -See documentation in L for details. - -=head2 Globals imported from SNMP::Info::Bridge - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::Layer3 See documentation in L for details. @@ -1625,14 +1597,6 @@ is not contained in any other entity. =back -=head2 Table Methods imported from SNMP::Info - -See documentation in L for details. - -=head2 Table Methods imported from SNMP::Info::Bridge - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::Layer3 See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/BlueCoatSG.pm b/lib/SNMP/Info/Layer3/BlueCoatSG.pm index cddf8d97..5a6543b3 100644 --- a/lib/SNMP/Info/Layer3/BlueCoatSG.pm +++ b/lib/SNMP/Info/Layer3/BlueCoatSG.pm @@ -28,6 +28,7 @@ package SNMP::Info::Layer3::BlueCoatSG; # POSSIBILITY OF SUCH DAMAGE. use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -55,7 +56,7 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::Layer3::MUNGE, ); sub vendor { - return 'Blue Coat'; + return 'bluecoat'; } sub os { @@ -65,7 +66,7 @@ sub os { sub os_ver { my $sg = shift; my $os_string = $sg->sw_ver(); - if ($os_string =~ /^Version:\s(\w+)\s([\d\.]+)/) { + if (defined ($os_string) && $os_string =~ /^Version:\s(\w+)\s([\d\.]+)/) { return $2; } else { return ''; # perhaps we can try sysDescr or some other object... @@ -92,7 +93,7 @@ Jeroen van Ingen Debug => 1, DestHost => 'myrouter', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -113,10 +114,10 @@ Subclass for Blue Coat SG Series proxy devices =head2 Required MIBs - BLUECOAT-SG-PROXY-MIB - =over +=item F + =item Inherited Classes' MIBs See L for its own MIB requirements. @@ -133,7 +134,7 @@ These are methods that return scalar value from SNMP =item $router->vendor() -Returns C<'Blue Coat'> +Returns C<'bluecoat'> =item $router->os() diff --git a/lib/SNMP/Info/Layer3/C3550.pm b/lib/SNMP/Info/Layer3/C3550.pm index 4fe194b8..b977f978 100644 --- a/lib/SNMP/Info/Layer3/C3550.pm +++ b/lib/SNMP/Info/Layer3/C3550.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::C3550 -# $Id$ # # Copyright (c) 2008-2009 Max Baker changes from version 0.8 and beyond. # Copyright (c) 2004 Regents of the University of California @@ -105,7 +104,7 @@ sub ports { return $ports; } -# Verions prior to 12.1(22)EA1a use the older CiscoStack method +# Versions prior to 12.1(22)EA1a use the older CiscoStack method # Newer versions use the ETHERLIKE-MIB to report operational duplex. # See http://www.ciscosystems.com/en/US/products/hw/switches/ps646/prod_release_note09186a00802a08ee.html @@ -228,11 +227,6 @@ These devices run IOS but have some of the same characteristics as the Catalyst WS-C family (5xxx,6xxx). For example, forwarding tables are held in VLANs, and extended interface information is gleaned from F. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $c3550 = new SNMP::Info::Layer3::C3550(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/C4000.pm b/lib/SNMP/Info/Layer3/C4000.pm index bcded524..7a4d6e88 100644 --- a/lib/SNMP/Info/Layer3/C4000.pm +++ b/lib/SNMP/Info/Layer3/C4000.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::C4000 -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -129,11 +128,6 @@ Bill Fenner 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 diff --git a/lib/SNMP/Info/Layer3/C6500.pm b/lib/SNMP/Info/Layer3/C6500.pm index ef48e9bd..c4aa7f00 100644 --- a/lib/SNMP/Info/Layer3/C6500.pm +++ b/lib/SNMP/Info/Layer3/C6500.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::C6500 -# $Id$ # # Copyright (c) 2008-2009 Max Baker # All rights reserved. @@ -186,7 +185,7 @@ sub set_i_duplex_admin { # 2. Disable ifMauAutoNegAdminStatus # If the second set is not done, this is not going to be # working... Cisco Bug id CSCty97033. - # SXI is not working (up to at least relase SXI9). + # SXI is not working (up to at least release SXI9). # SXJ is working at SXJ3 (not before). return $c6500->mau_set_i_duplex_admin( $duplex, $iid ); @@ -224,7 +223,7 @@ sub set_i_speed_admin { # 2. Disable ifMauAutoNegAdminStatus # If the second set is not done, this is not going to be working... # Cisco Bug id CSCty97033. - # SXI is not working (at least up to relase SXI9). + # SXI is not working (at least up to release SXI9). # SXJ is working at SXJ3 (not before). return $c6500->mau_set_i_speed_admin( $speed, $iid ); @@ -242,7 +241,8 @@ __END__ =head1 NAME SNMP::Info::Layer3::C6500 - SNMP Interface to Cisco Catalyst 6500 Layer 2/3 -Switches running IOS and/or CatOS +Switches running IOS and/or CatOS. Also Cisco Catalyst 2960, 2970, 3750 and +3850 series and blade switch CBS30x0 and CBS31x0 series running IOS. =head1 AUTHOR @@ -272,10 +272,9 @@ These devices run IOS but have some of the same characteristics as the Catalyst WS-C family (5xxx). For example, forwarding tables are held in VLANs, and extended interface information is gleaned from F. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $c6500 = new SNMP::Info::Layer3::C6500(...); +It also supports the following IOS only series switches: Cisco Catalyst 2960, +2970, 3750 and 3850 series. Also blade switches from the CBS30x0 and CBS31x0 +series. =head2 Inherited Classes @@ -293,6 +292,8 @@ after determining a more specific class using the method above. =over +=item F + =item Inherited Classes' MIBs See L for its own MIB requirements. @@ -312,7 +313,7 @@ These are methods that return scalar value from SNMP =item $c6500->vendor() - Returns 'cisco' +Returns 'cisco' =item $c6500->cvsSwitchMode() @@ -397,13 +398,11 @@ Crosses $c6500->p_port() with $c6500->p_speed() to utilize port C. See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::Layer3::CiscoSwitch See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::MAU See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/CheckPoint.pm b/lib/SNMP/Info/Layer3/CheckPoint.pm index f7a39b07..1da0b90a 100644 --- a/lib/SNMP/Info/Layer3/CheckPoint.pm +++ b/lib/SNMP/Info/Layer3/CheckPoint.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::CheckPoint -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer3::CheckPoint; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::CheckPoint::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::CheckPoint::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::CheckPoint::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -44,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'CHECKPOINT-MIB' => 'fwProduct', 'UCD-SNMP-MIB' => 'versionTag', 'NET-SNMP-TC' => 'netSnmpAliasDomain', @@ -54,15 +52,12 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'netsnmp_vers' => 'versionTag', 'hrSystemUptime' => 'hrSystemUptime', - ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, # Net-SNMP Extend table that could but customize to add a the CheckPoint version 'extend_output_table' => 'nsExtendOutputFull', @@ -70,7 +65,6 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); sub vendor { @@ -199,11 +193,11 @@ Ambroise Rosset =head1 DESCRIPTION -Subclass for Generic Net-SNMP devices +Subclass for CheckPoint Devices. =head2 WARNING -To correctly and completelly work, you should add the following line in the file C on each of your CheckPoint devices: +To correctly and completely work, you should add the following line in the file C on each of your CheckPoint devices: # Netdisco SNMP configuration extend ckpVersion /opt/CPsuite-R77/fw1/bin/fw ver @@ -221,8 +215,12 @@ To correctly and completelly work, you should add the following line in the file =over +=item F + =item F +=item F + =item F =item F @@ -231,8 +229,6 @@ To correctly and completelly work, you should add the following line in the file See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -279,10 +275,6 @@ Return '01001100'. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE ENTRIES These are methods that return tables of information in the form of a reference @@ -304,10 +296,6 @@ Ignores loopback See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 NOTES In order to cause SNMP::Info to classify your device into this class, it diff --git a/lib/SNMP/Info/Layer3/Cisco.pm b/lib/SNMP/Info/Layer3/Cisco.pm index f83df95e..3eb06c46 100644 --- a/lib/SNMP/Info/Layer3/Cisco.pm +++ b/lib/SNMP/Info/Layer3/Cisco.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Cisco -# $Id$ # # Copyright (c) 2008 Max Baker # All rights reserved. @@ -34,7 +33,6 @@ use strict; use warnings; use Exporter; use SNMP::Info::CiscoVTP; -use SNMP::Info::LLDP; use SNMP::Info::CDP; use SNMP::Info::CiscoStats; use SNMP::Info::CiscoRTT; @@ -45,7 +43,7 @@ use SNMP::Info::CiscoStpExtensions; use SNMP::Info::Layer3; @SNMP::Info::Layer3::Cisco::ISA = qw/SNMP::Info::CiscoVTP - SNMP::Info::LLDP SNMP::Info::CDP + SNMP::Info::CDP SNMP::Info::CiscoStats SNMP::Info::CiscoRTT SNMP::Info::CiscoQOS SNMP::Info::CiscoConfig SNMP::Info::CiscoPower SNMP::Info::CiscoStpExtensions @@ -66,7 +64,6 @@ $VERSION = '3.68'; %SNMP::Info::CiscoRTT::MIBS, %SNMP::Info::CiscoStats::MIBS, %SNMP::Info::CDP::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::CiscoVTP::MIBS, 'CISCO-EIGRP-MIB' => 'cEigrpAsRouterId', ); @@ -80,7 +77,6 @@ $VERSION = '3.68'; %SNMP::Info::CiscoRTT::GLOBALS, %SNMP::Info::CiscoStats::GLOBALS, %SNMP::Info::CDP::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, %SNMP::Info::CiscoVTP::GLOBALS, 'eigrp_id' => 'cEigrpAsRouterId', ); @@ -94,13 +90,11 @@ $VERSION = '3.68'; %SNMP::Info::CiscoRTT::FUNCS, %SNMP::Info::CiscoStats::FUNCS, %SNMP::Info::CDP::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::CiscoVTP::FUNCS, # CISCO-EIGRP-MIB::cEigrpPeerTable 'c_eigrp_peer_types' => 'cEigrpPeerAddrType', 'c_eigrp_peers' => 'cEigrpPeerAddr', - ); %MUNGE = ( @@ -108,7 +102,7 @@ $VERSION = '3.68'; %SNMP::Info::CiscoPower::MUNGE, %SNMP::Info::CiscoConfig::MUNGE, %SNMP::Info::CiscoQOS::MUNGE, %SNMP::Info::CiscoRTT::MUNGE, %SNMP::Info::CiscoStats::MUNGE, %SNMP::Info::CDP::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::CiscoVTP::MUNGE, + %SNMP::Info::CiscoVTP::MUNGE, ); sub i_vlan { @@ -214,8 +208,6 @@ for other device specific L3 Cisco classes. =item SNMP::Info::CiscoVTP -=item SNMP::Info::LLDP - =item SNMP::Info::CDP =item SNMP::Info::CiscoStats @@ -244,8 +236,6 @@ for other device specific L3 Cisco classes. See L for its own MIB requirements. -See L for its own MIB requirements. - See L for its own MIB requirements. See L for its own MIB requirements. @@ -285,10 +275,6 @@ Determined by checking C. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::CDP See documentation in L for details. @@ -344,10 +330,6 @@ Returns a mapping between C and the PVID or default VLAN. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::CDP See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/CiscoASA.pm b/lib/SNMP/Info/Layer3/CiscoASA.pm index 049c7811..e9cd0690 100644 --- a/lib/SNMP/Info/Layer3/CiscoASA.pm +++ b/lib/SNMP/Info/Layer3/CiscoASA.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::CiscoASA -# $Id$ # # Copyright (c) 2013 Moe Kraus # All rights reserved. @@ -113,7 +112,7 @@ Moe Kraus =head1 SYNOPSIS # Let SNMP::Info determine the correct subclass for you. - my $cisco = new SNMP::Info( + my $asa = new SNMP::Info( AutoSpecify => 1, Debug => 1, # These arguments are passed directly to SNMP::Session diff --git a/lib/SNMP/Info/Layer3/CiscoFWSM.pm b/lib/SNMP/Info/Layer3/CiscoFWSM.pm index ef3a0df5..a8745a24 100644 --- a/lib/SNMP/Info/Layer3/CiscoFWSM.pm +++ b/lib/SNMP/Info/Layer3/CiscoFWSM.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::CiscoFWSM -# $Id$ # # Copyright (c) 2010 Brian De Wolf # All rights reserved. diff --git a/lib/SNMP/Info/Layer3/CiscoSwitch.pm b/lib/SNMP/Info/Layer3/CiscoSwitch.pm index d87e1ff9..9d85a594 100644 --- a/lib/SNMP/Info/Layer3/CiscoSwitch.pm +++ b/lib/SNMP/Info/Layer3/CiscoSwitch.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::CiscoSwitch -# $Id$ # # Copyright (c) 2014 Eric Miller # All rights reserved. @@ -155,10 +154,6 @@ Returns 1. Use vlan indexing. =back -=head2 Global Methods imported from SNMP::Info::CiscoAgg - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::CiscoPortSecurity See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/Contivity.pm b/lib/SNMP/Info/Layer3/Contivity.pm index 5e68b32d..c284593a 100644 --- a/lib/SNMP/Info/Layer3/Contivity.pm +++ b/lib/SNMP/Info/Layer3/Contivity.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Contivity -# $Id$ # # Copyright (c) 2010 Eric Miller # All rights reserved. @@ -31,13 +30,12 @@ package SNMP::Info::Layer3::Contivity; use strict; +use warnings; use Exporter; -use SNMP::Info; use SNMP::Info::Layer3; -use SNMP::Info::Entity; @SNMP::Info::Layer3::Contivity::ISA - = qw/SNMP::Info SNMP::Info::Layer3 SNMP::Info::Entity Exporter/; + = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Contivity::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); @@ -45,22 +43,19 @@ our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); $VERSION = '3.68'; %MIBS = ( - %SNMP::Info::MIBS, %SNMP::Info::Layer3::MIBS, %SNMP::Info::Entity::MIBS, + %SNMP::Info::Layer3::MIBS, ); %GLOBALS = ( - %SNMP::Info::GLOBALS, %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::Entity::GLOBALS, + %SNMP::Info::Layer3::GLOBALS, ); %FUNCS = ( - %SNMP::Info::FUNCS, %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::Entity::FUNCS, + %SNMP::Info::Layer3::FUNCS, ); %MUNGE = ( - %SNMP::Info::MUNGE, %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::Entity::MUNGE, + %SNMP::Info::Layer3::MUNGE, ); sub layers { @@ -189,21 +184,12 @@ Eric Miller Abstraction subclass for Avaya/Nortel VPN Routers (formerly Contivity Extranet Switch). -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $contivity = new SNMP::Info::Layer3::Contivity(...); - =head2 Inherited Classes =over -=item SNMP::Info - =item SNMP::Info::Layer3 -=item SNMP::Info::Entity - =back =head2 Required MIBs @@ -212,12 +198,8 @@ after determining a more specific class using the method above. =item Inherited Classes' MIBs -See L for its own MIB requirements. - See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -238,7 +220,7 @@ Returns the chassis name. =item $contivity->os() -Returns C<'CES'> +Returns C<'contivity'> =item $contivity->os_ver() @@ -267,18 +249,10 @@ layers. =back -=head2 Globals imported from SNMP::Info - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::Layer3 See documentation in L for details. -=head2 Globals imported from SNMP::Info::Entity - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -299,16 +273,8 @@ Interface Name field. Skips loopback and tunnel interfaces. =back -=head2 Table Methods imported from SNMP::Info - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::Layer3 See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::Entity - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Cumulus.pm b/lib/SNMP/Info/Layer3/Cumulus.pm index 7a064ed5..8c99dc2f 100644 --- a/lib/SNMP/Info/Layer3/Cumulus.pm +++ b/lib/SNMP/Info/Layer3/Cumulus.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Cumulus -# $Id$ # # Copyright (c) 2018 Bill Fenner and Oliver Gorwits # All rights reserved. @@ -31,14 +30,13 @@ package SNMP::Info::Layer3::Cumulus; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; use SNMP::Info::IEEE802dot3ad 'agg_ports_lag'; @SNMP::Info::Layer3::Cumulus::ISA = qw/ SNMP::Info::IEEE802dot3ad - SNMP::Info::LLDP SNMP::Info::Layer3 Exporter /; @@ -50,7 +48,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::IEEE802dot3ad::MIBS, 'UCD-SNMP-MIB' => 'versionTag', 'NET-SNMP-TC' => 'netSnmpAliasDomain', @@ -59,7 +56,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'netsnmp_vers' => 'versionTag', 'hrSystemUptime' => 'hrSystemUptime', 'chassis' => 'entPhysicalDescr.1', @@ -67,17 +63,15 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::IEEE802dot3ad::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::IEEE802dot3ad::MUNGE, ); -sub vendor { return 'Cumulus Networks' } +sub vendor { return 'cumulus networks' } sub os { return 'cumulus' } @@ -86,7 +80,7 @@ sub os_ver { my $descr = $netsnmp->description(); # STRING: "Cumulus Linux version 3.5.1 running on innotek GmbH VirtualBox" - return $1 if ( $descr =~ /^Cumulus Linux.+(\d+\.\d+\.\d+)\s/ ); + return $1 if ( defined ($descr) && $descr =~ /^Cumulus Linux.+(\d+\.\d+\.\d+)\s/ ); return; } @@ -95,7 +89,9 @@ sub model { my $chassis = $netsnmp->chassis(); # STRING: "Cumulus Networks VX Chassis" - return $1 if ( $chassis =~ /^Cumulus Networks\s+(.+)/ ); + if (defined ($chassis)) { + return $1 if ($chassis =~ /^Cumulus Networks\s+(.+)/); + } return $netsnmp->SUPER::model(); } @@ -116,7 +112,7 @@ sub uptime { # ifDescr is the same for all interfaces in a class, but the ifName is # unique, so let's use that for port name. If all else fails, -# concatentate ifDesc and ifIndex. +# concatenate ifDesc and ifIndex. # (code from SNMP/Info/Layer2/Netgear.pm) sub interfaces { my $netsnmp = shift; @@ -218,8 +214,6 @@ Subclass for Cumulus Networks devices See L for its own MIB requirements. -See L for its own MIB requirements. - See L for its own MIB requirements. =back @@ -232,7 +226,7 @@ These are methods that return scalar value from SNMP =item $cumulus->vendor() -Returns 'Cumulus Networks'. +Returns 'cumulus networks'. =item $cumulus->os() @@ -258,10 +252,6 @@ Returns the chassis type. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::IEEE802dot3ad See documentation in L for details. @@ -295,10 +285,6 @@ ifIndex of the corresponding master ports. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::IEEE802dot3ad See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/DLink.pm b/lib/SNMP/Info/Layer3/DLink.pm index 4a4416bf..a2175e47 100644 --- a/lib/SNMP/Info/Layer3/DLink.pm +++ b/lib/SNMP/Info/Layer3/DLink.pm @@ -29,11 +29,11 @@ package SNMP::Info::Layer3::DLink; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::DLink::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::DLink::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::DLink::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); @@ -42,7 +42,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'DLINK-ID-REC-MIB' => 'dlink', 'SWPRIMGMT-DES3200-MIB' => 'dlink-des3200SeriesProd', 'SWPRIMGMT-DES30XXP-MIB' => 'dlink-des30xxproductProd', @@ -54,17 +53,14 @@ $VERSION = '3.68'; 'DES-1210-52-BX' => 'des-1210-52bx', 'DES-1210-52-CX' => 'des-1210-52-cx', 'DGS-1210-24-AX' => 'dgs-1210-24ax', - ); %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, 'dlink_fw' => 'probeSoftwareRev', 'dlink_hw' => 'probeHardwareRev', # Replaced with OID since these MIBs are no longer in the netdisco-mibs @@ -76,7 +72,7 @@ $VERSION = '3.68'; # replaced similarly and use the library getter methods ); -%MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::LLDP::MUNGE, ); +%MUNGE = ( %SNMP::Info::Layer3::MUNGE, ); sub model { my $dlink=shift; @@ -197,7 +193,33 @@ Subclass for DLink devices. =item SNMP::Info::Layer3 -=item SNMP::Info::LLDP +=back + +=head2 Required MIBs + +=over + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F + +=item F =back @@ -205,8 +227,6 @@ Subclass for DLink devices. See L for its own MIB requirements. -See L for its own MIB requirements. - =head1 GLOBALS These are methods that return scalar value from SNMP @@ -243,8 +263,6 @@ Returns the STP root port. See documentation in L for details. -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -262,6 +280,4 @@ Returns the map between SNMP Interface Identifier (iid) and C. See documentation in L for details. -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Dell.pm b/lib/SNMP/Info/Layer3/Dell.pm index 3415656b..91501619 100644 --- a/lib/SNMP/Info/Layer3/Dell.pm +++ b/lib/SNMP/Info/Layer3/Dell.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Dell - SNMP Interface to Dell devices -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer3::Dell; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Dell::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::Dell::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Dell::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %FUNCS, %MIBS, %MUNGE); @@ -44,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'RADLAN-COPY-MIB' => 'rlCopySourceLocation', 'RADLAN-Physicaldescription-MIB' => 'rlPhdStackReorder', 'RADLAN-rlInterfaces' => 'rlIfNumOfLoopbackPorts', @@ -55,14 +53,12 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'dell_os_ver' => 'productIdentificationVersion', 'dell_id_name' => 'productIdentificationDisplayName', ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, # RADLAN-rlInterfaces:swIfTable 'dell_duplex_admin' => 'swIfDuplexAdminMode', @@ -108,7 +104,7 @@ $VERSION = '3.68'; 'dell_fan_desc' => 'rlEnvMonFanStatusDescr', ); -%MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::LLDP::MUNGE, ); +%MUNGE = ( %SNMP::Info::Layer3::MUNGE, ); # Method OverRides @@ -336,7 +332,7 @@ Eric Miller Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -452,10 +448,6 @@ otherwise uses the Layer3 serial method. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -528,8 +520,4 @@ Returns nothing to work around incorrect indexing of C See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/ERX.pm b/lib/SNMP/Info/Layer3/ERX.pm index 88cca9de..d2b8eef8 100644 --- a/lib/SNMP/Info/Layer3/ERX.pm +++ b/lib/SNMP/Info/Layer3/ERX.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::ERX; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -60,7 +61,7 @@ $VERSION = '3.68'; ); sub vendor { - return "Juniper"; + return "juniper"; } sub model { @@ -82,7 +83,7 @@ sub os_ver { my $descr = $ERX->description(); my $os_ver = undef; - if ( $descr =~ /Version : \((.+)\) .+:/ ) { + if ( defined ($descr) && $descr =~ /Version : \((.+)\) .+:/ ) { $os_ver = $1; } @@ -110,7 +111,7 @@ __END__ =head1 NAME -SNMP::Info::Layer3::ERX - SNMP Interface to ERX Layer 3 routers. +SNMP::Info::Layer3::ERX - SNMP Interface to Juniper ERX Layer 3 routers. =head1 AUTHORS @@ -161,7 +162,7 @@ These are methods that return scalar value from SNMP =item $ERX->vendor() -Returns 'Juniper'. +Returns 'juniper'. =item $ERX->os() diff --git a/lib/SNMP/Info/Layer3/Enterasys.pm b/lib/SNMP/Info/Layer3/Enterasys.pm index 1848ca88..cb95b75f 100644 --- a/lib/SNMP/Info/Layer3/Enterasys.pm +++ b/lib/SNMP/Info/Layer3/Enterasys.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Enterasys - SNMP Interface to Enterasys devices -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,13 +30,13 @@ package SNMP::Info::Layer3::Enterasys; use strict; +use warnings; use Exporter; use SNMP::Info::MAU; -use SNMP::Info::LLDP; use SNMP::Info::CDP; use SNMP::Info::Layer3; -@SNMP::Info::Layer3::Enterasys::ISA = qw/SNMP::Info::MAU SNMP::Info::LLDP +@SNMP::Info::Layer3::Enterasys::ISA = qw/SNMP::Info::MAU SNMP::Info::CDP SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Enterasys::EXPORT_OK = qw//; @@ -48,24 +47,24 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::CDP::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::MAU::MIBS, + %SNMP::Info::MAU::MIBS, 'ENTERASYS-OIDS-MIB' => 'etsysOidDevice', ); %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::CDP::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, %SNMP::Info::MAU::GLOBALS, + %SNMP::Info::MAU::GLOBALS, 'mac' => 'dot1dBaseBridgeAddress', ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, %SNMP::Info::CDP::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::MAU::FUNCS, + %SNMP::Info::MAU::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::CDP::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::MAU::MUNGE, + %SNMP::Info::MAU::MUNGE, ); sub model { @@ -267,7 +266,7 @@ Eric Miller Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -280,19 +279,12 @@ Eric Miller Provides abstraction to the configuration information obtainable from an Enterasys 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 $enterasys = new SNMP::Info::Layer3::Enterasys(...); - =head2 Inherited Classes =over =item SNMP::Info::MAU -=item SNMP::Info::LLDP - =item SNMP::Info::CDP =item SNMP::Info::Layer3 @@ -311,8 +303,6 @@ my $enterasys = new SNMP::Info::Layer3::Enterasys(...); See L for its MIB requirements. -See L for its MIB requirements. - See L for its MIB requirements. See L for its MIB requirements. @@ -352,10 +342,6 @@ Returns base mac See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::CDP See documentation in L for details. @@ -427,10 +413,6 @@ supply a partial value of zero which means no time filter. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::CDP See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/Extreme.pm b/lib/SNMP/Info/Layer3/Extreme.pm index c39cfac2..fdc9c280 100644 --- a/lib/SNMP/Info/Layer3/Extreme.pm +++ b/lib/SNMP/Info/Layer3/Extreme.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Extreme - SNMP Interface to Extreme devices -# $Id$ # # Copyright (c) 2012 Eric Miller # @@ -33,14 +32,14 @@ package SNMP::Info::Layer3::Extreme; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::MAU; -use SNMP::Info::LLDP; use SNMP::Info::EDP; @SNMP::Info::Layer3::Extreme::ISA - = qw/SNMP::Info::Layer3 SNMP::Info::MAU SNMP::Info::LLDP + = qw/SNMP::Info::Layer3 SNMP::Info::MAU SNMP::Info::EDP Exporter/; @SNMP::Info::Layer3::Extreme::EXPORT_OK = qw//; @@ -51,7 +50,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::MAU::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::EDP::MIBS, 'EXTREME-BASE-MIB' => 'extremeAgent', 'EXTREME-SYSTEM-MIB' => 'extremeSystem', @@ -64,7 +62,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::MAU::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, %SNMP::Info::EDP::GLOBALS, 'serial1' => 'extremeSystemID.0', 'temp' => 'extremeCurrentTemperature', @@ -78,7 +75,6 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, %SNMP::Info::MAU::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::EDP::FUNCS, 'fan_state' => 'extremeFanOperational', # EXTREME-FDB-MIB:extremeFdbMacFdbTable @@ -119,7 +115,6 @@ $VERSION = '3.68'; # Inherit all the built in munging %SNMP::Info::Layer3::MUNGE, %SNMP::Info::MAU::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::EDP::MUNGE, 'ex_fw_mac' => \&SNMP::Info::munge_mac, 'ps1_status_old' => \&munge_true_ok, @@ -166,7 +161,6 @@ sub vendor { sub os { my $extreme = shift; - my $desc = $extreme->description(); if ( $desc =~ /xos/i ) { @@ -905,11 +899,6 @@ Eric Miller, Bill Fenner 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 @@ -918,8 +907,6 @@ my $extreme = new SNMP::Info::Layer3::Extreme(...); =item SNMP::Info::MAU -=item SNMP::Info::LLDP - =item SNMP::Info::EDP =back @@ -1014,10 +1001,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Globals imported from SNMP::Info::EDP See documentation in L for details. @@ -1228,10 +1211,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::EDP See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/F5.pm b/lib/SNMP/Info/Layer3/F5.pm index bfed4cf3..e6d567a0 100644 --- a/lib/SNMP/Info/Layer3/F5.pm +++ b/lib/SNMP/Info/Layer3/F5.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::F5; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -321,11 +322,6 @@ Eric Miller Abstraction subclass for F5 network devices. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $f5 = new SNMP::Info::Layer3::F5(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/Force10.pm b/lib/SNMP/Info/Layer3/Force10.pm index 1f2a1a4e..27dd8399 100644 --- a/lib/SNMP/Info/Layer3/Force10.pm +++ b/lib/SNMP/Info/Layer3/Force10.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Force10 -# $Id$ # # Copyright (c) 2012 William Bulley # All rights reserved. @@ -31,13 +30,13 @@ package SNMP::Info::Layer3::Force10; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::MAU; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Force10::ISA = qw/SNMP::Info::LLDP SNMP::Info::MAU +@SNMP::Info::Layer3::Force10::ISA = qw/SNMP::Info::MAU SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Force10::EXPORT_OK = qw//; @@ -48,26 +47,22 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, %SNMP::Info::MAU::MIBS, - %SNMP::Info::LLDP::MIBS, 'F10-PRODUCTS-MIB' => 'f10ESeriesProducts', ); %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, %SNMP::Info::MAU::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, %SNMP::Info::MAU::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, %SNMP::Info::MAU::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); # use MAU-MIB for admin. duplex and admin. speed @@ -202,8 +197,6 @@ Subclass for Force10 Networks FTOS-based devices. =item SNMP::Info::MAU -=item SNMP::Info::LLDP - =back =head2 Required MIBs @@ -218,8 +211,6 @@ See L for its own MIB requirements. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -254,10 +245,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::Layer3 - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -291,8 +278,4 @@ See documentation in L for details. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Fortinet.pm b/lib/SNMP/Info/Layer3/Fortinet.pm index 5b6f783f..137da61d 100644 --- a/lib/SNMP/Info/Layer3/Fortinet.pm +++ b/lib/SNMP/Info/Layer3/Fortinet.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::Fortinet; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -150,11 +151,6 @@ Eric Miller Abstraction subclass for Fortinet network devices. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $fortinet = new SNMP::Info::Layer3::Fortinet(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/Foundry.pm b/lib/SNMP/Info/Layer3/Foundry.pm index 305e9a4e..42ca9a66 100644 --- a/lib/SNMP/Info/Layer3/Foundry.pm +++ b/lib/SNMP/Info/Layer3/Foundry.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Foundry - SNMP Interface to Foundry devices -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,14 +32,13 @@ package SNMP::Info::Layer3::Foundry; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::FDP; -use SNMP::Info::LLDP; @SNMP::Info::Layer3::Foundry::ISA = qw/ SNMP::Info::FDP - SNMP::Info::LLDP SNMP::Info::Layer3 Exporter /; @@ -52,7 +50,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::FDP::MIBS, 'FOUNDRY-SN-ROOT-MIB' => 'foundry', @@ -65,7 +62,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, %SNMP::Info::FDP::GLOBALS, 'mac' => 'ifPhysAddress.1', @@ -81,7 +77,6 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::FDP::FUNCS, # FOUNDRY-SN-SWITCH-GROUP-MIB @@ -119,7 +114,6 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::FDP::MUNGE, 'ag_mod2_type' => \&SNMP::Info::munge_e_type, @@ -304,7 +298,7 @@ sub interfaces { # NetIron CES, NetIron CER, and older EdgeIron series devices. # Try Entity MIB methods first and fall back to Pseudo ENTITY-MIB methods for # other devices. -# e_fwver, e_hwver, e_swver not supported in psuedo methods, no need to +# e_fwver, e_hwver, e_swver not supported in pseudo methods, no need to # override sub e_index { @@ -866,7 +860,7 @@ Max Baker Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -876,12 +870,8 @@ Max Baker =head1 DESCRIPTION -Abstraction subclass for Brocade (Foundry) Networks devices. - -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $foundry = new SNMP::Info::Layer3::Foundry(...); +Provides abstraction to information obtainable from Brocade (Foundry) Networks +devices through SNMP. See inherited classes' documentation for inherited methods. =head2 Inherited Classes @@ -891,8 +881,6 @@ after determining a more specific class using the method above. =item SNMP::Info::FDP; -=item SNMP::Info::LLDP; - =back =head2 Required MIBs @@ -917,8 +905,6 @@ See L for its own MIB requirements. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -1007,10 +993,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a @@ -1275,8 +1257,4 @@ See documentation in L for details. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Genua.pm b/lib/SNMP/Info/Layer3/Genua.pm index b8e6f8f7..34f28e51 100644 --- a/lib/SNMP/Info/Layer3/Genua.pm +++ b/lib/SNMP/Info/Layer3/Genua.pm @@ -29,6 +29,7 @@ package SNMP::Info::Layer3::Genua; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -85,14 +86,15 @@ sub model { my $genua_model = $genua->genua_model(); - if ( $genua_model =~ m/GeNUA.+(GS.+?)\s/i ) { + if (defined $genua_model) { + if ($genua_model =~ m/GeNUA.+(GS.+?)\s/i) { $genua_model = $1; - } - elsif ( $genua_model =~ m/genua\s+(.+?)\s+/i ) { + } + elsif ($genua_model =~ m/genua\s+(.+?)\s+/i) { $genua_model = $1; - } - else { - $genua_model = 'unknown'; + } + } else { + $genua_model = 'unknown'; } return $genua_model; } @@ -121,7 +123,7 @@ Netdisco Developers Debug => 1, DestHost => 'myhub', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; diff --git a/lib/SNMP/Info/Layer3/H3C.pm b/lib/SNMP/Info/Layer3/H3C.pm index b3e2e3b6..fd28b223 100644 --- a/lib/SNMP/Info/Layer3/H3C.pm +++ b/lib/SNMP/Info/Layer3/H3C.pm @@ -30,14 +30,13 @@ package SNMP::Info::Layer3::H3C; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; use SNMP::Info::IEEE802dot3ad 'agg_ports_lag'; @SNMP::Info::Layer3::H3C::ISA = qw/ SNMP::Info::IEEE802dot3ad - SNMP::Info::LLDP SNMP::Info::Layer3 Exporter /; @@ -51,7 +50,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::IEEE802dot3ad::MIBS, 'HH3C-LswDEVM-MIB' => 'hh3cDevMFanStatus', 'HH3C-LswINF-MIB' => 'hh3cSlotPortMax', @@ -62,7 +60,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'fan' => 'hh3cDevMFanStatus.1', 'ps1_status' => 'hh3cDevMPowerStatus.1', 'ps2_status' => 'hh3cDevMPowerStatus.2', @@ -70,21 +67,19 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::IEEE802dot3ad::FUNCS, i_duplex_admin => 'hh3cifEthernetDuplex', ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, %SNMP::Info::IEEE802dot3ad::MUNGE, ); sub vendor { my $h3c = shift; my $mfg = $h3c->entPhysicalMfgName(1) || {}; - return $mfg->{1} || "H3C"; + return $mfg->{1} || "h3c"; } sub model { @@ -177,7 +172,7 @@ Subclass for H3C & HP A-series devices =item SNMP::Info::Layer3 -=item SNMP::Info::LLDP +=item SNMP::Info::IEEE802dot3ad =back @@ -201,8 +196,6 @@ See L for its own MIB requirements. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -234,9 +227,9 @@ C. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP +=head2 Globals imported from SNMP::Info::IEEE802dot3ad -See documentation in L for details. +See documentation in L for details. =head1 TABLE ENTRIES @@ -265,10 +258,6 @@ ifIndex of the corresponding master ports. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head2 Table Methods imported from SNMP::Info::IEEE802dot3ad See documentation in L for details. diff --git a/lib/SNMP/Info/Layer3/HP9300.pm b/lib/SNMP/Info/Layer3/HP9300.pm index 275047ed..32af19f4 100644 --- a/lib/SNMP/Info/Layer3/HP9300.pm +++ b/lib/SNMP/Info/Layer3/HP9300.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::HP9300 - SNMP Interface to HP Foundry OEM devices -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,12 +30,12 @@ package SNMP::Info::Layer3::HP9300; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::FDP; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::HP9300::ISA = qw/SNMP::Info::FDP SNMP::Info::LLDP +@SNMP::Info::Layer3::HP9300::ISA = qw/SNMP::Info::FDP SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::HP9300::EXPORT_OK = qw//; @@ -46,7 +45,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, %SNMP::Info::FDP::MIBS, 'HP-SN-ROOT-MIB' => 'hp', 'HP-SN-AGENT-MIB' => 'snChasPwrSupplyDescription', @@ -55,7 +53,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, %SNMP::Info::FDP::GLOBALS, 'mac' => 'ifPhysAddress.1', 'chassis' => 'entPhysicalDescr.1', @@ -68,7 +65,6 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, %SNMP::Info::FDP::FUNCS, # HP-SN-SWITCH-GROUP-MIB @@ -82,7 +78,7 @@ $VERSION = '3.68'; ); %MUNGE = ( - %SNMP::Info::Layer3::MUNGE, %SNMP::Info::LLDP::MUNGE, + %SNMP::Info::Layer3::MUNGE, %SNMP::Info::FDP::MUNGE, ); @@ -215,7 +211,7 @@ Eric Miller Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -228,11 +224,6 @@ Eric Miller Abstraction subclass for HP network devices which Foundry Networks was the Original Equipment Manufacturer (OEM) such as the HP ProCurve 9300 series. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $hp9300 = new SNMP::Info::Layer3::HP9300(...); - =head2 Inherited Classes =over @@ -241,8 +232,6 @@ after determining a more specific class using the method above. =item SNMP::Info::FDP; -=item SNMP::Info::LLDP; - =back =head2 Required MIBs @@ -261,8 +250,6 @@ See L for its own MIB requirements. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -286,7 +273,7 @@ Returns 'hp' =item $hp9300->os_ver() -Returns the software version +Returns the software version. =item $hp9300->mac() @@ -338,10 +325,6 @@ See documentation in L for details. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -407,8 +390,4 @@ See documentation in L for details. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Huawei.pm b/lib/SNMP/Info/Layer3/Huawei.pm index 5d3babf8..53734afc 100644 --- a/lib/SNMP/Info/Layer3/Huawei.pm +++ b/lib/SNMP/Info/Layer3/Huawei.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::Huawei; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::IEEE802dot3ad; @@ -111,14 +112,14 @@ $VERSION = '3.68'; ); sub vendor { - return "Huawei"; + return "huawei"; } sub os { my $huawei = shift; my $descr = $huawei->description(); - if ( $descr =~ /\b(VRP)\b/ ) { + if ( defined ($descr) && $descr =~ /\b(VRP)\b/ ) { return $1; } return "huawei"; @@ -135,7 +136,7 @@ sub os_ver { my $descr = $huawei->description(); my $os_ver = undef; - if ($descr =~ /Version\s # Start match on Version string + if (defined ($descr) && $descr =~ /Version\s # Start match on Version string ([\d\.]+) # Capture the primary version in 1 ,? # There may be a comma \s # Always a space @@ -570,7 +571,7 @@ These are methods that return scalar value from SNMP =item $huawei->vendor() -Returns 'Huawei'. +Returns 'huawei'. =item $huawei->os() diff --git a/lib/SNMP/Info/Layer3/IBMGbTor.pm b/lib/SNMP/Info/Layer3/IBMGbTor.pm index 3fcd74eb..ff081f46 100644 --- a/lib/SNMP/Info/Layer3/IBMGbTor.pm +++ b/lib/SNMP/Info/Layer3/IBMGbTor.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::IBMGbTor - SNMP Interface to IBM Rackswitch devices -# $Id$ # # Copyright (c) 2013 Eric Miller # All rights reserved. @@ -31,9 +30,9 @@ package SNMP::Info::Layer3::IBMGbTor; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; @SNMP::Info::Layer3::IBMGbTor::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; @@ -255,7 +254,7 @@ Eric Miller Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -269,11 +268,6 @@ Abstraction subclass for IBM Rackswitch (formerly Blade Network Technologies) network devices. Lenovo acquired these from IBM and is now selling them under the Lenovo brand. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $ibm = new SNMP::Info::Layer3::IBMGbTor(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer3/Juniper.pm b/lib/SNMP/Info/Layer3/Juniper.pm index 1d6e40b8..a920759f 100644 --- a/lib/SNMP/Info/Layer3/Juniper.pm +++ b/lib/SNMP/Info/Layer3/Juniper.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Juniper -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer3::Juniper; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 SNMP::Info::LLDP Exporter/; +@SNMP::Info::Layer3::Juniper::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Juniper::EXPORT_OK = qw//; our ($VERSION, $DEBUG, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -44,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'JUNIPER-CHASSIS-DEFINES-MIB' => 'jnxChassisDefines', 'JUNIPER-MIB' => 'jnxBoxAnatomy', 'JUNIPER-VIRTUALCHASSIS-MIB' => 'jnxVirtualChassisMemberTable', @@ -54,7 +52,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'serial' => 'jnxBoxSerialNo', 'mac' => 'dot1dBaseBridgeAddress', 'box_descr' => 'jnxBoxDescr', @@ -64,7 +61,6 @@ $VERSION = '3.68'; %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, # JUNIPER-VLAN-MIB::jnxExVlanPortGroupTable 'i_trunk' => 'jnxExVlanPortAccessMode', @@ -91,7 +87,6 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, 'e_containers_type' => \&SNMP::Info::munge_e_type, 'e_contents_type' => \&SNMP::Info::munge_e_type, ); @@ -143,10 +138,10 @@ sub model { my $l3 = shift; my $id = $l3->id(); # Query the junos device model. - my $mod = uc $l3->vc_model() || ''; + my $mod = $l3->vc_model() || ''; - if (not $mod eq '') { - return $mod; + if (not $mod eq '') { + return uc $mod; } # Fallback to old method unless ( defined $id ) { @@ -710,8 +705,6 @@ Subclass for Juniper Devices running JUNOS =item SNMP::Info::Layer3 -=item SNMP::Info::LLDP - =back =head2 Required MIBs @@ -734,8 +727,6 @@ Subclass for Juniper Devices running JUNOS See L for its own MIB requirements. -See L for its own MIB requirements. - =head1 GLOBALS These are methods that return scalar value from SNMP @@ -798,10 +789,6 @@ The name, model, or detailed description of the device. See documentation in L for details. -=head2 Global Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE METHODS These are methods that return tables of information in the form of a reference @@ -917,8 +904,4 @@ BOOLEAN. Is a Field Replaceable unit? See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Lantronix.pm b/lib/SNMP/Info/Layer3/Lantronix.pm index 61f311a6..6377322b 100644 --- a/lib/SNMP/Info/Layer3/Lantronix.pm +++ b/lib/SNMP/Info/Layer3/Lantronix.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Lantronix -# $Id$ # # Copyright (c) 2012 J R Binks # @@ -30,6 +29,7 @@ package SNMP::Info::Layer3::Lantronix; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -74,13 +74,14 @@ sub vendor { sub os { my $device = shift; my $descr = $device->description() || ''; - my $os; # On EDS, it is called the "Evolution OS" # Not sure what, if any, name it has a name on other products - $os = 'EvolutionOS' if ( $descr =~ m/Lantronix EDS\w+ V([\d\.R]+)/ ); - - return 'LantronixOS'; + if ( $descr =~ m/Lantronix EDS\w+ V([\d\.R]+)/ ) { + return 'EvolutionOS'; + } else { + return 'LantronixOS'; + } } sub os_ver { @@ -213,7 +214,7 @@ Returns 'lantronix'. =item $device->os() -Returns 'EvolutionOS' for EDS devices. +Returns 'EvolutionOS' for EDS devices, else returns 'LantronixOS'. =item $device->os_ver() @@ -246,16 +247,6 @@ See documentation in L for details. These are methods that return tables of information in the form of a reference to a hash. -=head2 Overrides - -=over - -=item $device->i_ignore() - -Returns reference to hash. Increments value of IID if port is to be ignored. - -=back - =head2 Lantronix specific items None at present. diff --git a/lib/SNMP/Info/Layer3/Lenovo.pm b/lib/SNMP/Info/Layer3/Lenovo.pm index 14016bf5..a49bb475 100644 --- a/lib/SNMP/Info/Layer3/Lenovo.pm +++ b/lib/SNMP/Info/Layer3/Lenovo.pm @@ -62,7 +62,6 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::IEEE802dot3ad::GLOBALS, # no way to get os version and other device details # ENTITY-MIB however can help out 'os_ver' => 'entPhysicalSoftwareRev.1', diff --git a/lib/SNMP/Info/Layer3/Microsoft.pm b/lib/SNMP/Info/Layer3/Microsoft.pm index 390c325d..4150988d 100644 --- a/lib/SNMP/Info/Layer3/Microsoft.pm +++ b/lib/SNMP/Info/Layer3/Microsoft.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Microsoft -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::Microsoft; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -96,7 +96,7 @@ __END__ =head1 NAME -SNMP::Info::Layer3::Microsoft - SNMP Interface to L3 Microsoft Windows router +SNMP::Info::Layer3::Microsoft - SNMP Interface to L3 Microsoft Windows routers =head1 AUTHOR @@ -110,7 +110,7 @@ begemot Debug => 1, DestHost => 'myrouter', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; diff --git a/lib/SNMP/Info/Layer3/Mikrotik.pm b/lib/SNMP/Info/Layer3/Mikrotik.pm index 0f795eee..47a58a37 100644 --- a/lib/SNMP/Info/Layer3/Mikrotik.pm +++ b/lib/SNMP/Info/Layer3/Mikrotik.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Mikrotik -# $Id$ # # Copyright (c) 2011 Jeroen van Ingen # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::Mikrotik; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; diff --git a/lib/SNMP/Info/Layer3/N1600.pm b/lib/SNMP/Info/Layer3/N1600.pm index 6f899a47..458bb820 100644 --- a/lib/SNMP/Info/Layer3/N1600.pm +++ b/lib/SNMP/Info/Layer3/N1600.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::N1600 - SNMP Interface to Nortel N16XX devices -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::N1600; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::SONMP; @@ -202,11 +202,6 @@ Eric Miller Provides abstraction to the configuration information obtainable from an Avaya/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 diff --git a/lib/SNMP/Info/Layer3/NetSNMP.pm b/lib/SNMP/Info/Layer3/NetSNMP.pm index 5e32da6b..f4924c47 100644 --- a/lib/SNMP/Info/Layer3/NetSNMP.pm +++ b/lib/SNMP/Info/Layer3/NetSNMP.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::NetSNMP -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,11 +30,11 @@ package SNMP::Info::Layer3::NetSNMP; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::NetSNMP::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::NetSNMP::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::NetSNMP::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -44,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, 'UCD-SNMP-MIB' => 'versionTag', 'NET-SNMP-TC' => 'netSnmpAliasDomain', 'HOST-RESOURCES-MIB' => 'hrSystem', @@ -52,19 +50,16 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, 'netsnmp_vers' => 'versionTag', 'hrSystemUptime' => 'hrSystemUptime', ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); sub vendor { @@ -182,8 +177,6 @@ Subclass for Generic Net-SNMP devices See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -221,10 +214,6 @@ Returns ''. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE ENTRIES These are methods that return tables of information in the form of a reference @@ -246,10 +235,6 @@ Ignores loopback See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 NOTES In order to cause SNMP::Info to classify your device into this class, it diff --git a/lib/SNMP/Info/Layer3/Netscreen.pm b/lib/SNMP/Info/Layer3/Netscreen.pm index 2c23f406..b8cfd28a 100644 --- a/lib/SNMP/Info/Layer3/Netscreen.pm +++ b/lib/SNMP/Info/Layer3/Netscreen.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::Netscreen; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::IEEE802dot11; @@ -537,12 +538,7 @@ Kent Hamilton =head1 DESCRIPTION Provides abstraction to the configuration information obtainable from a -Juniper Netscreen devices 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 $netscreen = new SNMP::Info::Layer3::Netscreen(...); +Juniper Netscreen device through SNMP. =head2 Inherited Classes diff --git a/lib/SNMP/Info/Layer3/Nexus.pm b/lib/SNMP/Info/Layer3/Nexus.pm index 1bc84808..07880125 100644 --- a/lib/SNMP/Info/Layer3/Nexus.pm +++ b/lib/SNMP/Info/Layer3/Nexus.pm @@ -55,7 +55,7 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::CiscoSwitch::MIBS, 'CISCO-ENTITY-VENDORTYPE-OID-MIB' => 'cevMIBObjects', - 'CISCO-CONTEXT-MAPPING-MIB' => 'cContextMappingMIBObjects', + 'CISCO-CONTEXT-MAPPING-MIB' => 'cContextMappingMIBObjects', ); %GLOBALS = ( diff --git a/lib/SNMP/Info/Layer3/OneAccess.pm b/lib/SNMP/Info/Layer3/OneAccess.pm index ff9133b5..7da549ca 100644 --- a/lib/SNMP/Info/Layer3/OneAccess.pm +++ b/lib/SNMP/Info/Layer3/OneAccess.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::OneAccess; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -67,7 +68,7 @@ $VERSION = '3.68'; # notes: # duplex: oneos v5 has dot3StatsDuplexStatus but it always seems to # return 0 so useless. oneos v6 no longer has any info. -# macsuck: bridge-mib and oneaccess mibs didn't return useable data +# macsuck: bridge-mib and oneaccess mibs didn't return usable data # arpnip: oneos v5 returns usable data from ip-mib & rfc1213 which is # usable, both version support ip-forward-mib but this does not by # itself provide enough data to be usable. v6 even fails for the diff --git a/lib/SNMP/Info/Layer3/PacketFront.pm b/lib/SNMP/Info/Layer3/PacketFront.pm index 4e787148..51de008f 100644 --- a/lib/SNMP/Info/Layer3/PacketFront.pm +++ b/lib/SNMP/Info/Layer3/PacketFront.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::PacketFront -# $Id$ # # Copyright (c) 2011 Jeroen van Ingen # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::PacketFront; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -112,7 +112,7 @@ sub layers { my $pfront = shift; my $layers = $pfront->SUPER::layers(); - # Some models or softwware versions don't report L2 properly + # Some models or software versions don't report L2 properly # so add L2 capability to the output if the device has bridge ports. my $bports = $pfront->b_ports(); diff --git a/lib/SNMP/Info/Layer3/PaloAlto.pm b/lib/SNMP/Info/Layer3/PaloAlto.pm index 6ff7f54e..559eda1f 100644 --- a/lib/SNMP/Info/Layer3/PaloAlto.pm +++ b/lib/SNMP/Info/Layer3/PaloAlto.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::PaloAlto; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -52,7 +53,7 @@ $VERSION = '3.68'; # Oids from PAN-COMMON-MIB. 'os_ver' => 'panSysSwVersion', 'serial1' => 'panSysSerialNumber', - 'pa_model' => 'panChassisType' + 'pa_model' => 'panChassisType', ); %FUNCS = ( @@ -64,7 +65,7 @@ $VERSION = '3.68'; ); sub vendor { - return 'Palo Alto Networks'; + return 'palo alto networks'; } sub model { @@ -142,11 +143,11 @@ These are methods that return scalar value from SNMP =item $pa->vendor() -Returns C<'Palo Alto Networks'>. +Returns C<'palo alto networks'>. =item $pa->os() -Returns C<'PANOS'>. +Returns C<'PAN-OS'>. =item $pa->model() diff --git a/lib/SNMP/Info/Layer3/Passport.pm b/lib/SNMP/Info/Layer3/Passport.pm index 90ca8781..c49db847 100644 --- a/lib/SNMP/Info/Layer3/Passport.pm +++ b/lib/SNMP/Info/Layer3/Passport.pm @@ -713,7 +713,7 @@ sub e_index { my $model = $passport->model(); my $rc_ps_t = $passport->rc_ps_type() || {}; - # We're going to hack an index: Slot/Mda/Postion + # We're going to hack an index: Slot/Mda/Position # We're going to put chassis and power supplies in a slot # which doesn't exist my %rc_e_index; diff --git a/lib/SNMP/Info/Layer3/Pf.pm b/lib/SNMP/Info/Layer3/Pf.pm index 60631a28..2b53e08a 100644 --- a/lib/SNMP/Info/Layer3/Pf.pm +++ b/lib/SNMP/Info/Layer3/Pf.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Pf -# $Id$ # # Copyright (c) 2010 Max Baker # All rights reserved. @@ -31,12 +30,11 @@ package SNMP::Info::Layer3::Pf; use strict; +use warnings; use Exporter; - use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Pf::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::Pf::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Pf::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -45,7 +43,6 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, # Enterprise container where BEGEMOT-* lives 'FOKUS-MIB' => 'fokus', # MIBs used included in Layer3 and above: @@ -72,21 +69,18 @@ $VERSION = '3.68'; %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); sub vendor { - return 'FreeBSD'; + return 'freebsd'; } sub model { @@ -148,7 +142,7 @@ Max Baker =head1 DESCRIPTION -Subclass for Free-BSD PF-Based devices +Subclass for FreeBSD PF-Based devices =head1 LLDP Support @@ -166,8 +160,6 @@ Net-SNMP or not. =item SNMP::Info::Layer3 -=item SNMP::Info::LLDP - =back =head2 Required MIBs @@ -180,8 +172,6 @@ Net-SNMP or not. See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -192,7 +182,7 @@ These are methods that return scalar values from SNMP =item $pf->vendor() - Returns 'FreeBSD' +Returns 'freebsd' =item $pf->model() @@ -223,8 +213,4 @@ to a hash. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/Pica8.pm b/lib/SNMP/Info/Layer3/Pica8.pm index cbf73d94..10df1261 100644 --- a/lib/SNMP/Info/Layer3/Pica8.pm +++ b/lib/SNMP/Info/Layer3/Pica8.pm @@ -30,11 +30,11 @@ package SNMP::Info::Layer3::Pica8; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; -use SNMP::Info::LLDP; -@SNMP::Info::Layer3::Pica8::ISA = qw/SNMP::Info::LLDP SNMP::Info::Layer3 Exporter/; +@SNMP::Info::Layer3::Pica8::ISA = qw/SNMP::Info::Layer3 Exporter/; @SNMP::Info::Layer3::Pica8::EXPORT_OK = qw//; our ($VERSION, %GLOBALS, %MIBS, %FUNCS, %MUNGE); @@ -43,26 +43,22 @@ $VERSION = '3.68'; %MIBS = ( %SNMP::Info::Layer3::MIBS, - %SNMP::Info::LLDP::MIBS, ); %GLOBALS = ( %SNMP::Info::Layer3::GLOBALS, - %SNMP::Info::LLDP::GLOBALS, ); %FUNCS = ( %SNMP::Info::Layer3::FUNCS, - %SNMP::Info::LLDP::FUNCS, ); %MUNGE = ( %SNMP::Info::Layer3::MUNGE, - %SNMP::Info::LLDP::MUNGE, ); sub vendor { - return 'Pica8'; + return 'pica8'; } sub os { @@ -77,7 +73,9 @@ sub os_ver { my $pica8 = shift; my $descr = $pica8->description(); - return $1 if ( $descr =~ /Software version ([\d\.]+)/i ); + if (defined ($descr)) { + return $1 if ($descr =~ /Software version ([\d\.]+)/i); + } return; } @@ -85,7 +83,9 @@ sub model { my $pica8 = shift; my $descr = $pica8->description(); - return $1 if ( $descr =~ /Hardware model (P-\d{4})/i ); + if (defined $descr) { + return $1 if ($descr =~ /Hardware model (P-\d{4})/i); + } return; } @@ -125,8 +125,6 @@ Subclass for Pica8 devices =item SNMP::Info::Layer3 -=item SNMP::Info::LLDP - =back =head2 Required MIBs @@ -139,8 +137,6 @@ Subclass for Pica8 devices See L for its own MIB requirements. -See L for its own MIB requirements. - =back =head1 GLOBALS @@ -151,7 +147,7 @@ These are methods that return scalar value from SNMP =item $pica8->vendor() -Returns 'Pica8' +Returns 'pica8' =item $pica8->model() @@ -171,10 +167,6 @@ Returns the OS version extracted from C. See documentation in L for details. -=head2 Globals imported from SNMP::Info::LLDP - -See documentation in L for details. - =head1 TABLE ENTRIES These are methods that return tables of information in the form of a reference @@ -184,8 +176,4 @@ to a hash. See documentation in L for details. -=head2 Table Methods imported from SNMP::Info::LLDP - -See documentation in L for details. - =cut diff --git a/lib/SNMP/Info/Layer3/SonicWALL.pm b/lib/SNMP/Info/Layer3/SonicWALL.pm index 09619175..a97704a7 100644 --- a/lib/SNMP/Info/Layer3/SonicWALL.pm +++ b/lib/SNMP/Info/Layer3/SonicWALL.pm @@ -28,6 +28,7 @@ package SNMP::Info::Layer3::SonicWALL; # POSSIBILITY OF SUCH DAMAGE. use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -56,7 +57,7 @@ $VERSION = '3.68'; %MUNGE = ( %SNMP::Info::Layer2::MUNGE, %SNMP::Info::Layer3::MUNGE, ); sub vendor { - return 'SonicWALL'; + return 'sonicwall'; } sub os { @@ -107,7 +108,7 @@ phishphreek@gmail.com Debug => 1, DestHost => 'myrouter', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -130,6 +131,8 @@ Subclass for Generic SonicWALL Firewalls =over +=item F + =item Inherited Classes' MIBs See L for its own MIB requirements. @@ -146,7 +149,7 @@ These are methods that return scalar value from SNMP =item $router->vendor() -Returns C<'SonicWALL'> +Returns C<'sonicwall'> =item $router->os() @@ -154,11 +157,11 @@ Returns C<'SonicOS'> =item $router->os_ver() -Returns '4.2.0.0-10e' +Returns C<'snwlSysFirmwareVersion'> =item $router->model() -Returns C<'PRO 3060 Enhanced'> +Returns C<'snwlSysModel'> =item $router->serial() diff --git a/lib/SNMP/Info/Layer3/Steelhead.pm b/lib/SNMP/Info/Layer3/Steelhead.pm index a97931ef..d16cd05f 100644 --- a/lib/SNMP/Info/Layer3/Steelhead.pm +++ b/lib/SNMP/Info/Layer3/Steelhead.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::Steelhead; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; @@ -132,10 +133,6 @@ Eric Miller Abstraction subclass for Riverbed Steelhead WAN optimization appliances. -For speed or debugging purposes you can call the subclass directly, but not -after determining a more specific class using the method above. - - my $riverbed = new SNMP::Info::Layer3::Steelhead(...); =head2 Inherited Classes diff --git a/lib/SNMP/Info/Layer3/Sun.pm b/lib/SNMP/Info/Layer3/Sun.pm index 8f56b0c1..02666b15 100644 --- a/lib/SNMP/Info/Layer3/Sun.pm +++ b/lib/SNMP/Info/Layer3/Sun.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Sun -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::Layer3::Sun; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; diff --git a/lib/SNMP/Info/Layer3/Tasman.pm b/lib/SNMP/Info/Layer3/Tasman.pm index 7f6b520a..e80229bf 100644 --- a/lib/SNMP/Info/Layer3/Tasman.pm +++ b/lib/SNMP/Info/Layer3/Tasman.pm @@ -102,7 +102,7 @@ my $module_map = { DS3_1C => '1-port Channelized T3', WTE_1 => '1-port T1/E1 w DS0 and DS1 support for both TDM and Packet', WTE_2S => '2-port Sync and Async Serial', - WTE_8 => '8-port T1/E1' + WTE_8 => '8-port T1/E1', }; sub vendor { diff --git a/lib/SNMP/Info/Layer3/Timetra.pm b/lib/SNMP/Info/Layer3/Timetra.pm index 3e3cb5a0..39f8be0d 100644 --- a/lib/SNMP/Info/Layer3/Timetra.pm +++ b/lib/SNMP/Info/Layer3/Timetra.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer3::Timetra -# $Id$ # # Copyright (c) 2008 Bill Fenner # @@ -30,7 +29,7 @@ package SNMP::Info::Layer3::Timetra; use strict; - +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::Aggregate; @@ -120,7 +119,7 @@ sub model { my $str; - if ( $descr =~ /\s+(7\d{3})/ ) { + if ( defined ($descr) && $descr =~ /\s+(7\d{3})/ ) { $str = $1; } @@ -146,7 +145,7 @@ sub os_ver { my $timetra = shift; my $descr = $timetra->description(); - if ( $descr =~ m/^TiMOS-(\S+)/x ) { + if ( defined ($descr) && $descr =~ m/^TiMOS-(\S+)/x ) { return $1; } return; @@ -454,7 +453,7 @@ These are methods that return scalar value from SNMP =item $alu->vendor() -Returns 'alcatel-lucent' +Returns 'nokia' =item $alu->os() diff --git a/lib/SNMP/Info/Layer3/VMware.pm b/lib/SNMP/Info/Layer3/VMware.pm index 138e226c..1499244d 100644 --- a/lib/SNMP/Info/Layer3/VMware.pm +++ b/lib/SNMP/Info/Layer3/VMware.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer3::VMware; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; use SNMP::Info::IEEE802dot3ad 'agg_ports_lag'; @@ -167,7 +168,6 @@ Returns the software version specified as major-update.patch.build (ex. 5.1.0-3 (C)-(C).(C).(C) - =back =head2 Globals imported from SNMP::Info::Layer3 diff --git a/lib/SNMP/Info/Layer3/VyOS.pm b/lib/SNMP/Info/Layer3/VyOS.pm index 42bc25cd..dfe2bad5 100644 --- a/lib/SNMP/Info/Layer3/VyOS.pm +++ b/lib/SNMP/Info/Layer3/VyOS.pm @@ -31,6 +31,7 @@ package SNMP::Info::Layer3::VyOS; use strict; +use warnings; use Exporter; use SNMP::Info::Layer3; diff --git a/lib/SNMP/Info/Layer7.pm b/lib/SNMP/Info/Layer7.pm index 86ea6a12..94a4ac1d 100644 --- a/lib/SNMP/Info/Layer7.pm +++ b/lib/SNMP/Info/Layer7.pm @@ -31,6 +31,7 @@ package SNMP::Info::Layer7; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -116,7 +117,7 @@ Jeroen van Ingen Debug => 1, DestHost => 'myswitch', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; @@ -165,9 +166,9 @@ after determining a more specific class using the method above. =back -MIBs required for L +MIBs required for L -See L for its MIB requirements. +See L for its MIB requirements. =head1 GLOBALS @@ -190,7 +191,7 @@ C. =head2 Global Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =head1 TABLE METHODS @@ -209,6 +210,6 @@ Returns reference to the map between IID and physical Port. =head2 Table Methods imported from SNMP::Info -See documentation in L for details. +See documentation in L for details. =cut diff --git a/lib/SNMP/Info/Layer7/APC.pm b/lib/SNMP/Info/Layer7/APC.pm index 98efead6..cc3d01e5 100644 --- a/lib/SNMP/Info/Layer7/APC.pm +++ b/lib/SNMP/Info/Layer7/APC.pm @@ -31,6 +31,7 @@ package SNMP::Info::Layer7::APC; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; @@ -133,11 +134,6 @@ Jeroen van Ingen Provides abstraction to the configuration information obtainable from a APC UPS via 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 $apc = new SNMP::Info::Layer7::APC(...); - =head2 Inherited Classes =over diff --git a/lib/SNMP/Info/Layer7/Arbor.pm b/lib/SNMP/Info/Layer7/Arbor.pm index 02f3b1db..e59bee0e 100644 --- a/lib/SNMP/Info/Layer7/Arbor.pm +++ b/lib/SNMP/Info/Layer7/Arbor.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer7::Arbor; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; @@ -153,11 +154,11 @@ These are methods that return scalar value from SNMP =item $Arbor->vendor() -Returns 'Arbor'. +Returns 'arbor'. =item $Arbor->os() -Returns 'arbos'. +Returns 'ArbOS'. =item $Arbor->os_ver() diff --git a/lib/SNMP/Info/Layer7/CiscoIPS.pm b/lib/SNMP/Info/Layer7/CiscoIPS.pm index 8439599a..3f541055 100644 --- a/lib/SNMP/Info/Layer7/CiscoIPS.pm +++ b/lib/SNMP/Info/Layer7/CiscoIPS.pm @@ -1,5 +1,4 @@ # SNMP::Info::Layer7::CiscoIPS -# $Id$ # # Copyright (c) 2013 Moe Kraus # All rights reserved. @@ -213,7 +212,7 @@ Returns model name =item $info->productname -Retruns the product name +Returns the product name =item $info->serial diff --git a/lib/SNMP/Info/Layer7/Gigamon.pm b/lib/SNMP/Info/Layer7/Gigamon.pm index 4c0afd39..b153d4be 100644 --- a/lib/SNMP/Info/Layer7/Gigamon.pm +++ b/lib/SNMP/Info/Layer7/Gigamon.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer7::Gigamon; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; diff --git a/lib/SNMP/Info/Layer7/Liebert.pm b/lib/SNMP/Info/Layer7/Liebert.pm index 2391a0fb..f01899d1 100644 --- a/lib/SNMP/Info/Layer7/Liebert.pm +++ b/lib/SNMP/Info/Layer7/Liebert.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer7::Liebert; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; @@ -90,7 +91,7 @@ Netdisco Developers Debug => 1, DestHost => 'myhub', Community => 'public', - Version => 1 + Version => 2 ) or die "Can't connect to DestHost.\n"; diff --git a/lib/SNMP/Info/Layer7/Neoteris.pm b/lib/SNMP/Info/Layer7/Neoteris.pm index f1a6ee6f..eb1683aa 100644 --- a/lib/SNMP/Info/Layer7/Neoteris.pm +++ b/lib/SNMP/Info/Layer7/Neoteris.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer7::Neoteris; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; diff --git a/lib/SNMP/Info/Layer7/Netscaler.pm b/lib/SNMP/Info/Layer7/Netscaler.pm index 624c00d6..2b2436c5 100644 --- a/lib/SNMP/Info/Layer7/Netscaler.pm +++ b/lib/SNMP/Info/Layer7/Netscaler.pm @@ -30,6 +30,7 @@ package SNMP::Info::Layer7::Netscaler; use strict; +use warnings; use Exporter; use SNMP::Info::Layer7; diff --git a/lib/SNMP/Info/MAU.pm b/lib/SNMP/Info/MAU.pm index 55fd7caa..29621de2 100644 --- a/lib/SNMP/Info/MAU.pm +++ b/lib/SNMP/Info/MAU.pm @@ -1,5 +1,4 @@ # SNMP::Info::MAU - Medium Attachment Unit - RFC 2668 -# $Id$ # # Copyright (c) 2008 Max Baker changes from version 0.8 and beyond. # @@ -33,6 +32,7 @@ package SNMP::Info::MAU; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -420,7 +420,7 @@ sub mau_set_i_speed_duplex_admin { return ("bad arguments"); } - # map input speed and duplex paramters to 'mau_type_admin' settings + # map input speed and duplex parameters to 'mau_type_admin' settings # From IANA-MAU-MIB # 11 = dot3MauType10BaseTFD, 10 = dot3MauType10BaseTHD, # 16 = dot3MauType100BaseTXFD, 15 = dot3MauType100BaseTXHD @@ -475,7 +475,7 @@ Max Baker SNMP::Info::MAU is a subclass of SNMP::Info that supplies access to the F (RFC 2668). This MIB is sometimes implemented on Layer 2 network -devices like HP Switches. MAU = Medium Attachment Unit. +devices. MAU = Medium Attachment Unit. The MAU table contains link and duplex info for the port itself and the device connected to that port. @@ -497,6 +497,8 @@ None. =item F +=item F + =back =head1 GLOBALS diff --git a/lib/SNMP/Info/NortelStack.pm b/lib/SNMP/Info/NortelStack.pm index d20f2bd8..d6fd05e3 100644 --- a/lib/SNMP/Info/NortelStack.pm +++ b/lib/SNMP/Info/NortelStack.pm @@ -1,5 +1,4 @@ # SNMP::Info::NortelStack -# $Id$ # # Copyright (c) 2008 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::NortelStack; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -597,7 +597,7 @@ None. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/PowerEthernet.pm b/lib/SNMP/Info/PowerEthernet.pm index c5228a4a..7059c0ad 100644 --- a/lib/SNMP/Info/PowerEthernet.pm +++ b/lib/SNMP/Info/PowerEthernet.pm @@ -1,5 +1,4 @@ # SNMP::Info::PowerEthernet -# $Id$ # # Copyright (c) 2008 Bill Fenner # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::PowerEthernet; use strict; +use warnings; use Exporter; use SNMP::Info; diff --git a/lib/SNMP/Info/RapidCity.pm b/lib/SNMP/Info/RapidCity.pm index f681ead3..e3e89a41 100644 --- a/lib/SNMP/Info/RapidCity.pm +++ b/lib/SNMP/Info/RapidCity.pm @@ -1,5 +1,4 @@ # SNMP::Info::RapidCity -# $Id$ # # Copyright (c) 2014 Eric Miller # All rights reserved. @@ -31,6 +30,7 @@ package SNMP::Info::RapidCity; use strict; +use warnings; use Exporter; use SNMP::Info; @@ -914,11 +914,15 @@ None. =over -=item RAPID-CITY +=item F + +=item F + +=item F =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/lib/SNMP/Info/SONMP.pm b/lib/SNMP/Info/SONMP.pm index bcdeae0d..47fe9544 100644 --- a/lib/SNMP/Info/SONMP.pm +++ b/lib/SNMP/Info/SONMP.pm @@ -70,7 +70,7 @@ $VERSION = '3.68'; %MUNGE = ( 'sonmp_topo_mac' => \&SNMP::Info::munge_mac, - 'sonmp_topo_e_mac' => \&SNMP::Info::munge_mac + 'sonmp_topo_e_mac' => \&SNMP::Info::munge_mac, ); sub index_factor { @@ -120,7 +120,7 @@ sub sonmp_if { || $sonmp->sonmp_topo_e_platform($partial) || {}; my $interfaces = $sonmp->interfaces() || {}; - my %r_interfaces = reverse %$interfaces; + my %r_interfaces = reverse %$interfaces; my $index_factor = $sonmp->index_factor(); my $slot_offset = $sonmp->slot_offset(); my $port_offset = $sonmp->port_offset(); @@ -305,8 +305,8 @@ Eric Miller $hassonmp = $sonmp->hasSONMP() ? 'yes' : 'no'; - # Print out a map of device ports with CDP neighbors: - my $interfaces = $sonmp->interfaces(); + # Print out a map of device ports with SONMP neighbors: + my $interfaces = $sonmp->interfaces(); my $sonmp_if = $sonmp->sonmp_if(); my $sonmp_ip = $sonmp->sonmp_ip(); my $sonmp_port = $sonmp->sonmp_port(); @@ -351,7 +351,7 @@ None. =back -=head1 GLOBAL METHODS +=head1 GLOBALS These are methods that return scalar values from SNMP diff --git a/t/00_load.t b/t/00_load.t index a19392c8..4bac7083 100644 --- a/t/00_load.t +++ b/t/00_load.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00-load.t - Test loading of SNMP::Info -# $Id$ use strict; use warnings; diff --git a/xt/00_local_distribution.t b/xt/00_local_distribution.t index baf01576..9b92820b 100644 --- a/xt/00_local_distribution.t +++ b/xt/00_local_distribution.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00_local_distribution.t - Private test to check distribution -# $Id$ use strict; use warnings; diff --git a/xt/00_local_docininfo.t b/xt/00_local_docininfo.t index c73185fc..33c23a7a 100644 --- a/xt/00_local_docininfo.t +++ b/xt/00_local_docininfo.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00_local_versionsync.t - Private test to check that all modules are listed in Info.pm -# $Id$ use warnings; use strict; diff --git a/xt/00_local_perlcritic.t b/xt/00_local_perlcritic.t index bcb45b5d..4c0b1528 100644 --- a/xt/00_local_perlcritic.t +++ b/xt/00_local_perlcritic.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00_local_perlcritic.t - Test file for PBP compliance for SNMP::Info -# $Id$ use strict; use warnings; diff --git a/xt/00_local_pod-coverage.t b/xt/00_local_pod-coverage.t index 16cf6cb4..a63f424d 100644 --- a/xt/00_local_pod-coverage.t +++ b/xt/00_local_pod-coverage.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # pod-coverage.t - Test to check POD coverage of SNMP::Info -# $Id$ use strict; use warnings; diff --git a/xt/00_local_pod.t b/xt/00_local_pod.t index a13940f3..61bcfe88 100644 --- a/xt/00_local_pod.t +++ b/xt/00_local_pod.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # pod.t - Test to check for POD errors in SNMP::Info -# $Id$ use strict; use warnings; diff --git a/xt/00_local_prereq.t b/xt/00_local_prereq.t index aedff23a..e88da04b 100644 --- a/xt/00_local_prereq.t +++ b/xt/00_local_prereq.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # prereq.t - Test file for prerequesites for SNMP::Info -# $Id$ use strict; use warnings; diff --git a/xt/00_local_spelling.t b/xt/00_local_spelling.t index 3f645ad5..1cd6e5bc 100644 --- a/xt/00_local_spelling.t +++ b/xt/00_local_spelling.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00_local_spelling.t - Private test to spell check documentation -# $Id$ use warnings; use strict; diff --git a/xt/00_local_versionsync.t b/xt/00_local_versionsync.t index 2c6d6769..6262cf3d 100644 --- a/xt/00_local_versionsync.t +++ b/xt/00_local_versionsync.t @@ -1,6 +1,5 @@ #!/usr/bin/env perl # 00_local_versionsync.t - Private test to check all version numbers match -# $Id$ use warnings; use strict; diff --git a/xt/lib/My/Test/Class.pm b/xt/lib/My/Test/Class.pm index 8a46d11c..3eebeeee 100644 --- a/xt/lib/My/Test/Class.pm +++ b/xt/lib/My/Test/Class.pm @@ -29,6 +29,8 @@ package My::Test::Class; +use strict; +use warnings; use Test::Class::Most attributes => [qw/class mock_session todo_methods/]; use Test::MockObject::Extends; use File::Find 'find'; @@ -36,7 +38,7 @@ use Path::Class 'dir'; use File::Slurper 'read_lines'; use Class::Inspector; -use base qw; +use base qw/Test::Class Class::Data::Inheritable/; # Don't run the base tests defined in this class, run them in subclasses only My::Test::Class->SKIP_CLASS(1); diff --git a/xt/lib/Test/SNMP/Info.pm b/xt/lib/Test/SNMP/Info.pm index fd527b49..e612c63c 100644 --- a/xt/lib/Test/SNMP/Info.pm +++ b/xt/lib/Test/SNMP/Info.pm @@ -29,6 +29,8 @@ package Test::SNMP::Info; +use strict; +use warnings; use Test::Class::Most parent => 'My::Test::Class'; use SNMP::Info; diff --git a/xt/lib/Test/SNMP/Info/Layer2/3Com.pm b/xt/lib/Test/SNMP/Info/Layer2/3Com.pm index 57f5d125..d2e24947 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/3Com.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/3Com.pm @@ -83,7 +83,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), '3Com', q(Vendor returns '3Com')); + is($test->{info}->vendor(), '3com', q(Vendor returns '3com')); } sub model : Tests(3) { diff --git a/xt/lib/Test/SNMP/Info/Layer2/Aironet.pm b/xt/lib/Test/SNMP/Info/Layer2/Aironet.pm index c2822e2d..27ce73b7 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/Aironet.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/Aironet.pm @@ -122,7 +122,6 @@ sub description : Tests(4) { $test->{info}{_description} = undef; $expected = 'Cisco Aironet 1240 Series (IEEE 802.11a/g) Access Point'; - $expected .= ' '; is($test->{info}->description(), $expected, q(Description is expected value just using Entity MIB)); $test->{info}->clear_cache(); diff --git a/xt/lib/Test/SNMP/Info/Layer2/Kentrox.pm b/xt/lib/Test/SNMP/Info/Layer2/Kentrox.pm index 36f084d4..f391648e 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/Kentrox.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/Kentrox.pm @@ -52,7 +52,7 @@ sub os : Tests(2) { my $test = shift; can_ok($test->{info}, 'os'); - is($test->{info}->os(), 'Kentrox', q(OS returns 'Kentrox')); + is($test->{info}->os(), 'kentrox', q(OS returns 'kentrox')); } sub os_ver : Tests(3) { @@ -80,7 +80,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Kentrox', q(Vendor returns 'Kentrox')); + is($test->{info}->vendor(), 'kentrox', q(Vendor returns 'kentrox')); } sub model : Tests(3) { diff --git a/xt/lib/Test/SNMP/Info/Layer2/Ubiquiti.pm b/xt/lib/Test/SNMP/Info/Layer2/Ubiquiti.pm index f9564c9f..c3c037ea 100644 --- a/xt/lib/Test/SNMP/Info/Layer2/Ubiquiti.pm +++ b/xt/lib/Test/SNMP/Info/Layer2/Ubiquiti.pm @@ -61,8 +61,8 @@ sub vendor : Tests(2) { can_ok($test->{info}, 'vendor'); is( $test->{info}->vendor(), - 'Ubiquiti Networks, Inc.', - q(Vendor returns 'Ubiquiti Networks, Inc.') + 'ubiquiti', + q(Vendor returns 'ubiquiti') ); } diff --git a/xt/lib/Test/SNMP/Info/Layer3/BlueCoatSG.pm b/xt/lib/Test/SNMP/Info/Layer3/BlueCoatSG.pm index 8c114859..1e7bb614 100644 --- a/xt/lib/Test/SNMP/Info/Layer3/BlueCoatSG.pm +++ b/xt/lib/Test/SNMP/Info/Layer3/BlueCoatSG.pm @@ -63,7 +63,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Blue Coat', q(Vendor returns 'Blue Coat')); + is($test->{info}->vendor(), 'bluecoat', q(Vendor returns 'bluecoat')); } sub model : Tests(2) { diff --git a/xt/lib/Test/SNMP/Info/Layer3/Cumulus.pm b/xt/lib/Test/SNMP/Info/Layer3/Cumulus.pm index ac5b8a26..b9fa69c1 100644 --- a/xt/lib/Test/SNMP/Info/Layer3/Cumulus.pm +++ b/xt/lib/Test/SNMP/Info/Layer3/Cumulus.pm @@ -62,7 +62,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Cumulus Networks', q(Vendor returns 'Cumulus Networks')); + is($test->{info}->vendor(), 'cumulus networks', q(Vendor returns 'cumulus networks')); } sub os : Tests(2) { diff --git a/xt/lib/Test/SNMP/Info/Layer3/ERX.pm b/xt/lib/Test/SNMP/Info/Layer3/ERX.pm index 7372fe11..f28dfb3b 100644 --- a/xt/lib/Test/SNMP/Info/Layer3/ERX.pm +++ b/xt/lib/Test/SNMP/Info/Layer3/ERX.pm @@ -77,7 +77,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Juniper', q(Vendor returns 'Juniper')); + is($test->{info}->vendor(), 'juniper', q(Vendor returns 'juniper')); } sub model : Tests(3) { diff --git a/xt/lib/Test/SNMP/Info/Layer3/Huawei.pm b/xt/lib/Test/SNMP/Info/Layer3/Huawei.pm index 9780e0fe..347a7ad9 100644 --- a/xt/lib/Test/SNMP/Info/Layer3/Huawei.pm +++ b/xt/lib/Test/SNMP/Info/Layer3/Huawei.pm @@ -117,7 +117,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Huawei', q(Vendor returns 'Huawei')); + is($test->{info}->vendor(), 'huawei', q(Vendor returns 'huawei')); } sub os : Tests(3) { diff --git a/xt/lib/Test/SNMP/Info/Layer3/Pica8.pm b/xt/lib/Test/SNMP/Info/Layer3/Pica8.pm index 9fe63377..2eb9be8d 100644 --- a/xt/lib/Test/SNMP/Info/Layer3/Pica8.pm +++ b/xt/lib/Test/SNMP/Info/Layer3/Pica8.pm @@ -62,7 +62,7 @@ sub vendor : Tests(2) { my $test = shift; can_ok($test->{info}, 'vendor'); - is($test->{info}->vendor(), 'Pica8', q(Vendor returns 'Pica8')); + is($test->{info}->vendor(), 'pica8', q(Vendor returns 'pica8')); } sub model : Tests(3) {