diff --git a/Info/CDP.pm b/Info/CDP.pm index 24976c52..c9f3de0b 100644 --- a/Info/CDP.pm +++ b/Info/CDP.pm @@ -1,5 +1,5 @@ # SNMP::Info::CDP -# Max Baker +# Max Baker # # Changes since Version 0.7 Copyright (c) 2004 Max Baker # All rights reserved. @@ -31,7 +31,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CDP; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -43,15 +43,11 @@ use Carp; @SNMP::Info::CDP::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::CDP::EXPORT_OK = qw//; -use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MIBS_V1 %MUNGE $INIT/; -# Debug -$DEBUG=0; -$SNMP::debugging=$DEBUG; +use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/; # Five data structures required by SNMP::Info -$INIT = 0; %MIBS = ( 'CISCO-CDP-MIB' => 'cdpGlobalRun' ); -%MIBS_V1 = ( 'CISCO-CDP-MIB-V1SMI' => 'cdpGlobalRun' ); + # Notice we dont inherit the default GLOBALS and FUNCS # only the default MUNGE. %GLOBALS = ( @@ -130,7 +126,7 @@ sub c_if { my $c_ip = $cdp->c_ip(); unless (defined $c_ip){ $cdp->{error} = "SNMP::Info::CDP::c_if() - Device doesn't have c_ip() data. Can't fake c_index()"; - $DEBUG and carp($cdp->error(1)); + carp($cdp->error(1)) if $cdp->debug(); return undef; } @@ -155,7 +151,7 @@ SNMP::Info::CDP - Perl5 Interface to Cisco Discovery Protocol (CDP) using SNMP =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/CiscoStack.pm b/Info/CiscoStack.pm index f1775d4b..a6d761cd 100644 --- a/Info/CiscoStack.pm +++ b/Info/CiscoStack.pm @@ -1,5 +1,5 @@ # SNMP::Info::CiscoStack -# Max Baker +# Max Baker # # Copyright (c)2003,2004 Max Baker # All rights reserved. @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CiscoStack; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -40,10 +40,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE %PORTSTAT $INIT/; @SNMP::Info::CiscoStack::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::CiscoStack::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -$INIT = 0; %MIBS = ( 'CISCO-STACK-MIB' => 'ciscoStackMIB', 'CISCO-PORT-SECURITY-MIB' => 'ciscoPortSecurityMIB', @@ -269,7 +265,7 @@ SNMP::Info::CiscoStack - Intefaces to data from CISCO-STACK-MIB and CISCO-PORT-S =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/CiscoStats.pm b/Info/CiscoStats.pm index e1bdd7be..b1a698df 100644 --- a/Info/CiscoStats.pm +++ b/Info/CiscoStats.pm @@ -1,5 +1,5 @@ # SNMP::Info::CiscoStats -# Max Baker +# Max Baker # # Changes since Version 0.7 Copyright (c) 2004 Max Baker # All rights reserved. @@ -31,7 +31,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CiscoStats; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -43,10 +43,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/; @SNMP::Info::CiscoStats::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::CiscoStats::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -$INIT = 0; %MIBS = ( 'RFC1213-MIB' => 'sysDescr', 'CISCO-PROCESS-MIB' => 'cpmCPUTotal5sec', @@ -150,7 +146,7 @@ SNMP::Info::CiscoStats - Perl5 Interface to CPU and Memory stats for Cisco Devic =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS @@ -191,6 +187,12 @@ none. =item RFC1213-MIB +=item OLD-CISCO-SYSTEM-MIB + +=item CISCO-STACK-MIB + +=item CISCO-ENTITY-VENDORTYPE-OID-MIB + =back MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz diff --git a/Info/CiscoVTP.pm b/Info/CiscoVTP.pm index 13731c29..88ffe4b6 100644 --- a/Info/CiscoVTP.pm +++ b/Info/CiscoVTP.pm @@ -1,5 +1,5 @@ # SNMP::Info::CiscoVTP -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker changes from version 0.8 and beyond. # @@ -30,7 +30,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::CiscoVTP; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -42,10 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/; @SNMP::Info::CiscoVTP::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::CiscoVTP::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -$INIT = 0; %MIBS = ( 'CISCO-VTP-MIB' => 'vtpVlanName', 'CISCO-VLAN-MEMBERSHIP-MIB' => 'vmMembershipEntry', @@ -106,11 +102,12 @@ $INIT = 0; # CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB 'v_cvi_if' => 'cviRoutedVlanIfIndex', + # vlanTrunkPortTable + # TODO Add these tables if someone wants them.. # vtpEditControlTable # vtpVlanEditTable # vtpStatsTable - # vlanTrunkPortTable ); %MUNGE = ( @@ -150,7 +147,7 @@ SNMP::Info::CiscoVTP - Perl5 Interface to Cisco's VLAN Management MIBs =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/Entity.pm b/Info/Entity.pm index d1ac7367..5fa0e2f0 100644 --- a/Info/Entity.pm +++ b/Info/Entity.pm @@ -1,5 +1,5 @@ # SNMP::Info::Entity -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker changes from version 0.8 and beyond. # @@ -42,7 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/; @SNMP::Info::Entity::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::Entity::EXPORT_OK = qw//; -$INIT = 0; %MIBS = ('ENTITY-MIB' => 'entPhysicalSerialNum'); %GLOBALS = ( @@ -93,11 +92,11 @@ sub e_port { =head1 NAME -SNMP::Info::Entity - Perl5 Interface to SNMP data stored in ENTITY-MIB. +SNMP::Info::Entity - Perl5 Interface to SNMP data stored in ENTITY-MIB. RFC 2737 =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS @@ -117,7 +116,9 @@ Max Baker (C) =head1 DESCRIPTION -ENTITY-MIB is used by some Layer 2 devices like HP Switches and Aironet Access Points +ENTITY-MIB is used by Layer 2 devices from HP,Aironet,Foundry,Cisco and more. + +See RFC 2737 for full details. Create or use a device subclass that inherit this class. Do not use directly. diff --git a/Info/EtherLike.pm b/Info/EtherLike.pm index 458a2312..8e603c93 100644 --- a/Info/EtherLike.pm +++ b/Info/EtherLike.pm @@ -1,5 +1,5 @@ # SNMP::Info::EtherLike -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker changes from version 0.8 and beyond. # @@ -30,7 +30,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::EtherLike; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -42,12 +42,6 @@ use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/; @SNMP::Info::EtherLike::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::EtherLike::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -$INIT = 0; - -# Same info in both rfc1398 and this? %MIBS = ('ETHERLIKE-MIB' => 'etherMIB' ); %GLOBALS = (); @@ -83,11 +77,11 @@ __END__ =head1 NAME -SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB +SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB RFC 1398 =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS @@ -124,6 +118,8 @@ Max Baker (C) SNMP::Info::EtherLike is a subclass of SNMP::Info that supplies access to the ETHERLIKE-MIB used by some Layer 3 Devices such as Cisco routers. +See RFC 1398 for more details. + Use or create a subclass of SNMP::Info that inherits this one. Do not use directly. =head2 Inherited Classes diff --git a/Info/FDP.pm b/Info/FDP.pm index 6b04474e..6fd45670 100644 --- a/Info/FDP.pm +++ b/Info/FDP.pm @@ -32,7 +32,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::FDP; -$VERSION = 0.9; +$VERSION = 1.0; use strict; @@ -44,19 +44,11 @@ use Carp; @SNMP::Info::FDP::EXPORT_OK = qw//; use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/; -# Debug -$DEBUG=1; -$SNMP::debugging=$DEBUG; -# Five data structures required by SNMP::Info -$INIT = 0; %MIBS = ( 'FOUNDRY-SN-SWITCH-GROUP-MIB' => 'snFdpGlobalRun' ); -# Notice we dont inherit the default GLOBALS and FUNCS -# only the default MUNGE. %GLOBALS = ( # CDP-Compatibility - 'cdp_run' => 'snFdpGlobalRun', 'cdp_interval' => 'snFdpGlobalMessageInterval', 'cdp_holdtime' => 'snFdpGlobalHoldTime', 'cdp_id' => 'snFdpGlobalDeviceId', @@ -96,6 +88,16 @@ sub munge_caps { } + +sub cdp_run { + my $fdp = shift; + my $fdp_run = $fdp->fdp_run(); + + # if fdp_run isn't implemented on device, assume FDP is on + return $fdp_run if defined $fdp_run; + return 1; +} + sub hasFDP { my $fdp = shift; @@ -128,7 +130,7 @@ sub c_if { my $fdp_ip = $fdp->c_ip(); unless (defined $fdp_ip){ $fdp->{error} = "SNMP::Info::FDP:fdp_if() - Device doesn't have fdp_ip() data. Can't fake fdp_index()"; - $DEBUG and carp($fdp->error(1)); + carp($fdp->error(1)) if $fdp->debug(); return undef; } @@ -153,7 +155,7 @@ SNMP::Info::FDP - Perl5 Interface to Foundry Discovery Protocol (FDP) using SNMP =head1 AUTHOR -Max Baker (C) +Bruce Rodger, Max Baker =head1 SYNOPSIS diff --git a/Info/Layer1.pm b/Info/Layer1.pm index 556e643e..ffdf16a6 100644 --- a/Info/Layer1.pm +++ b/Info/Layer1.pm @@ -1,5 +1,5 @@ # SNMP::Info::Layer1 - SNMP Interface to Layer1 Devices -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker changes from version 0.8 and beyond. # @@ -30,7 +30,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer1; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -43,13 +43,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/; @SNMP::Info::Layer1::ISA = qw/SNMP::Info Exporter/; @SNMP::Info::Layer1::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -# See SNMP::Info for the details of these data structures and -# the interworkings. -$INIT = 0; - %MIBS = ( %SNMP::Info::MIBS, 'SNMP-REPEATER-MIB' => 'rptrPortGroupIndex' ); @@ -169,7 +162,7 @@ SNMP::Info::Layer1 - Perl5 Interface to network devices serving Layer1 only. =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/Layer2.pm b/Info/Layer2.pm index 38359a01..0f3d4ea8 100644 --- a/Info/Layer2.pm +++ b/Info/Layer2.pm @@ -1,5 +1,5 @@ # SNMP::Info::Layer2 - SNMP Interface to Layer2 Devices -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker -- All changes from Version 0.7 on # @@ -30,7 +30,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer2; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -48,13 +48,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/; SNMP::Info::Entity SNMP::Info::CiscoStats Exporter/; @SNMP::Info::Layer2::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -# See SNMP::Info for the details of these data structures and -# the interworkings. -$INIT = 0; - %MIBS = ( %SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS, %SNMP::Info::CDP::MIBS, @@ -194,7 +187,7 @@ SNMP::Info::Layer2 - Perl5 Interface to network devices serving Layer2 only. =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/Layer3.pm b/Info/Layer3.pm index aaa1d825..ad3558af 100644 --- a/Info/Layer3.pm +++ b/Info/Layer3.pm @@ -1,5 +1,5 @@ # SNMP::Info::Layer3 - SNMP Interface to Layer3 devices -# Max Baker +# Max Baker # # Copyright (c) 2004 Max Baker -- All changes from Version 0.7 on # @@ -30,7 +30,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::Layer3; -$VERSION = 0.9; +$VERSION = 1.0; # $Id$ use strict; @@ -47,11 +47,6 @@ use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/; SNMP::Info::Entity Exporter/; @SNMP::Info::Layer3::EXPORT_OK = qw//; -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -$INIT = 0; - %MIBS = ( %SNMP::Info::MIBS, %SNMP::Info::Bridge::MIBS, %SNMP::Info::EtherLike::MIBS, @@ -107,7 +102,7 @@ sub root_ip { foreach my $key (keys %$ospf_ip){ my $ip = $ospf_ip->{$key}; next if $ip eq '0.0.0.0'; - print " SNMP::Layer3::root_ip() using $ip\n" if $DEBUG; + print " SNMP::Layer3::root_ip() using $ip\n" if $l3->debug(); return $ip; } } @@ -157,7 +152,7 @@ sub model { my $id = $l3->id(); unless (defined $id){ - print " SNMP::Info::Layer3::model() - Device does not support sysObjectID\n" if $DEBUG; + print " SNMP::Info::Layer3::model() - Device does not support sysObjectID\n" if $l3->debug(); return undef; } @@ -245,7 +240,7 @@ SNMP::Info::Layer3 - Perl5 Interface to network devices serving Layer3 or Layers =head1 AUTHOR -Max Baker (C) +Max Baker =head1 SYNOPSIS diff --git a/Info/NortelStack.pm b/Info/NortelStack.pm index e01ad142..b604e099 100644 --- a/Info/NortelStack.pm +++ b/Info/NortelStack.pm @@ -2,7 +2,7 @@ # Eric Miller # $Id$ # -# Copyright (c) 2004 Max Baker +# Copyright (c) 2004 Eric Miller, Max Baker # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::NortelStack; -$VERSION = 0.9; +$VERSION = 1.0; use strict; @@ -39,12 +39,6 @@ use SNMP::Info; @SNMP::Info::NortelStack::EXPORT_OK = qw//; use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/; -# Debug -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -# Five data structures required by SNMP::Info -$INIT = 0; %MIBS = ( # S5-ROOT-MIB and S5-TCS-MIB required by the MIBs below diff --git a/Info/RapidCity.pm b/Info/RapidCity.pm index 5da41af3..e9846a91 100644 --- a/Info/RapidCity.pm +++ b/Info/RapidCity.pm @@ -2,7 +2,7 @@ # Eric Miller # $Id$ # -# Copyright (c) 2004 Max Baker +# Copyright (c) 2004 Eric Miller, Max Baker # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::RapidCity; -$VERSION = 0.9; +$VERSION = 1.0; use strict; use Exporter; @@ -39,12 +39,6 @@ use Carp; @SNMP::Info::RapidCity::EXPORT_OK = qw//; use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/; -# Debug -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -# Five data structures required by SNMP::Info -$INIT = 0; %MIBS = ( 'RAPID-CITY' => 'rapidCity', diff --git a/Info/SONMP.pm b/Info/SONMP.pm index 6447277e..1ccf8289 100644 --- a/Info/SONMP.pm +++ b/Info/SONMP.pm @@ -2,7 +2,7 @@ # Eric Miller # $Id$ # -# Copyright (c) 2004 Max Baker +# Copyright (c) 2004 Eric Miller, Max Baker # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -28,7 +28,7 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. package SNMP::Info::SONMP; -$VERSION = 0.9; +$VERSION = 1.0; use strict; @@ -40,12 +40,6 @@ use Carp; @SNMP::Info::SONMP::EXPORT_OK = qw//; use vars qw/$VERSION $DEBUG %FUNCS %GLOBALS %MIBS %MUNGE $INIT/; -# Debug -$DEBUG=0; -$SNMP::debugging=$DEBUG; - -# Five data structures required by SNMP::Info -$INIT = 0; %MIBS = ( 'SYNOPTICS-ROOT-MIB' => 'synoptics', @@ -301,7 +295,6 @@ SNMP::Info::SONMP - Perl5 Interface to SynOptics Network Management Protocol (SO =head1 AUTHOR -Max Baker (C), Eric Miller (C) =head1 SYNOPSIS