doc changes

This commit is contained in:
Max Baker
2004-03-22 04:22:00 +00:00
parent 6dd3f4b21a
commit 440bb002b6
2 changed files with 62 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
SNMP::Info - Friendly OO-style interface to Network devices using SNMP. SNMP::Info - Friendly OO-style interface to Network devices using SNMP.
ChangeLog $Id$ ChangeLog $Id$
version 0.8 () version 0.8 (03/21/04)
+ Added Q-BRIDGE-MIB support to SNMP::Info::Bridge + Added Q-BRIDGE-MIB support to SNMP::Info::Bridge
+ Added Aironet AP4800 to Layer3::Aironet class + Added Aironet AP4800 to Layer3::Aironet class
+ Added C3500XL devices to the Layer2::C2900 class + Added C3500XL devices to the Layer2::C2900 class

95
Info.pm
View File

@@ -1,7 +1,7 @@
# SNMP::Info - Max Baker <max@warped.org> # SNMP::Info - Max Baker
# $Id$ # $Id$
# #
# Portions Copyright (c) 2003 Max Baker # Portions Copyright (c) 2003,2004 Max Baker
# All rights reserved. # All rights reserved.
# Copyright (c) 2002-3, Regents of the University of California # Copyright (c) 2002-3, Regents of the University of California
# All rights reserved. # All rights reserved.
@@ -36,7 +36,7 @@ SNMP::Info - Version 0.8
Max Baker Max Baker
SNMP::Info was created at UCSC for the netdisco project (www.netdisco.org) SNMP::Info was created at UCSC for the netdisco project (www.netdisco.org)
and is now maintained by Max Baker. and is written and maintained by Max Baker.
=head1 SYNOPSIS =head1 SYNOPSIS
@@ -50,13 +50,13 @@ and is now maintained by Max Baker.
DestHost => 'router', DestHost => 'router',
Community => 'public', Community => 'public',
Version => 2 Version => 2
) or die "Can't connect to device.\n" ) or die "Can't connect to device.\n";
my $err = $info->error(); my $err = $info->error();
die "SNMP Community or Version probably wrong connecting to device. $err\n" if defined $err; die "SNMP Community or Version probably wrong connecting to device. $err\n" if defined $err;
$name = $info->name(); $name = $info->name();
$class = $info->class() $class = $info->class();
print "SNMP::Info is using this device class : $class\n"; print "SNMP::Info is using this device class : $class\n";
# Find out the Duplex status for the ports # Find out the Duplex status for the ports
@@ -138,9 +138,7 @@ of the net-snmp distribution.
Net-SNMP can be found at http://net-snmp.sourceforge.net Net-SNMP can be found at http://net-snmp.sourceforge.net
Version 5.0.2 or greater is recommended. Various version 4's will work, and 5.0.1 is kinda flaky Version 5.0.2 or greater is recommended. Various version 4's will work, and 5.0.1 is kinda flaky
on the Perl side. on the Perl side. 5.1.x isn't tested but should work fine.
Note: Net-SNMP was previously called ucd-snmp.
=item 2. MIBS =item 2. MIBS
@@ -148,7 +146,7 @@ SNMP::Info operates on textual descriptors found in MIBs. MIBs are text database
are freely and easily obtainable on the Net. are freely and easily obtainable on the Net.
Make sure that your snmp.conf is updated to point to your MIB directory Make sure that your snmp.conf is updated to point to your MIB directory
and that the MIBs are world-readable. and that the MIBs are world-readable.
Then run C<snmpconf> and setup that directory as default. Move F<snmp.conf> Then run C<snmpconf> and setup that directory as default. Move F<snmp.conf>
into F</usr/local/share/snmp> when you are done. into F</usr/local/share/snmp> when you are done.
@@ -181,13 +179,15 @@ Extract
=item STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB) =item STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB)
=item TOKEN-RING-RMON-MIB
=back =back
by running by running
mkdir -p /usr/local/share/snmp/mibs mkdir -p /usr/local/share/snmp/mibs
cd /usr/local/share/snmp/mibs cd /usr/local/share/snmp/mibs
tar xvfz /path/to/v1.tar.gz BRIDGE-MIB.my SNMP-REPEATER-MIB.my ESSWITCH-MIB.my tar xvfz /path/to/v1.tar.gz BRIDGE-MIB.my SNMP-REPEATER-MIB.my ESSWITCH-MIB.my TOKEN-RING-RMON-MIB.my
=item Fix CISCO-TC-MIB =item Fix CISCO-TC-MIB
@@ -251,8 +251,9 @@ Or you can override any existing methods from a parent class by making a short s
See the section EXTENDING SNMP::INFO for more details. See the section EXTENDING SNMP::INFO for more details.
When you make a new subclass for a device, please be sure to send it When you make a new subclass for a device, please be sure to send it back to
back to the developers at snmp@warped.org for inclusion in the next version. the developers (via Source Forge or the mailing list) for inclusion in the next
version.
=back =back
@@ -271,12 +272,16 @@ used directly, but rather inherited from device subclasses.
=item SNMP::Info::Bridge =item SNMP::Info::Bridge
BRIDGE-MIB (RFC1286). Inherited by devices with Layer2 service. BRIDGE-MIB (RFC1286). QBRIDGE-MIB. Inherited by devices with Layer2 support.
=item SNMP::Info::CDP =item SNMP::Info::CDP
CISCO-CDP-MIB. Cisco Discovery Protocol (CDP) Support. Inherited by devices serving Layer2 or Layer3. CISCO-CDP-MIB. Cisco Discovery Protocol (CDP) Support. Inherited by devices serving Layer2 or Layer3.
=item SNMP::Info::CiscoStack
CISCO-STACK-MIB.
=item SNMP::Info::CiscoStats =item SNMP::Info::CiscoStats
Provides common interfaces for memory, cpu, and os statistics for Cisco devices. Provides methods for Provides common interfaces for memory, cpu, and os statistics for Cisco devices. Provides methods for
@@ -333,6 +338,15 @@ Generic Layer2 Device subclass.
=over =over
=item SNMP::Info::Layer2::Aironet
Class for Cisco Aironet wireless devices that run IOS. See also
Layer3::Aironet for Aironet devices that don't run IOS.
=item SNMP::Info::Layer2::Allied
Allied Telesys switches.
=item SNMP::Info::Layer2::Bay =item SNMP::Info::Layer2::Bay
Bay Networks BayStack switch Support. Provides translation from Bay Network Topology Table Bay Networks BayStack switch Support. Provides translation from Bay Network Topology Table
@@ -348,12 +362,12 @@ Subclass for Cisco Catalyst 1900 and 1900c Devices running CatOS.
=item SNMP::Info::Layer2::C2900 =item SNMP::Info::Layer2::C2900
Subclass for Cisco Catalyst 2900 and 3500XL devices running IOS. Subclass for Cisco Catalyst 2900, 2950, 3500XL, and 3548 devices running IOS.
=item SNMP::Info::Layer2::Catalyst =item SNMP::Info::Layer2::Catalyst
Subclass for Cisco Catalyst switches running CatOS. These switches usually Subclass for Cisco Catalyst switches running CatOS. These switches usually
report a model number that starts with ''wsc''. Note that this class report a model number that starts with C<wsc>. Note that this class
does not support everything that has the name Catalyst. does not support everything that has the name Catalyst.
=item SNMP::Info::Layer2::HP =item SNMP::Info::Layer2::HP
@@ -364,6 +378,10 @@ Requires HP-ICF-OID and ENTITY-MIB downloaded from HP.
See SNMP::Info::Layer2::HP for more info. See SNMP::Info::Layer2::HP for more info.
=item SNMP::Info::Layer2::ZyXEL_DSLAM
Zyxel DSLAMs. Need I say more?
=back =back
=item SNMP::Info::Layer3 =item SNMP::Info::Layer3
@@ -374,15 +392,16 @@ Generic Layer3 and Layer2+3 Device subclass.
=item SNMP::Info::Layer3::Aironet =item SNMP::Info::Layer3::Aironet
Subclass for Cisco Aironet wireless access points (AP). 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. MIBs for these devices now included in v2.tar.gz available from ftp.cisco.com.
Note Layer2::Aironet
=item SNMP::Info::Layer3::Foundry =item SNMP::Info::Layer3::Foundry
No longer supported. Subclass for older Foundry Network devices. Outdated, but being updated for newer devices.
Subclass for older Foundry Network devices.
Requires FOUNDRY-SN-ROOT-MIB. Requires FOUNDRY-SN-ROOT-MIB.
@@ -390,7 +409,12 @@ See SNMP::Info::Layer3::Foundry for more info.
=item SNMP::Info::Layer3::C3550 =item SNMP::Info::Layer3::C3550
Subclass for Cisco Catalyst 3550 2/3 switches running IOS. Subclass for Cisco Catalyst 3550,354 2/3 switches running IOS.
=item SNMP::Info::Layer3::C6500
This class covers Catalyst 6500s in native mode, hybrid mode. Catalyst 4000's, 3750's, 2970's
and probably others.
=back =back
@@ -399,7 +423,8 @@ Subclass for Cisco Catalyst 3550 2/3 switches running IOS.
=head2 Thanks =head2 Thanks
Thanks for testing and coding help (in no particular order) to : Thanks for testing and coding help (in no particular order) to :
Andy Ford, Brian Wilson, Jean-Philippe Luiggi, D<>na Watanabe Andy Ford, Brian Wilson, Jean-Philippe Luiggi, D<>na Watanabe, Bradley Baetz, and
people listed on the Netdisco README!
=head1 USAGE =head1 USAGE
@@ -602,16 +627,17 @@ SNMP::Info is returned.
Algorithm for Subclass Detection: Algorithm for Subclass Detection:
Layer3 Support -> SNMP::Info::Layer3 Layer3 Support -> SNMP::Info::Layer3
Aironet (non IOS) -> SNMP::Info::Layer3::Aironet Aironet (BR500,AP340,350,1200) -> SNMP::Info::Layer3::Aironet
Catalyst 3550 -> SNMP::Info::Layer3::C3550 AP4800... All Non IOS
Catalyst 6500 -> SNMP::Info::Layer3::C6500 Catalyst 3550,3548 -> SNMP::Info::Layer3::C3550
Catalyst 6500, 4000, 3750 -> SNMP::Info::Layer3::C6500
Foundry -> SNMP::Info::Layer3::Foundry Foundry -> SNMP::Info::Layer3::Foundry
Elsif Layer2 (no Layer3) -> SNMP::Info::Layer2 Elsif Layer2 (no Layer3) -> SNMP::Info::Layer2
Aironet (Cisco) AP1100 -> SNMP::Info::Layer2::Aironet Aironet - IOS Devices -> SNMP::Info::Layer2::Aironet
Bay Networks -> SNMP::Info::Layer2::Bay Bay Networks -> SNMP::Info::Layer2::Bay
Catalyst 1900 -> SNMP::Info::Layer2::C1900 Catalyst 1900 -> SNMP::Info::Layer2::C1900
Catalyst 2900XL/2950(IOS) -> SNMP::Info::Layer2::C2900 Catalyst 2900XL,2950,3500XL -> SNMP::Info::Layer2::C2900
Catalyst 3500XL (3548) IOS -> SNMP::Info::Layer2::C2900 Catalyst 2970 -> SNMP::Info::Layer3::C6500
Catalyst 3550/3548 -> SNMP::Info::Layer3::C3550 Catalyst 3550/3548 -> SNMP::Info::Layer3::C3550
Catalyst WS-C 2926,5xxx -> SNMP::Info::Layer2::Catalyst Catalyst WS-C 2926,5xxx -> SNMP::Info::Layer2::Catalyst
HP Procurve -> SNMP::Info::Layer2::HP HP Procurve -> SNMP::Info::Layer2::HP
@@ -619,6 +645,7 @@ Algorithm for Subclass Detection:
Allied -> SNMP::Info::Layer1::Allied Allied -> SNMP::Info::Layer1::Allied
Asante -> SNMP::Info::Layer1::Asante Asante -> SNMP::Info::Layer1::Asante
Else -> SNMP::Info Else -> SNMP::Info
ZyXEL_DSLAM -> SNMP::Info::Layer2::ZyXEL_DSLAM
=cut =cut
sub device_type { sub device_type {
@@ -741,7 +768,7 @@ sub has_layer {
=item $info->snmp_comm() =item $info->snmp_comm()
Returns SNMP Community string used in conncetion Returns SNMP Community string used in connection.
=cut =cut
sub snmp_comm { sub snmp_comm {
@@ -828,7 +855,7 @@ Some subset of these is probably available for any network device that speaks SN
=item $info->uptime() =item $info->uptime()
Uptime in hundreths of seconds since device became available. Uptime in hundredths of seconds since device became available.
(B<sysUpTime>) (B<sysUpTime>)
@@ -1240,17 +1267,17 @@ Table Methods. Set iid of method to value.
Returns undef if failed, or the return value from SNMP::Session::set() (snmp_errno) Returns undef if failed, or the return value from SNMP::Session::set() (snmp_errno)
# Disable a port administratvely # Disable a port administratively
my %if_map = reverse %{$info->interfaces()} my %if_map = reverse %{$info->interfaces()}
$info->set_i_up_admin('down', $if_map{'FastEthernet0/0') $info->set_i_up_admin('down', $if_map{'FastEthernet0/0')
or die "Couldn't disable the port. ",$info->error(1); or die "Couldn't disable the port. ",$info->error(1);
=back =back
NOTE: You must be connected to your device with a ReadWrite community string in order NOTE: You must be connected to your device with a C<ReadWrite> community string in order
for set operations to work. for set operations to work.
NOTE: This will only set data listed in %FUNCS and %GLOBALS. For data aquired from NOTE: This will only set data listed in %FUNCS and %GLOBALS. For data acquired from
overriden methods (subroutines) specific set_METHOD() subroutines will need to be overriden methods (subroutines) specific set_METHOD() subroutines will need to be
added. added.
@@ -1494,7 +1521,7 @@ Let's make a sample Layer 2 Device subclass :
1; # don't forget this line 1; # don't forget this line
----------------------- snip -------------------------------- ----------------------- snip --------------------------------
Be sure and send the debugged version to snmp@warped.org to be Be sure and send the debugged version to snmp-info-users@lists.sourceforge.net to be
included in the next version of SNMP::Info. included in the next version of SNMP::Info.
=head1 SNMP::INFO INTERNALS =head1 SNMP::INFO INTERNALS
@@ -1858,7 +1885,7 @@ sub store {
=item $info->_global() =item $info->_global()
Used internally by AUTOLOAD to load dynmaic methods from %GLOBALS. Used internally by AUTOLOAD to load dynamic methods from %GLOBALS.
Example: $info->name() calls autoload which calls $info->_global('name'). Example: $info->name() calls autoload which calls $info->_global('name').