Compare commits
	
		
			38 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					5e879b6822 | ||
| 
						 | 
					c672b914db | ||
| 
						 | 
					f703bdc910 | ||
| 
						 | 
					0752a2403c | ||
| 
						 | 
					f0dc4c4b31 | ||
| 
						 | 
					7269476bad | ||
| 
						 | 
					42d56e62e1 | ||
| 
						 | 
					873fd257cd | ||
| 
						 | 
					43d01c5060 | ||
| 
						 | 
					1d45ab5522 | ||
| 
						 | 
					2674536a55 | ||
| 
						 | 
					cc13a0f850 | ||
| 
						 | 
					f9a97d7a3b | ||
| 
						 | 
					d5f1a1ae95 | ||
| 
						 | 
					466c0daec0 | ||
| 
						 | 
					e127beb2d7 | ||
| 
						 | 
					ff9cab9fe7 | ||
| 
						 | 
					6d9ce57032 | ||
| 
						 | 
					77d854f58f | ||
| 
						 | 
					9e2ac2d880 | ||
| 
						 | 
					4a52fccc20 | ||
| 
						 | 
					d7e524b4a3 | ||
| 
						 | 
					6da7d340a9 | ||
| 
						 | 
					e9fa153e45 | ||
| 
						 | 
					fa99cb39ae | ||
| 
						 | 
					622a35de01 | ||
| 
						 | 
					74c85cae9e | ||
| 
						 | 
					3eba4c6c79 | ||
| 
						 | 
					3f179aa21a | ||
| 
						 | 
					a6a8ed4c55 | ||
| 
						 | 
					d7b6fa2179 | ||
| 
						 | 
					69645321cd | ||
| 
						 | 
					f2754b80bb | ||
| 
						 | 
					1f1ba32c1b | ||
| 
						 | 
					39ed601300 | ||
| 
						 | 
					c2bbd03c2f | ||
| 
						 | 
					3c3c040471 | ||
| 
						 | 
					af51ee7ea4 | 
							
								
								
									
										17
									
								
								ChangeLog
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								ChangeLog
									
									
									
									
									
								
							@@ -1,6 +1,23 @@
 | 
				
			|||||||
SNMP::Info - Perl5 OO Interface to Network Devices and SNMP MIBs
 | 
					SNMP::Info - Perl5 OO Interface to Network Devices and SNMP MIBs
 | 
				
			||||||
ChangeLog $Id$
 | 
					ChangeLog $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					version 0.4 (04/29/03)
 | 
				
			||||||
 | 
					    * BIG CHANGE ! Internal Data structure has changed.  
 | 
				
			||||||
 | 
					    * Added clear_cache() method
 | 
				
			||||||
 | 
					    * Added NO_SUCH support for snmpget (TABLE) calls to get SNMP MIB II data 
 | 
				
			||||||
 | 
					      from SNMP Version 1 devices.
 | 
				
			||||||
 | 
					    * Methods load_all() and all() have changed their return value. Sorry but the API had to change.
 | 
				
			||||||
 | 
					    * New object methods snmp_comm(), snmp_ver(), store(), class(), nosuch() to make it more OO happy.
 | 
				
			||||||
 | 
					    * Globals are now cached
 | 
				
			||||||
 | 
					    * Added new argument 'AutoSpecify' to new() to auto-connect with subclass 
 | 
				
			||||||
 | 
					      detected in device_type()
 | 
				
			||||||
 | 
					    * New method specify() returns a new subclass object
 | 
				
			||||||
 | 
					    * Subclasses are automatically loaded when specify or autospecify is used!
 | 
				
			||||||
 | 
					    * Added methods for Interface statistics (ifInOctets ...)
 | 
				
			||||||
 | 
					    * Added methods for Memory and CPU statistics 
 | 
				
			||||||
 | 
					    * Added SNMP::Info::Entity, moved out of L2-HP
 | 
				
			||||||
 | 
					    * Added SNMP::Info::Layer2::Aironet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
version 0.3 (03/06/03)
 | 
					version 0.3 (03/06/03)
 | 
				
			||||||
    * Fixed HP model() warning
 | 
					    * Fixed HP model() warning
 | 
				
			||||||
    * Added error checking for responses of NOSUCHOBJECT and NOSUCHINSTANCE in _global
 | 
					    * Added error checking for responses of NOSUCHOBJECT and NOSUCHINSTANCE in _global
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Bridge;
 | 
					package SNMP::Info::Bridge;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -44,7 +44,9 @@ $DEBUG=0;
 | 
				
			|||||||
$SNMP::debugging=$DEBUG;
 | 
					$SNMP::debugging=$DEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$INIT = 0;
 | 
					$INIT = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MIBS    = ('BRIDGE-MIB' => 'dot1dBaseBridgeAddress');
 | 
					%MIBS    = ('BRIDGE-MIB' => 'dot1dBaseBridgeAddress');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%GLOBALS = (
 | 
					%GLOBALS = (
 | 
				
			||||||
            'b_mac'   => 'dot1dBaseBridgeAddress',
 | 
					            'b_mac'   => 'dot1dBaseBridgeAddress',
 | 
				
			||||||
            'b_ports' => 'dot1dBaseNumPorts',
 | 
					            'b_ports' => 'dot1dBaseNumPorts',
 | 
				
			||||||
@@ -82,6 +84,7 @@ $INIT = 0;
 | 
				
			|||||||
          # Inherit all the built in munging
 | 
					          # Inherit all the built in munging
 | 
				
			||||||
          %SNMP::Info::MUNGE,
 | 
					          %SNMP::Info::MUNGE,
 | 
				
			||||||
          # Add ones for our class
 | 
					          # Add ones for our class
 | 
				
			||||||
 | 
					          'b_mac'        => \&SNMP::Info::munge_mac,
 | 
				
			||||||
          'fw_mac'       => \&SNMP::Info::munge_mac,
 | 
					          'fw_mac'       => \&SNMP::Info::munge_mac,
 | 
				
			||||||
          'bs_mac'       => \&SNMP::Info::munge_mac,
 | 
					          'bs_mac'       => \&SNMP::Info::munge_mac,
 | 
				
			||||||
          'stp_root'     => \&SNMP::Info::munge_mac,
 | 
					          'stp_root'     => \&SNMP::Info::munge_mac,
 | 
				
			||||||
@@ -115,13 +118,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Bridge - Perl5 Interface to BRIDGE-MIB 
 | 
					SNMP::Info::Bridge - Perl5 Interface to SNMP data available through the BRIDGE-MIB (RFC1493)
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
BRIDGE-MIB is used by most Layer 2 devices like Switches 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits all methods from SNMP::Info
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -129,40 +126,59 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $bridge = new SNMP::Info::Bridge(DestHost  => 'myswitch',
 | 
					 my $bridge = new SNMP::Info ( 
 | 
				
			||||||
                               Community => 'public');
 | 
					                             AutoSpecify => 1,
 | 
				
			||||||
 my $mac = $bridge->mac(); 
 | 
					                             Debug       => 1,
 | 
				
			||||||
 | 
					                             DestHost    => 'switch', 
 | 
				
			||||||
 | 
					                             Community   => 'public',
 | 
				
			||||||
 | 
					                             Version     => 2
 | 
				
			||||||
 | 
					                             );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class = $cdp->class();
 | 
				
			||||||
 | 
					 print " Using device sub class : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Grab Forwarding Tables
 | 
				
			||||||
 | 
					 my $interfaces = $bridge->interfaces();
 | 
				
			||||||
 | 
					 my $fw_mac     = $bridge->fw_mac();
 | 
				
			||||||
 | 
					 my $fw_port    = $bridge->fw_port();
 | 
				
			||||||
 | 
					 my $bp_index   = $bridge->bp_index();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 foreach my $fw_index (keys %$fw_mac){
 | 
				
			||||||
 | 
					    my $mac   = $fw_mac->{$fw_index};
 | 
				
			||||||
 | 
					    my $bp_id = $fw_mac->{$fw_index};
 | 
				
			||||||
 | 
					    my $iid   = $bp_index->{$bp_id};
 | 
				
			||||||
 | 
					    my $port  = $interfaces->{$iid};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    print "Port:$port forwarding to $mac\n";
 | 
				
			||||||
 | 
					 } 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					BRIDGE-MIB is used by most Layer 2 devices, and holds information like the MAC Forwarding Table and Spanning Tree Protocol info.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Create or use a subclass of SNMP::Info that inherits this class.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For debugging you can call new() directly as you would in SNMP::Info 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $bridge = new SNMP::Info::Bridge(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					None.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Bridge()
 | 
					=item BRIDGE-MIB
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $bridge = new SNMP::Info::Bridge(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $bridge;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item  $bridge->session()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Sets or returns the SNMP::Session object
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Get
 | 
					 | 
				
			||||||
    my $sess = $bridge->session();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Set
 | 
					 | 
				
			||||||
    my $newsession = new SNMP::Session(...);
 | 
					 | 
				
			||||||
    $bridge->session($newsession);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 Bridge Global Configuration Values
 | 
					BRIDGE-MIB needs to be extracted from ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBAL METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar values from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -204,7 +220,10 @@ Returns root of STP.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Forwarding Table (dot1dTpFdbEntry)
 | 
					=head2 Forwarding Table (dot1dTpFdbEntry)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										229
									
								
								Info/CDP.pm
									
									
									
									
									
								
							
							
						
						
									
										229
									
								
								Info/CDP.pm
									
									
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::CDP;
 | 
					package SNMP::Info::CDP;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -59,7 +59,7 @@ $INIT = 0;
 | 
				
			|||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%FUNCS  = (
 | 
					%FUNCS  = (
 | 
				
			||||||
            'c_if'           => 'cdpCacheIfIndex',
 | 
					            'c_index'        => 'cdpCacheIfIndex',
 | 
				
			||||||
            'c_proto'        => 'cdpCacheAddressType',
 | 
					            'c_proto'        => 'cdpCacheAddressType',
 | 
				
			||||||
            'c_ip'           => 'cdpCacheAddress',
 | 
					            'c_ip'           => 'cdpCacheAddress',
 | 
				
			||||||
            'c_ver'          => 'cdpCacheVersion',
 | 
					            'c_ver'          => 'cdpCacheVersion',
 | 
				
			||||||
@@ -103,6 +103,34 @@ sub hasCDP {
 | 
				
			|||||||
    
 | 
					    
 | 
				
			||||||
    return $cdp->cdp_run();
 | 
					    return $cdp->cdp_run();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub c_if {
 | 
				
			||||||
 | 
					    my $cdp  = shift;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # See if by some miracle Cisco implemented the cdpCacheIfIndex entry
 | 
				
			||||||
 | 
					    my $c_index     = $cdp->c_index();
 | 
				
			||||||
 | 
					    return $c_index if defined $c_index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Nope, didn't think so. Now we fake it.
 | 
				
			||||||
 | 
					    my $c_ip = $cdp->c_ip();
 | 
				
			||||||
 | 
					    unless (defined $c_ip){
 | 
				
			||||||
 | 
					        $cdp->{error} = "SNMP::Info::CDP::c_if() - Device doesn't have c_ip() data.  Can't fake c_index()";
 | 
				
			||||||
 | 
					        $DEBUG and carp($cdp->error(1));
 | 
				
			||||||
 | 
					        return undef;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my %c_if;
 | 
				
			||||||
 | 
					    foreach my $key (keys %$c_ip){
 | 
				
			||||||
 | 
					      next unless defined $key;
 | 
				
			||||||
 | 
					      my $iid = $key;
 | 
				
			||||||
 | 
					      # Truncate .1 from cdp cache entry
 | 
				
			||||||
 | 
					      $iid =~ s/\.\d+$//;
 | 
				
			||||||
 | 
					      $c_if{$key} = $iid;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return \%c_if;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1;
 | 
					1;
 | 
				
			||||||
__END__
 | 
					__END__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -110,40 +138,69 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::CDP - Perl5 Interface to Cisco Discovery Protocol (CDP) using SNMP
 | 
					SNMP::Info::CDP - Perl5 Interface to Cisco Discovery Protocol (CDP) using SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
SNMP::Info::CDP is a subclass of SNMP::Info that provides an object oriented 
 | 
					 | 
				
			||||||
interface to CDP information through SNMP.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
CDP is a Layer 2 protocol that supplies topology information of devices that also speak CDP, 
 | 
					 | 
				
			||||||
mostly switches and routers.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $info = new SNMP::Info ( DestHost  => 'router', 
 | 
					 my $cdp = new SNMP::Info ( 
 | 
				
			||||||
                             Community => 'public' 
 | 
					                             AutoSpecify => 1,
 | 
				
			||||||
 | 
					                             Debug       => 1,
 | 
				
			||||||
 | 
					                             DestHost    => 'router', 
 | 
				
			||||||
 | 
					                             Community   => 'public',
 | 
				
			||||||
 | 
					                             Version     => 2
 | 
				
			||||||
                           );
 | 
					                           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $type = $info->device_type();
 | 
					 my $class = $cdp->class();
 | 
				
			||||||
 | 
					 print " Using device sub class : $class\n";
 | 
				
			||||||
 my $cdp  = new $type ( DestHost => 'router',
 | 
					 | 
				
			||||||
                        Community => 'public);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 $hascdp   = $cdp->hasCDP() ? 'yes' : 'no';
 | 
					 $hascdp   = $cdp->hasCDP() ? 'yes' : 'no';
 | 
				
			||||||
 @neighbor_ips = values( %{$cdp->c_ip()} );
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
See L<SNMP::Info> for all inherited methods.
 | 
					 # Print out a map of device ports with CDP neighbors:
 | 
				
			||||||
 | 
					 my $interfaces = $cdp->interfaces();
 | 
				
			||||||
 | 
					 my $c_if       = $cdp->c_if();
 | 
				
			||||||
 | 
					 my $c_ip       = $cdp->c_ip();
 | 
				
			||||||
 | 
					 my $c_port     = $cdp->c_port();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Your Device May Vary
 | 
					 foreach my $cdp_key (keys %$c_ip){
 | 
				
			||||||
 | 
					    my $iid           = $c_if->{$cdp_key};
 | 
				
			||||||
 | 
					    my $port          = $interfaces->{$iid};
 | 
				
			||||||
 | 
					    my $neighbor      = $c_ip->{$cdp_key};
 | 
				
			||||||
 | 
					    my $neighbor_port = $c_port->{$cdp_key};
 | 
				
			||||||
 | 
					    print "Port : $port connected to $neighbor / $neighbor_port\n";
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::CDP is a subclass of SNMP::Info that provides an object oriented 
 | 
				
			||||||
 | 
					interface to CDP information through SNMP.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CDP is a Layer 2 protocol that supplies topology information of devices that also speak CDP, 
 | 
				
			||||||
 | 
					mostly switches and routers.  CDP is implemented in Cisco and some HP devices.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Create or use a device subclass that inherits this class.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Each device implements a subset of the global and cache entries. 
 | 
					Each device implements a subset of the global and cache entries. 
 | 
				
			||||||
Check the return value to see if that data is held by the device.
 | 
					Check the return value to see if that data is held by the device.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CDP GLOBAL VALUES
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					None.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-CDP-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBAL METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar values from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -155,7 +212,8 @@ Accounts for SNMP version 1 devices which may have CDP but not cdp_run()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=item $cdp->cdp_run()
 | 
					=item $cdp->cdp_run()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Is CDP enabled on this device?
 | 
					Is CDP enabled on this device?  Note that a lot of Cisco devices that implement
 | 
				
			||||||
 | 
					CDP don't implement this value. @#%$!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<cdpGlobalRun>)
 | 
					(B<cdpGlobalRun>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -181,46 +239,15 @@ This is the device id broadcast via CDP to other devices, and is what is retriev
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CDP CACHE ENTRIES
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 CDP CACHE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  $cdp->c_proto()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote address type received.  Usually IP.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCacheAddressType>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item  $cdp->c_ip()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote IP address
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCacheAddress>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_ver() 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote hardware version
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCacheVersion>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_id()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote device id string
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCacheDeviceId>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_port()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote port ID
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpDevicePort>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_platform() 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns remote platform id 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCachePlatform>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_capabilities()
 | 
					=item $cdp->c_capabilities()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns Device Functional Capabilities.  Results are munged into an ascii
 | 
					Returns Device Functional Capabilities.  Results are munged into an ascii
 | 
				
			||||||
@@ -259,18 +286,92 @@ Returns remote VTP Management Domain as defined in CISCO-VTP-MIB::managementDoma
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(B<cdpCacheVTPMgmtDomain>)
 | 
					(B<cdpCacheVTPMgmtDomain>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cdp->c_vlan()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Returns the remote interface native VLAN.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(B<cdpCacheNativeVLAN>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $cdp->c_duplex() 
 | 
					=item $cdp->c_duplex() 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns the port duplex status from remote devices.
 | 
					Returns the port duplex status from remote devices.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<cdpCacheDuplex>)
 | 
					(B<cdpCacheDuplex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_id()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote device id string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheDeviceId>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_if()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns the mapping to the SNMP Interface Table.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note that a lot devices don't implement $cdp->c_index(),  So if it isn't around,
 | 
				
			||||||
 | 
					we fake it. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					In order to map the cdp table entry back to the interfaces() entry, we truncate the last number
 | 
				
			||||||
 | 
					off of it :
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # it exists, yay.
 | 
				
			||||||
 | 
					  my $c_index     = $device->c_index();
 | 
				
			||||||
 | 
					  return $c_index if defined $c_index;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # if not, let's fake it
 | 
				
			||||||
 | 
					  my $c_ip       = $device->c_ip();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					  my %c_if
 | 
				
			||||||
 | 
					  foreach my $key (keys %$c_ip){
 | 
				
			||||||
 | 
					      $iid = $key;
 | 
				
			||||||
 | 
					      ## Truncate off .1 from cdp response
 | 
				
			||||||
 | 
					      $iid =~ s/\.\d+$//;
 | 
				
			||||||
 | 
					      $c_if{$key} = $iid;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					  return \%c_if;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_index()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns the mapping to the SNMP2 Interface table for CDP Cache Entries. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Most devices don't implement this, so you probably want to use $cdp->c_if() instead.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See c_if() entry.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheIfIndex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item  $cdp->c_ip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote IP address
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheAddress>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_platform() 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote platform id 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCachePlatform>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote port ID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpDevicePort>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item  $cdp->c_proto()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote address type received.  Usually IP.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheAddressType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_ver() 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns remote hardware version
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheVersion>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cdp->c_vlan()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns the remote interface native VLAN.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<cdpCacheNativeVLAN>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										269
									
								
								Info/CiscoStats.pm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										269
									
								
								Info/CiscoStats.pm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,269 @@
 | 
				
			|||||||
 | 
					# SNMP::Info::CiscoStats
 | 
				
			||||||
 | 
					# Max Baker <max@warped.org>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (c) 2003 Regents of the University of California
 | 
				
			||||||
 | 
					# All rights reserved.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# Redistribution and use in source and binary forms, with or without 
 | 
				
			||||||
 | 
					# modification, are permitted provided that the following conditions are met:
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					#     * Redistributions of source code must retain the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer.
 | 
				
			||||||
 | 
					#     * Redistributions in binary form must reproduce the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer in the documentation
 | 
				
			||||||
 | 
					#       and/or other materials provided with the distribution.
 | 
				
			||||||
 | 
					#     * Neither the name of the University of California, Santa Cruz nor the 
 | 
				
			||||||
 | 
					#       names of its contributors may be used to endorse or promote products 
 | 
				
			||||||
 | 
					#       derived from this software without specific prior written permission.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 | 
				
			||||||
 | 
					# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 | 
				
			||||||
 | 
					# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
 | 
				
			||||||
 | 
					# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 | 
				
			||||||
 | 
					# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
				
			||||||
 | 
					# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 | 
				
			||||||
 | 
					# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 | 
				
			||||||
 | 
					# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 | 
				
			||||||
 | 
					# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
 | 
				
			||||||
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package SNMP::Info::CiscoStats;
 | 
				
			||||||
 | 
					$VERSION = 0.4;
 | 
				
			||||||
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Exporter;
 | 
				
			||||||
 | 
					use SNMP::Info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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',
 | 
				
			||||||
 | 
					            'CISCO-MEMORY-POOL-MIB' => 'ciscoMemoryPoolUsed' 
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%GLOBALS = (
 | 
				
			||||||
 | 
					            'description'  => 'sysDescr',
 | 
				
			||||||
 | 
					            # We will use the numeric OID's so that we don't require people
 | 
				
			||||||
 | 
					            # to install v1 MIBs, which can conflict.
 | 
				
			||||||
 | 
					            # OLD-CISCO-CPU-MIB:avgBusyPer
 | 
				
			||||||
 | 
					            'ios_cpu'      => '1.3.6.1.4.1.9.2.1.56.0',
 | 
				
			||||||
 | 
					            'ios_cpu_1min' => '1.3.6.1.4.1.9.2.1.57.0',
 | 
				
			||||||
 | 
					            'ios_cpu_5min' => '1.3.6.1.4.1.9.2.1.58.0',
 | 
				
			||||||
 | 
					            # CISCO-PROCESS-MIB
 | 
				
			||||||
 | 
					            'cat_cpu'      => 'cpmCPUTotal5sec.9',
 | 
				
			||||||
 | 
					            'cat_cpu_1min' => 'cpmCPUTotal1min.9',
 | 
				
			||||||
 | 
					            'cat_cpu_5min' => 'cpmCPUTotal5min.9',
 | 
				
			||||||
 | 
					            # CISCO-MEMORY-POOL-MIB
 | 
				
			||||||
 | 
					            'mem_free'     => 'ciscoMemoryPoolFree.1',
 | 
				
			||||||
 | 
					            'mem_used'     => 'ciscoMemoryPoolUsed.1',
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%FUNCS   = (
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%MUNGE   = (
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    my $l2 = shift;
 | 
				
			||||||
 | 
					    my $descr = $l2->description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return 'catalyst' if ($descr =~ /catalyst/i);
 | 
				
			||||||
 | 
					    return 'ios'      if ($descr =~ /IOS/);
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $l2    = shift;
 | 
				
			||||||
 | 
					    my $os    = $l2->os();
 | 
				
			||||||
 | 
					    my $descr = $l2->description();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    # Older Catalysts
 | 
				
			||||||
 | 
					    if ($os eq 'catalyst' and $descr =~ m/V(\d{1}\.\d{2}\.\d{2})/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Newer Catalysts and IOS devices
 | 
				
			||||||
 | 
					    if ($descr =~ m/Version (\d+\.\d+\([^)]+\)[^,\s]*)(,|\s)+/ ){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    } 
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub cpu {
 | 
				
			||||||
 | 
					    my $self = shift;
 | 
				
			||||||
 | 
					    my $ios_cpu = $self->ios_cpu();
 | 
				
			||||||
 | 
					    return $ios_cpu if defined $ios_cpu;
 | 
				
			||||||
 | 
					    my $cat_cpu = $self->cat_cpu();
 | 
				
			||||||
 | 
					    return $cat_cpu;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub cpu_1min {
 | 
				
			||||||
 | 
					    my $self = shift;
 | 
				
			||||||
 | 
					    my $ios_cpu_1min = $self->ios_cpu_1min();
 | 
				
			||||||
 | 
					    return $ios_cpu_1min if defined $ios_cpu_1min;
 | 
				
			||||||
 | 
					    my $cat_cpu_1min = $self->cat_cpu_1min();
 | 
				
			||||||
 | 
					    return $cat_cpu_1min;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub cpu_5min {
 | 
				
			||||||
 | 
					    my $self = shift;
 | 
				
			||||||
 | 
					    my $ios_cpu_5min = $self->ios_cpu_5min();
 | 
				
			||||||
 | 
					    return $ios_cpu_5min if defined $ios_cpu_5min;
 | 
				
			||||||
 | 
					    my $cat_cpu_5min = $self->cat_cpu_5min();
 | 
				
			||||||
 | 
					    return $cat_cpu_5min;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub mem_total {
 | 
				
			||||||
 | 
					    my $self = shift;
 | 
				
			||||||
 | 
					    my $mem_free = $self->mem_free();
 | 
				
			||||||
 | 
					    my $mem_used = $self->mem_used();
 | 
				
			||||||
 | 
					    return undef unless defined $mem_free and defined $mem_used;
 | 
				
			||||||
 | 
					    return $mem_free + $mem_used;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					1;
 | 
				
			||||||
 | 
					__END__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::CiscoStats - Perl5 Interface to CPU and Memory stats for Cisco Devices
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
 | 
					 my $ciscostats = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $class      = $ciscostats->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::CiscoStats is a subclass of SNMP::Info that provides cpu, memory, os and
 | 
				
			||||||
 | 
					version information about Cisco Devices. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Use or create in a subclass of SNMP::Info.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					none.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-PROCESS-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-MEMORY-POOL-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item RFC1213-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cpu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns ios_cpu() or cat_cpu(), whichever is available.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cpu_1min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns ios_cpu_1min() or cat_cpu1min(), whichever is available.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cpu_5min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns ios_cpu_5min() or cat_cpu5min(), whichever is available.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->mem_total()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns mem_free() + mem_used()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Trys to parse if device is running IOS or CatOS from description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Trys to parse device operating system version from description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->ios_cpu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Current CPU usage in percents of device.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<1.3.6.1.4.1.9.2.1.56.0> = 
 | 
				
			||||||
 | 
					B<OLD-CISCO-CPU-MIB:avgBusyPer>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->ios_cpu_1min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Average CPU Usage in percents of device over last minute.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<1.3.6.1.4.1.9.2.1.57.0>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->ios_cpu_5min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Average CPU Usage in percents of device over last 5 minutes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<1.3.6.1.4.1.9.2.1.58.0>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cat_cpu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Current CPU usage in percents of device.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<CISCO-PROCESS-MIB::cpmCPUTotal5sec.9>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cat_cpu_1min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Average CPU Usage in percents of device over last minute.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<CISCO-PROCESS-MIB::cpmCPUTotal1min.9>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->cat_cpu_5min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Average CPU Usage in percents of device over last 5 minutes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<CISCO-PROCESS-MIB::cpmCPUTotal5min.9>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->mem_free()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Main DRAM free in device.  In bytes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolFree.1>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $ciscostats->mem_used()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Main DRAM used in device.  In bytes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<CISCO-MEMORY-POOL-MIB::ciscoMemoryPoolUsed.1>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					None.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
							
								
								
									
										198
									
								
								Info/Entity.pm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								Info/Entity.pm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,198 @@
 | 
				
			|||||||
 | 
					# SNMP::Info::Entity
 | 
				
			||||||
 | 
					# Max Baker <max@warped.org>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (c) 2003 Regents of the University of California
 | 
				
			||||||
 | 
					# All rights reserved.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# Redistribution and use in source and binary forms, with or without 
 | 
				
			||||||
 | 
					# modification, are permitted provided that the following conditions are met:
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					#     * Redistributions of source code must retain the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer.
 | 
				
			||||||
 | 
					#     * Redistributions in binary form must reproduce the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer in the documentation
 | 
				
			||||||
 | 
					#       and/or other materials provided with the distribution.
 | 
				
			||||||
 | 
					#     * Neither the name of the University of California, Santa Cruz nor the 
 | 
				
			||||||
 | 
					#       names of its contributors may be used to endorse or promote products 
 | 
				
			||||||
 | 
					#       derived from this software without specific prior written permission.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 | 
				
			||||||
 | 
					# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 | 
				
			||||||
 | 
					# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
 | 
				
			||||||
 | 
					# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 | 
				
			||||||
 | 
					# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
				
			||||||
 | 
					# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 | 
				
			||||||
 | 
					# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 | 
				
			||||||
 | 
					# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 | 
				
			||||||
 | 
					# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
 | 
				
			||||||
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package SNMP::Info::Entity;
 | 
				
			||||||
 | 
					$VERSION = 0.4;
 | 
				
			||||||
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Exporter;
 | 
				
			||||||
 | 
					use SNMP::Info;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use vars qw/$VERSION $DEBUG %MIBS %FUNCS %GLOBALS %MUNGE $INIT/;
 | 
				
			||||||
 | 
					@SNMP::Info::Entity::ISA = qw/SNMP::Info Exporter/;
 | 
				
			||||||
 | 
					@SNMP::Info::Entity::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$INIT    = 0;
 | 
				
			||||||
 | 
					%MIBS    = ('ENTITY-MIB' => 'entPhysicalSerialNum');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%GLOBALS = (
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%FUNCS   = (
 | 
				
			||||||
 | 
					            'e_class'   => 'entPhysicalClass',
 | 
				
			||||||
 | 
					            'e_descr'   => 'entPhysicalDescr',
 | 
				
			||||||
 | 
					            'e_fwver'   => 'entPhysicalFirmwareRev',
 | 
				
			||||||
 | 
					            'e_hwver'   => 'entPhysicalHardwareRev',
 | 
				
			||||||
 | 
					            'e_map'     => 'entAliasMappingIdentifier',
 | 
				
			||||||
 | 
					            'e_model'   => 'entPhysicalModelName',
 | 
				
			||||||
 | 
					            'e_name'    => 'entPhysicalName',
 | 
				
			||||||
 | 
					            'e_parent'  => 'entPhysicalContainedIn',
 | 
				
			||||||
 | 
					            'e_serial'  => 'entPhysicalSerialNum',
 | 
				
			||||||
 | 
					            'e_swver'   => 'entPhysicalSoftwareRev',
 | 
				
			||||||
 | 
					            'e_type'    => 'entPhysicalVendorType',
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%MUNGE   = (
 | 
				
			||||||
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub e_port {
 | 
				
			||||||
 | 
					    my $entity = shift;
 | 
				
			||||||
 | 
					    my $e_map  = $entity->e_map();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my %e_port;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    foreach my $e_id (keys %$e_map) {
 | 
				
			||||||
 | 
					        my $id = $e_id;
 | 
				
			||||||
 | 
					        $id =~ s/\.0$//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        my $iid = $e_map->{$e_id};
 | 
				
			||||||
 | 
					        $iid =~ s/.*\.//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $e_port{$id} = $iid;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return \%e_port;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::Entity - Perl5 Interface to SNMP data stored in ENTITY-MIB.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
 | 
					 my $entity = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $class      = $entity->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENTITY-MIB is used by some Layer 2 devices like HP Switches and Aironet Access Points
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Create or use a device subclass that inherit this class.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For debugging purposes you can call this class directly as you would SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $entity = new SNMP::Info::Entity (...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					none.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item ENTITY-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					none.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Entity Table
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_class()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalClass>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_descr()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalClass>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_fwver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalFirmwareRev>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_hwver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalHardwareRev>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_map()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entAliasMappingIdentifier>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalModelName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_parent()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalContainedIn>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Maps EntityTable entries to the Interface Table (IfTable) using
 | 
				
			||||||
 | 
					$entity->e_map()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_serial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalSerialNum>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_swver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalSoftwareRev>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $entity->e_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(C<entPhysicalVendorType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::EtherLike;
 | 
					package SNMP::Info::EtherLike;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -52,8 +52,25 @@ $INIT = 0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
%FUNCS = (
 | 
					%FUNCS = (
 | 
				
			||||||
          # EtherLike StatsTable
 | 
					          # EtherLike StatsTable
 | 
				
			||||||
          'el_index'  => 'dot3StatsIndex',
 | 
					          'el_chipset'         => 'dot3StatsEtherChipSet',
 | 
				
			||||||
 | 
					          'el_coll_excess'     => 'dot3StatsExcessiveCollisions',
 | 
				
			||||||
 | 
					          'el_coll_late'       => 'dot3StatsLateCollisions',
 | 
				
			||||||
 | 
					          'el_coll_mult'       => 'dot3StatsMultipleCollisionFrames',
 | 
				
			||||||
 | 
					          'el_coll_single'     => 'dot3StatsSingleCollisionFrames',
 | 
				
			||||||
          'el_duplex'          => 'dot3StatsDuplexStatus',
 | 
					          'el_duplex'          => 'dot3StatsDuplexStatus',
 | 
				
			||||||
 | 
					          'el_error_alignment' => 'dot3StatsAlignmentErrors',
 | 
				
			||||||
 | 
					          'el_error_fcs'       => 'dot3StatsFCSErrors',
 | 
				
			||||||
 | 
					          'el_error_cs'        => 'dot3StatsCarrierSenseErrors',
 | 
				
			||||||
 | 
					          'el_error_frame'     => 'dot3StatsFrameTooLongs',
 | 
				
			||||||
 | 
					          'el_error_mac_rec'   => 'dot3StatsInternalMacReceiveErrors',
 | 
				
			||||||
 | 
					          'el_error_mac_xmit'  => 'dot3StatsInternalMacTransmitErrors',
 | 
				
			||||||
 | 
					          'el_error_sqe'       => 'dot3StatsSQETestErrors',
 | 
				
			||||||
 | 
					          'el_error_symbol'    => 'dot3StatsSymbolErrors',
 | 
				
			||||||
 | 
					          'el_index'           => 'dot3StatsIndex',
 | 
				
			||||||
 | 
					          'el_xmit_defer'      => 'dot3StatsDeferredTransmissions',
 | 
				
			||||||
 | 
					          # Ethernet-like Collision Statistics Group
 | 
				
			||||||
 | 
					          'el_coll_count'      => 'dot3CollCount',
 | 
				
			||||||
 | 
					          'el_coll_freq'       => 'dot3CollFrequencies'
 | 
				
			||||||
          );
 | 
					          );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MUNGE = ( %SNMP::Info::MUNGE );
 | 
					%MUNGE = ( %SNMP::Info::MUNGE );
 | 
				
			||||||
@@ -66,52 +83,77 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB 
 | 
					SNMP::Info::EtherLike - Perl5 Interface to SNMP ETHERLIKE-MIB 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
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.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Use SNMP::Info directly, or create a subclass that inherits this one.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $el = new SNMP::Info::EtherLike(DestHost  => 'myrouter',
 | 
					 my $el = new SNMP::Info ( 
 | 
				
			||||||
                                    Community => 'public');
 | 
					                             AutoSpecify => 1,
 | 
				
			||||||
 | 
					                             Debug       => 1,
 | 
				
			||||||
 | 
					                             DestHost    => 'router', 
 | 
				
			||||||
 | 
					                             Community   => 'public',
 | 
				
			||||||
 | 
					                             Version     => 2
 | 
				
			||||||
 | 
					                           );
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 my $el_decoder = $el->el_index();
 | 
					 my $class = $cdp->class();
 | 
				
			||||||
 | 
					 print " Using device sub class : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Find the duplex setting for a port on a device that implements ETHERLIKE-MIB
 | 
				
			||||||
 | 
					 my $interfaces = $el->interfaces();
 | 
				
			||||||
 | 
					 my $el_index   = $el->el_index();
 | 
				
			||||||
 my $el_duplex  = $el->el_duplex(); 
 | 
					 my $el_duplex  = $el->el_duplex(); 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 foreach my $el_port (keys %$el_duplex){
 | 
				
			||||||
 | 
					    my $duplex = $el_duplex->{$el_port};
 | 
				
			||||||
 | 
					    my $iid    = $el_index->{$el_port};
 | 
				
			||||||
 | 
					    my $port   = $interfaces->{$iid};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $duplex = 'half' if $duplex =~/half/i;
 | 
				
			||||||
 | 
					    $duplex = 'full' if $duplex =~/full/i;
 | 
				
			||||||
 | 
					    $duplex = 'auto' if $duplex =~/auto/i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    print "PORT:$port set to duplex:$duplex\n";
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Use or create a subclass of SNMP::Info that inherits this one.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					None.  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::EtherLike()
 | 
					=item ETHERLIKE-MIB
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $el = new SNMP::Info::EtherLike(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $el;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar values from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item None
 | 
					=item None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 ETHERLIKE STATS TABLE (dot3StatsTable)
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 ETHERLIKE STATS TABLE (dot3StatsTable)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -127,6 +169,70 @@ Returns reference to hash.  Indexes Stats Table to Duplex Status of port.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(B<dot3StatsDuplexStatus>)
 | 
					(B<dot3StatsDuplexStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_chipset()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsEtherChipSet>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_excess()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsExcessiveCollisions>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_late()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsLateCollisions>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_mult()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsMultipleCollisionFrames>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_single()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsSingleCollisionFrames>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_alignment()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsAlignmentErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_fcs()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsFCSErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_cs()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsCarrierSenseErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_frame()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsFrameTooLongs>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_mac_rec()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsInternalMacReceiveErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_mac_xmit()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsInternalMacTransmitErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_sqe()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsSQETestErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_error_symbol()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsSymbolErrors>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_xmit_defer()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3StatsDeferredTransmissions>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_count()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3CollCount>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $el->el_coll_freq()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<dot3CollFrequencies>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										112
									
								
								Info/Layer1.pm
									
									
									
									
									
								
							
							
						
						
									
										112
									
								
								Info/Layer1.pm
									
									
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer1;
 | 
					package SNMP::Info::Layer1;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -163,22 +163,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer1 - Perl5 Interface to Layer1 network devices.
 | 
					SNMP::Info::Layer1 - Perl5 Interface to network devices serving Layer1 only.
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
Layer1 device through SNMP.  Information is stored in a number of MIBs.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from: 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MIBS: 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 MIBS listed in SNMP::Info
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Cisco MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -186,34 +171,72 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $l1 = new SNMP::Info::Layer1(DestHost  => 'mybridge' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $l1 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 1
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $l1->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let's get some basic Port information
 | 
				
			||||||
 | 
					 my $interfaces = $l1->interfaces();
 | 
				
			||||||
 | 
					 my $i_up       = $l1->i_up();
 | 
				
			||||||
 | 
					 my $i_speed    = $l1->i_speed();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 foreach my $iid (keys %$interfaces) {
 | 
				
			||||||
 | 
					    my $port  = $interfaces->{$iid};
 | 
				
			||||||
 | 
					    my $up    = $i_up->{$iid};
 | 
				
			||||||
 | 
					    my $speed = $i_speed->{$iid}
 | 
				
			||||||
 | 
					    print "Port $port is $up. Port runs at $speed.\n";
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This class is usually used as a superclass for more specific device classes listed under 
 | 
				
			||||||
 | 
					SNMP::Info::Layer1::*   Please read all docs under SNMP::Info first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
 | 
					Layer1 device through SNMP.  Information is stored in a number of MIBs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $l1 = new SNMP::Info::Layer1(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer1()
 | 
					=item SNMP::Info
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $l1 = new SNMP::Info::Layer1(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $l1;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head2 Required MIBs 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l1->vendor()
 | 
					=item SNMP-REPEATER-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Trys to discover the vendor from $l1->model() and $l1->vendor()
 | 
					=item Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs required for SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP-REPEATER-MIB needs to be extracted from ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l1->ports_managed()
 | 
					=item $l1->ports_managed()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -221,6 +244,16 @@ Gets the number of ports under the interface mib
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(B<ifNumber>)
 | 
					(B<ifNumber>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $l1->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Trys to discover the vendor from $l1->model() and $l1->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l1->ports()
 | 
					=item $l1->ports()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Adds the values from rptr_ports() and ports_managed()
 | 
					Adds the values from rptr_ports() and ports_managed()
 | 
				
			||||||
@@ -233,8 +266,15 @@ Number of 'groups' in the Repeater MIB
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -279,4 +319,8 @@ Group (slot) Number for given port.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer1::Allied;
 | 
					package SNMP::Info::Layer1::Allied;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -64,6 +64,19 @@ sub vendor {
 | 
				
			|||||||
    return 'allied';
 | 
					    return 'allied';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'allied';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $allied = shift;
 | 
				
			||||||
 | 
					    my $descr = $allied->description();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    if ($descr =~ m/version (\d+\.\d+)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub model {
 | 
					sub model {
 | 
				
			||||||
    my $allied = shift;
 | 
					    my $allied = shift;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -111,57 +124,74 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer1::Allied - SNMP Interface to old Allied Hubs
 | 
					SNMP::Info::Layer1::Allied - SNMP Interface to old Allied Hubs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
Allied device through SNMP. See inherited classes' documentation for 
 | 
					 | 
				
			||||||
inherited methods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info::Layer1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Required MIBs:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 ATI-MIB - Download for your device from http://www.allied-telesyn.com/allied/support/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 MIBs listed in SNMP::Info::Layer1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $allied = new SNMP::Info::Layer1::Allied(DestHost  => 'mycat1900' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $allied = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myhub',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 1
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $l1->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
 | 
					Allied device through SNMP. See inherited classes' documentation for 
 | 
				
			||||||
 | 
					inherited methods.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer1::Allied()
 | 
					=item SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $allied = new SNMP::Info::Layer1::Allied(
 | 
					=over
 | 
				
			||||||
        DestHost => $host,
 | 
					
 | 
				
			||||||
        Community => 'public',
 | 
					=item ATI-MIB 
 | 
				
			||||||
        Version => 3,...
 | 
					
 | 
				
			||||||
        ) 
 | 
					Download for your device from http://www.allied-telesyn.com/allied/support/
 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $allied;
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs listed in SNMP::Info::Layer1 and its inherited classes.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $allied->vendor()
 | 
					=item $allied->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns 'allied' :)
 | 
					Returns 'allied' :)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $allied->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns 'allied' 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $allied->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Culls Version from description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $allied->root_ip()
 | 
					=item $allied->root_ip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns IP Address of Managed Hub.
 | 
					Returns IP Address of Managed Hub.
 | 
				
			||||||
@@ -174,6 +204,10 @@ Trys to cull out AT-nnnnX out of the description field.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Global Methods imported from SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer1 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
@@ -205,4 +239,8 @@ the values of ati_up() to 'up' and 'down'.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer1 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer1::Asante;
 | 
					package SNMP::Info::Layer1::Asante;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -80,6 +80,19 @@ sub interfaces {
 | 
				
			|||||||
    return \%interfaces;
 | 
					    return \%interfaces;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'asante';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $asante = shift;
 | 
				
			||||||
 | 
					    my $descr = $asante->description();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    if ($descr =~ /software v(\d+\.\d+)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
sub vendor {
 | 
					sub vendor {
 | 
				
			||||||
    return 'asante';
 | 
					    return 'asante';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -154,53 +167,65 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer1::Asante - SNMP Interface to old Asante 1012 Hubs
 | 
					SNMP::Info::Layer1::Asante - SNMP Interface to old Asante 1012 Hubs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
Asante device through SNMP. See inherited classes' documentation for 
 | 
					 | 
				
			||||||
inherited methods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info::Layer1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Required MIBs:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ASANTE-HUB1012-MIB - Download from http://www.mibdepot.com
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 MIBs listed in SNMP::Info::Layer1
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $asante = new SNMP::Info::Layer1::Asante(DestHost  => 'mycat1900' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $asante = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $asante->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
 | 
					Asante device through SNMP.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer1::Asante()
 | 
					=item SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $asante = new SNMP::Info::Layer1::Asante(
 | 
					=over
 | 
				
			||||||
        DestHost => $host,
 | 
					
 | 
				
			||||||
        Community => 'public',
 | 
					=item ASANTE-HUB1012-MIB
 | 
				
			||||||
        Version => 3,...
 | 
					
 | 
				
			||||||
        ) 
 | 
					Download from http://www.mibdepot.com
 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $asante;
 | 
					
 | 
				
			||||||
 | 
					=items MIBs listed in SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $asante->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns 'asante'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $asante->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Culls software version from description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $asante->vendor()
 | 
					=item $asante->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns 'asante' :)
 | 
					Returns 'asante' :)
 | 
				
			||||||
@@ -217,6 +242,10 @@ Trys to cull out AT-nnnnX out of the description field.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals inherited from SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer1 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
@@ -248,4 +277,8 @@ the values of ati_up() to 'up' and 'down'.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer1 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										154
									
								
								Info/Layer2.pm
									
									
									
									
									
								
							
							
						
						
									
										154
									
								
								Info/Layer2.pm
									
									
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2;
 | 
					package SNMP::Info::Layer2;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -37,10 +37,11 @@ use Exporter;
 | 
				
			|||||||
use SNMP::Info;
 | 
					use SNMP::Info;
 | 
				
			||||||
use SNMP::Info::Bridge;
 | 
					use SNMP::Info::Bridge;
 | 
				
			||||||
use SNMP::Info::CDP;
 | 
					use SNMP::Info::CDP;
 | 
				
			||||||
 | 
					use SNMP::Info::CiscoStats;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/;
 | 
					use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@SNMP::Info::Layer2::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::CDP Exporter/;
 | 
					@SNMP::Info::Layer2::ISA = qw/SNMP::Info SNMP::Info::Bridge SNMP::Info::CDP SNMP::Info::CiscoStats Exporter/;
 | 
				
			||||||
@SNMP::Info::Layer2::EXPORT_OK = qw//;
 | 
					@SNMP::Info::Layer2::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$DEBUG=0;
 | 
					$DEBUG=0;
 | 
				
			||||||
@@ -53,21 +54,23 @@ $INIT = 0;
 | 
				
			|||||||
%MIBS = ( %SNMP::Info::MIBS, 
 | 
					%MIBS = ( %SNMP::Info::MIBS, 
 | 
				
			||||||
          %SNMP::Info::Bridge::MIBS,
 | 
					          %SNMP::Info::Bridge::MIBS,
 | 
				
			||||||
          %SNMP::Info::CDP::MIBS,
 | 
					          %SNMP::Info::CDP::MIBS,
 | 
				
			||||||
 | 
					          %SNMP::Info::CiscoStats::MIBS,
 | 
				
			||||||
          'CISCO-PRODUCTS-MIB' => 'sysName',
 | 
					          'CISCO-PRODUCTS-MIB' => 'sysName',
 | 
				
			||||||
          'CISCO-STACK-MIB'    => 'wsc1900sysID',
 | 
					          'CISCO-STACK-MIB'    => 'wsc1900sysID',
 | 
				
			||||||
#          'HP-ICF-OID'         => 'hpSwitch4000',
 | 
					 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%GLOBALS = (
 | 
					%GLOBALS = (
 | 
				
			||||||
            %SNMP::Info::GLOBALS,
 | 
					            %SNMP::Info::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::Bridge::GLOBALS,
 | 
					            %SNMP::Info::Bridge::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::CDP::GLOBALS,
 | 
					            %SNMP::Info::CDP::GLOBALS,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::GLOBALS,
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%FUNCS   = (
 | 
					%FUNCS   = (
 | 
				
			||||||
            %SNMP::Info::FUNCS,
 | 
					            %SNMP::Info::FUNCS,
 | 
				
			||||||
            %SNMP::Info::Bridge::FUNCS,
 | 
					            %SNMP::Info::Bridge::FUNCS,
 | 
				
			||||||
            %SNMP::Info::CDP::FUNCS,
 | 
					            %SNMP::Info::CDP::FUNCS,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::FUNCS,
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MUNGE = (
 | 
					%MUNGE = (
 | 
				
			||||||
@@ -75,6 +78,7 @@ $INIT = 0;
 | 
				
			|||||||
            %SNMP::Info::MUNGE,
 | 
					            %SNMP::Info::MUNGE,
 | 
				
			||||||
            %SNMP::Info::Bridge::MUNGE,
 | 
					            %SNMP::Info::Bridge::MUNGE,
 | 
				
			||||||
            %SNMP::Info::CDP::MUNGE,
 | 
					            %SNMP::Info::CDP::MUNGE,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::MUNGE,
 | 
				
			||||||
         );
 | 
					         );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Method OverRides
 | 
					# Method OverRides
 | 
				
			||||||
@@ -160,31 +164,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2 - Perl5 Interface to Layer2 network devices.
 | 
					SNMP::Info::Layer2 - Perl5 Interface to network devices serving Layer2 only.
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
Layer2 device through SNMP.  Information is stored in a number of MIBs.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
See super classes for descriptions of other available methods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from: 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info
 | 
					 | 
				
			||||||
 SNMP::Info::Bridge
 | 
					 | 
				
			||||||
 SNMP::Info::CDP
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MIBS: 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 CISCO-PRODUCTS-MIB - Needed for ID of Cisco Products
 | 
					 | 
				
			||||||
 CISCO-STACK-MIB    - Needed for ID of Cisco Products
 | 
					 | 
				
			||||||
 ##HP-ICF-OID         - Needed for ID of HP    Products
 | 
					 | 
				
			||||||
 MIBS listed in SNMP::Info::Bridge and SNMP::Info::CDP
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Cisco MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HP MIBs can be found at http://www.hp.com/rnd/software
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -192,35 +172,90 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $l2 = new SNMP::Info::Layer2(DestHost  => 'mybridge' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $l2 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $l2->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let's get some basic Port information
 | 
				
			||||||
 | 
					 my $interfaces = $l2->interfaces();
 | 
				
			||||||
 | 
					 my $i_up       = $l2->i_up();
 | 
				
			||||||
 | 
					 my $i_speed    = $l2->i_speed();
 | 
				
			||||||
 | 
					 foreach my $iid (keys %$interfaces) {
 | 
				
			||||||
 | 
					    my $port  = $interfaces->{$iid};
 | 
				
			||||||
 | 
					    my $up    = $i_up->{$iid};
 | 
				
			||||||
 | 
					    my $speed = $i_speed->{$iid}
 | 
				
			||||||
 | 
					    print "Port $port is $up. Port runs at $speed.\n";
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This class is usually used as a superclass for more specific device classes listed under 
 | 
				
			||||||
 | 
					SNMP::Info::Layer2::*   Please read all docs under SNMP::Info first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
 | 
					Layer2 device through SNMP.  Information is stored in a number of MIBs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $l2 = new SNMP::Info::Layer2(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer2()
 | 
					=item SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=item SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $l2 = new SNMP::Info::Layer2(
 | 
					=item SNMP::Info::CiscoStats
 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $l2;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-PRODUCTS-MIB 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Needed for ID of Cisco Products
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-STACK-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Needed for ID of Cisco Products
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs required by the inherited classes listed above.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l2->model()
 | 
					=item $l2->model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Cross references $l2->id() with product IDs in the 
 | 
					Cross references $l2->id() with product IDs in the 
 | 
				
			||||||
Cisco and HP specific MIBs.
 | 
					Cisco MIBs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
For HP devices, removes 'hpswitch' from the name
 | 
					For HP devices, removes 'hpswitch' from the name
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -228,11 +263,30 @@ For Cisco devices, removes 'sysid' from the name
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=item $l2->vendor()
 | 
					=item $l2->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Trys to discover the vendor from $l2->model() and $l2->vendor()
 | 
					Trys to discover the vendor from $l2->model() and $l2->description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head2 Globals imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CDP for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::CiscoStats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CiscoStats for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -252,4 +306,20 @@ Ignores ports with B<ifType> of loopback,propvirtual,other, and cpu
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CDP for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::CiscoStats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CiscoStats for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										238
									
								
								Info/Layer2/Aironet.pm
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										238
									
								
								Info/Layer2/Aironet.pm
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,238 @@
 | 
				
			|||||||
 | 
					# SNMP::Info::Layer2::Aironet
 | 
				
			||||||
 | 
					# Max Baker <max@warped.org>
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Copyright (c) 2003 Regents of the University of California
 | 
				
			||||||
 | 
					# All rights reserved.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# Redistribution and use in source and binary forms, with or without 
 | 
				
			||||||
 | 
					# modification, are permitted provided that the following conditions are met:
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					#     * Redistributions of source code must retain the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer.
 | 
				
			||||||
 | 
					#     * Redistributions in binary form must reproduce the above copyright notice,
 | 
				
			||||||
 | 
					#       this list of conditions and the following disclaimer in the documentation
 | 
				
			||||||
 | 
					#       and/or other materials provided with the distribution.
 | 
				
			||||||
 | 
					#     * Neither the name of the University of California, Santa Cruz nor the 
 | 
				
			||||||
 | 
					#       names of its contributors may be used to endorse or promote products 
 | 
				
			||||||
 | 
					#       derived from this software without specific prior written permission.
 | 
				
			||||||
 | 
					# 
 | 
				
			||||||
 | 
					# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 | 
				
			||||||
 | 
					# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
 | 
				
			||||||
 | 
					# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 
 | 
				
			||||||
 | 
					# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
 | 
				
			||||||
 | 
					# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 | 
				
			||||||
 | 
					# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 | 
				
			||||||
 | 
					# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 | 
				
			||||||
 | 
					# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 | 
				
			||||||
 | 
					# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
 | 
				
			||||||
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					package SNMP::Info::Layer2::Aironet;
 | 
				
			||||||
 | 
					$VERSION = 0.4;
 | 
				
			||||||
 | 
					# $Id$
 | 
				
			||||||
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Exporter;
 | 
				
			||||||
 | 
					use SNMP::Info::Layer2;
 | 
				
			||||||
 | 
					use SNMP::Info::Entity;
 | 
				
			||||||
 | 
					use SNMP::Info::EtherLike;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@SNMP::Info::Layer2::Aironet::ISA = qw/SNMP::Info::Layer2 SNMP::Info::Entity SNMP::Info::EtherLike Exporter/;
 | 
				
			||||||
 | 
					@SNMP::Info::Layer2::Aironet::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Set for No CDP
 | 
				
			||||||
 | 
					%GLOBALS = (
 | 
				
			||||||
 | 
					            %SNMP::Info::Layer2::GLOBALS,
 | 
				
			||||||
 | 
					            %SNMP::Info::Entity::GLOBALS,
 | 
				
			||||||
 | 
					            %SNMP::Info::EtherLike::GLOBALS,
 | 
				
			||||||
 | 
					            'serial' => 'entPhysicalSerialNum.1',
 | 
				
			||||||
 | 
					            'descr'  => 'sysDescr'
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%FUNCS   = (%SNMP::Info::Layer2::FUNCS,
 | 
				
			||||||
 | 
					            %SNMP::Info::Entity::FUNCS,
 | 
				
			||||||
 | 
					            %SNMP::Info::EtherLike::FUNCS
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%MIBS    = (
 | 
				
			||||||
 | 
					            %SNMP::Info::Layer2::MIBS,
 | 
				
			||||||
 | 
					            %SNMP::Info::Entity::MIBS,
 | 
				
			||||||
 | 
					            %SNMP::Info::EtherLike::MIBS
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					%MUNGE   = (%SNMP::Info::Layer2::MUNGE,
 | 
				
			||||||
 | 
					            %SNMP::Info::Entity::MUNGE,
 | 
				
			||||||
 | 
					            %SNMP::Info::EtherLike::MUNGE
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub vendor {
 | 
				
			||||||
 | 
					    # Sorry, but it's true.
 | 
				
			||||||
 | 
					    return 'cisco';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub interfaces {
 | 
				
			||||||
 | 
					    my $aironet = shift;
 | 
				
			||||||
 | 
					    my $i_description = $aironet->i_description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return $i_description;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Tag on e_descr.1
 | 
				
			||||||
 | 
					sub description {
 | 
				
			||||||
 | 
					    my $aironet = shift;
 | 
				
			||||||
 | 
					    my $descr = $aironet->descr();
 | 
				
			||||||
 | 
					    my $e_descr = $aironet->e_descr();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $descr = "$e_descr->{1}  $descr" if defined $e_descr->{1};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return $descr;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Fetch duplex from EtherLike
 | 
				
			||||||
 | 
					sub i_duplex {
 | 
				
			||||||
 | 
					    my $aironet = shift;
 | 
				
			||||||
 | 
					    my $el_duplex = $aironet->el_duplex();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my %i_duplex;
 | 
				
			||||||
 | 
					    foreach my $d (keys %$el_duplex){
 | 
				
			||||||
 | 
					        my $val = $el_duplex->{$d};
 | 
				
			||||||
 | 
					        next unless defined $val;
 | 
				
			||||||
 | 
					        $i_duplex{$d} = 'full' if $val =~ /full/i;
 | 
				
			||||||
 | 
					        $i_duplex{$d} = 'half' if $val =~ /half/i;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return \%i_duplex;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					1;
 | 
				
			||||||
 | 
					__END__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::Layer2::Aironet - SNMP Interface to Cisco Aironet devices running IOS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
 | 
					 my $aironet = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $class      = $aironet->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides interface to SNMP Data available on newer Aironet devices running Cisco IOS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note there are two classes for Aironet devices :
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::Layer3::Aironet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This class is for devices running Aironet software (older)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::Layer2::Aironet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This class is for devices running Cisco IOS software (newer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					my $aironet = new SNMP::Info::Layer2::Aironet(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::EtherLike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs required by the inherited classes listed above.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->discription()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds info from method e_descr() from SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Returns 'cisco' :)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Entity for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::EtherLike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::EtherLike for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->interfaces()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Uses the i_description() field.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->i_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Crosses information from SNMP::Info::EtherLike to get duplex info for interfaces.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Entity for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::EtherLike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::EtherLike for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2::Bay;
 | 
					package SNMP::Info::Layer2::Bay;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -73,6 +73,42 @@ $SNMP::Info::SPEED_MAP{200_000_000} = '100 Mbps';
 | 
				
			|||||||
            'i_mac2' => \&SNMP::Info::munge_mac ,
 | 
					            'i_mac2' => \&SNMP::Info::munge_mac ,
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'bay';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $bay = shift;
 | 
				
			||||||
 | 
					    my $descr = $bay->description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # 303 / 304
 | 
				
			||||||
 | 
					    if ($descr =~ m/Rev: \d+\.\d+\.\d+\.\d+-(\d+\.\d+\.\d+\.\d+)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # 450
 | 
				
			||||||
 | 
					    if ($descr =~ m/SW:v(\d+\.\d+\.\d+\.\d+)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_bin {
 | 
				
			||||||
 | 
					    my $bay = shift;
 | 
				
			||||||
 | 
					    my $descr = $bay->description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # 303 / 304
 | 
				
			||||||
 | 
					    if ($descr =~ m/Rev: \d+\.(\d+\.\d+\.\d+)-\d+\.\d+\.\d+\.\d+/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # 450
 | 
				
			||||||
 | 
					    if ($descr =~ m/FW:v(\d+\.\d+\.\d+\.\d+)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub vendor {
 | 
					sub vendor {
 | 
				
			||||||
    # or nortel, or synopsis?
 | 
					    # or nortel, or synopsis?
 | 
				
			||||||
    return 'bay';
 | 
					    return 'bay';
 | 
				
			||||||
@@ -136,6 +172,7 @@ sub c_if {
 | 
				
			|||||||
    my %c_if;
 | 
					    my %c_if;
 | 
				
			||||||
    foreach my $entry (keys %$bay_topo_port){
 | 
					    foreach my $entry (keys %$bay_topo_port){
 | 
				
			||||||
        my $port = $bay_topo_port->{$entry};
 | 
					        my $port = $bay_topo_port->{$entry};
 | 
				
			||||||
 | 
					        next unless defined $port;
 | 
				
			||||||
        next if $port == 0;
 | 
					        next if $port == 0;
 | 
				
			||||||
        $c_if{"$port.1"} = $port;
 | 
					        $c_if{"$port.1"} = $port;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -154,6 +191,7 @@ sub c_ip {
 | 
				
			|||||||
    my %ip_port;
 | 
					    my %ip_port;
 | 
				
			||||||
    foreach my $entry (keys %$bay_topo_ip){
 | 
					    foreach my $entry (keys %$bay_topo_ip){
 | 
				
			||||||
        my $port = $bay_topo_port->{$entry};
 | 
					        my $port = $bay_topo_port->{$entry};
 | 
				
			||||||
 | 
					        next unless defined $port;
 | 
				
			||||||
        next if $port == 0;
 | 
					        next if $port == 0;
 | 
				
			||||||
        my $ip   = $bay_topo_ip->{$entry};
 | 
					        my $ip   = $bay_topo_ip->{$entry};
 | 
				
			||||||
        push(@{$ip_port{$port}},$ip);
 | 
					        push(@{$ip_port{$port}},$ip);
 | 
				
			||||||
@@ -180,6 +218,7 @@ sub c_port {
 | 
				
			|||||||
    my %c_port;
 | 
					    my %c_port;
 | 
				
			||||||
    foreach my $entry (keys %$bay_topo_seg){
 | 
					    foreach my $entry (keys %$bay_topo_seg){
 | 
				
			||||||
        my $port = $bay_topo_port->{$entry};
 | 
					        my $port = $bay_topo_port->{$entry};
 | 
				
			||||||
 | 
					        next unless defined $port;
 | 
				
			||||||
        next if $port == 0;
 | 
					        next if $port == 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # For fake remotes (multiple IPs for a c_ip), use first found
 | 
					        # For fake remotes (multiple IPs for a c_ip), use first found
 | 
				
			||||||
@@ -223,22 +262,59 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2::Bay - SNMP Interface to old Bay Network Switches
 | 
					SNMP::Info::Layer2::Bay - SNMP Interface to old Bay Network BayStack Switches
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
 | 
					 my $bay = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $class      = $bay->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
Bay device through SNMP. 
 | 
					Bay device through SNMP. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Inherits from 
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 SNMP::Info::Layer2
 | 
					 my $bay = new SNMP::Info::Layer2::Bay(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Required MIBs:
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 SYNOPTICS-ROOT-MIB
 | 
					=over
 | 
				
			||||||
 S5-ETH-MULTISEG-TOPOLOGY-MIB
 | 
					
 | 
				
			||||||
 MIBS listed in SNMP::Info::Layer2
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SYNOPTICS-ROOT-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item S5-ETH-MULTISEG-TOPOLOGY-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs required by SNMP::Info::Layer2 and its superclasses.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Bay MIBs can be found on the CD that came with your product.
 | 
					Bay MIBs can be found on the CD that came with your product.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -247,39 +323,12 @@ www.nortelnetworks.com
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
They have also been seen at : http://www.inotech.com/mibs/vendor/baynetworks/synoptics/synoptics.asp
 | 
					They have also been seen at : http://www.inotech.com/mibs/vendor/baynetworks/synoptics/synoptics.asp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Or http://www.oidview.com/mibs/detail.html under Synoptics.
 | 
					Or http://www.oidview.com/mibs/detail.html under Synoptics.  Check also www.mibdepot.com
 | 
				
			||||||
 | 
					 | 
				
			||||||
You will need at least the two listed above, and probably a few more.  
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 SYNOPSIS
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 my $bay = new SNMP::Info::Layer2::Bay(DestHost  => 'mybayswitch' , 
 | 
					 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=over
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item  new SNMP::Info::Layer2::Bay()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $bay = new SNMP::Info::Layer2::Bay(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $bay;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=back
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $bay->vendor()
 | 
					=item $bay->vendor()
 | 
				
			||||||
@@ -308,8 +357,15 @@ Returns if the S5-ETH-MULTISEG-TOPOLOGY info is on for this device.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -416,4 +472,8 @@ Returns reference to hash.  Key: Table entry, Value:Boolean, if bay_topo_seg() i
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2::C1900;
 | 
					package SNMP::Info::Layer2::C1900;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -42,11 +42,13 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Set for No CDP
 | 
					# Set for No CDP
 | 
				
			||||||
%GLOBALS = (
 | 
					%GLOBALS = (
 | 
				
			||||||
            %SNMP::Info::Layer2::GLOBALS
 | 
					            %SNMP::Info::Layer2::GLOBALS,
 | 
				
			||||||
 | 
					            'c1900_flash_status'    => 'upgradeFlashBankStatus',
 | 
				
			||||||
            );
 | 
					            );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%FUNCS   = (%SNMP::Info::Layer2::FUNCS,
 | 
					%FUNCS   = (%SNMP::Info::Layer2::FUNCS,
 | 
				
			||||||
            'i_type2'              => 'ifType',
 | 
					            'i_type2'              => 'ifType',
 | 
				
			||||||
 | 
					            'i_name2'              => 'ifName',
 | 
				
			||||||
            # ESSWITCH-MIB
 | 
					            # ESSWITCH-MIB
 | 
				
			||||||
            'c1900_p_index'        => 'swPortIndex',
 | 
					            'c1900_p_index'        => 'swPortIndex',
 | 
				
			||||||
            'c1900_p_ifindex'      => 'swPortIfIndex',
 | 
					            'c1900_p_ifindex'      => 'swPortIfIndex',
 | 
				
			||||||
@@ -70,6 +72,35 @@ use vars qw/$VERSION %FUNCS %GLOBALS %MIBS %MUNGE $AUTOLOAD $INIT $DEBUG/;
 | 
				
			|||||||
sub vendor {
 | 
					sub vendor {
 | 
				
			||||||
    return 'cisco';
 | 
					    return 'cisco';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'catalyst';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $c1900 = shift;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Check for superclass one
 | 
				
			||||||
 | 
					    my $os_ver = $c1900->SUPER::os_ver();
 | 
				
			||||||
 | 
					    return $os_ver if defined $os_ver;
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    my $c1900_flash_status = $c1900->c1900_flash_status();
 | 
				
			||||||
 | 
					    return undef unless defined $c1900_flash_status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if ($c1900_flash_status =~ m/V(\d+\.\d+(\.\d+)?)/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }  
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub interfaces {
 | 
				
			||||||
 | 
					    my $c1900 = shift;
 | 
				
			||||||
 | 
					    my $i_descr = $c1900->i_description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    foreach my $iid (keys %$i_descr){
 | 
				
			||||||
 | 
					        $i_descr->{$iid} =~ s/\s*$//;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return $i_descr;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub i_duplex {
 | 
					sub i_duplex {
 | 
				
			||||||
    my $c1900 = shift;
 | 
					    my $c1900 = shift;
 | 
				
			||||||
@@ -143,29 +174,26 @@ sub i_type {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return $i_type;
 | 
					    return $i_type;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub i_name {
 | 
				
			||||||
 | 
					    my $c1900 = shift;
 | 
				
			||||||
 | 
					    my $i_name = $c1900->i_name2();
 | 
				
			||||||
 | 
					    my $c1900_p_name = $c1900->c1900_p_name();
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    foreach my $port (keys %$c1900_p_name){
 | 
				
			||||||
 | 
					        my $name = $c1900_p_name->{$port};
 | 
				
			||||||
 | 
					        next unless defined $name;
 | 
				
			||||||
 | 
					        next unless $name !~ /^\s*$/;
 | 
				
			||||||
 | 
					        $i_name->{$port} = $name;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    return $i_name;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
__END__
 | 
					__END__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2::C1900 - SNMP Interface to old C1900 Network Switches
 | 
					SNMP::Info::Layer2::C1900 - Perl5 Interface to SNMP data from Cisco Catlyst 1900 Network Switches running CatOS
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
C1900 device through SNMP. See inherited classes' documentation for 
 | 
					 | 
				
			||||||
inherited methods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info::Layer2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Required MIBs:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB)
 | 
					 | 
				
			||||||
 MIBs listed in SNMP::Info::Layer2
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
ESSWITCH-MIB is included in the Version 1 MIBS from Cisco.
 | 
					 | 
				
			||||||
They can be found at ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -173,37 +201,90 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $c1900 = new SNMP::Info::Layer2::C1900(DestHost  => 'mycat1900' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $c1900 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 1
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $c1900->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 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
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer2::C1900()
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $c1900 = new SNMP::Info::Layer2::C1900(
 | 
					=over
 | 
				
			||||||
        DestHost => $host,
 | 
					
 | 
				
			||||||
        Community => 'public',
 | 
					=item STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB)
 | 
				
			||||||
        Version => 3,...
 | 
					
 | 
				
			||||||
        ) 
 | 
					ESSWITCH-MIB is included in the Version 1 MIBS from Cisco.
 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $c1900;
 | 
					
 | 
				
			||||||
 | 
					They can be found at ftp://ftp.cisco.com/pub/mibs/v1/v1.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes' MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs listed in SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $c1900->c1900_flash_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Usually contains the version of the software loaded in flash.
 | 
				
			||||||
 | 
					Used by os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<STAND-ALONE-ETHERNET-SWITCH-MIB::upgradeFlashBankStatus>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $c1900->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns 'catalyst'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $c1900->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns CatOS version if obtainable.  First tries to use 
 | 
				
			||||||
 | 
					SNMP::Info::CiscoStats->os_ver() .  If that fails then it 
 | 
				
			||||||
 | 
					checks for the presence of $c1900->c1900_flash_status() and culls
 | 
				
			||||||
 | 
					the version from there.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c1900->vendor()
 | 
					=item $c1900->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns 'cisco' :)
 | 
					Returns 'cisco' :)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
@@ -222,6 +303,10 @@ Returns reference to hash of IIDs to admin duplex setting
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Crosses $c1900->c1900_p_index() with $c1900->c1900_p_duplex_admin;
 | 
					Crosses $c1900->c1900_p_index() with $c1900->c1900_p_duplex_admin;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $c1900->i_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Crosses ifName with c1900_p_name() and returns the human set port name if exists.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c1900->i_type()
 | 
					=item $c1900->i_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns reference to hash of IID to port type
 | 
					Returns reference to hash of IID to port type
 | 
				
			||||||
@@ -280,4 +365,8 @@ B<swPortConnectorType>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2::C2900;
 | 
					package SNMP::Info::Layer2::C2900;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -138,16 +138,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2::C2900 - SNMP Interface to Cisco Catalyst 2900 Network Switches
 | 
					SNMP::Info::Layer2::C2900 - SNMP Interface to Cisco Catalyst 2900 Switches running IOS
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
C2900 device through SNMP. 
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MIBS:  CISCO-C2900-MIB
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits all SNMP::Info::Layer2 methods.
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -155,29 +146,54 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $c2900 = new SNMP::Info::Layer2::C2900(DestHost  => 'mycat2900' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $c2900 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $c2900->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					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
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer2::C2900()
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $c2900 = new SNMP::Info::Layer2::C2900(
 | 
					=over
 | 
				
			||||||
        DestHost => $host,
 | 
					
 | 
				
			||||||
        Community => 'public',
 | 
					=item CISCO-C2900-MIB
 | 
				
			||||||
        Version => 3,...
 | 
					
 | 
				
			||||||
        ) 
 | 
					Part of the v2 MIBs from Cisco.
 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $c2900;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c2900->vendor()
 | 
					=item $c2900->vendor()
 | 
				
			||||||
@@ -186,8 +202,15 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -250,5 +273,8 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2::Catalyst;
 | 
					package SNMP::Info::Layer2::Catalyst;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -36,8 +36,7 @@ use strict;
 | 
				
			|||||||
use Exporter;
 | 
					use Exporter;
 | 
				
			||||||
use SNMP::Info::Layer2;
 | 
					use SNMP::Info::Layer2;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT 
 | 
					use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MUNGE $INIT/ ;
 | 
				
			||||||
            %MYGLOBALS %MYMIBS %MYFUNCS %MYMUNGE %MUNGE $INIT/ ;
 | 
					 | 
				
			||||||
@SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::Layer2 Exporter/;
 | 
					@SNMP::Info::Layer2::Catalyst::ISA = qw/SNMP::Info::Layer2 Exporter/;
 | 
				
			||||||
@SNMP::Info::Layer2::Catalyst::EXPORT_OK = qw//;
 | 
					@SNMP::Info::Layer2::Catalyst::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -47,34 +46,29 @@ $DEBUG=0;
 | 
				
			|||||||
#       the interworkings.
 | 
					#       the interworkings.
 | 
				
			||||||
$INIT = 0;
 | 
					$INIT = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MYMIBS = (
 | 
					%MIBS =    ( %SNMP::Info::Layer2::MIBS, 
 | 
				
			||||||
             'CISCO-STACK-MIB' => 'moduleType',
 | 
					             'CISCO-STACK-MIB' => 'moduleType',
 | 
				
			||||||
             'CISCO-VTP-MIB'   => 'vtpVlanIndex'
 | 
					             'CISCO-VTP-MIB'   => 'vtpVlanIndex'
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MIBS = ( %SNMP::Info::Layer2::MIBS, 
 | 
					%GLOBALS = (
 | 
				
			||||||
          %MYMIBS );
 | 
					            %SNMP::Info::Layer2::GLOBALS,
 | 
				
			||||||
 | 
					 | 
				
			||||||
%MYGLOBALS = (
 | 
					 | 
				
			||||||
            # these are in CISCO-STACK-MIB
 | 
					            # these are in CISCO-STACK-MIB
 | 
				
			||||||
            'sysip'       => 'sysIpAddr',    
 | 
					            'sysip'       => 'sysIpAddr',    
 | 
				
			||||||
            'netmask'     => 'sysNetMask',    
 | 
					            'netmask'     => 'sysNetMask',    
 | 
				
			||||||
            'broadcast'   => 'sysBroadcast',
 | 
					            'broadcast'   => 'sysBroadcast',
 | 
				
			||||||
            'serial'      => 'chassisSerialNumberString',    
 | 
					            'serial'      => 'chassisSerialNumber',    
 | 
				
			||||||
            'model'       => 'chassisModel',    
 | 
					            'model'       => 'chassisModel',    
 | 
				
			||||||
            'ps1_type'    => 'chassisPs1Type',    
 | 
					            'ps1_type'    => 'chassisPs1Type',    
 | 
				
			||||||
            'ps1_status'  => 'chassisPs1Status',    
 | 
					            'ps1_status'  => 'chassisPs1Status',    
 | 
				
			||||||
            'ps2_type'    => 'chassisPs2Type',    
 | 
					            'ps2_type'    => 'chassisPs2Type',    
 | 
				
			||||||
            'ps2_status'  => 'chassisPs2Status',    
 | 
					            'ps2_status'  => 'chassisPs2Status',    
 | 
				
			||||||
            'slots'       => 'chassisNumSlots',    
 | 
					            'slots'       => 'chassisNumSlots',    
 | 
				
			||||||
            'fan'         => 'chassisFanStatus'
 | 
					            'fan'         => 'chassisFanStatus',
 | 
				
			||||||
             );
 | 
					 | 
				
			||||||
%GLOBALS = (
 | 
					 | 
				
			||||||
            %SNMP::Info::Layer2::GLOBALS,
 | 
					 | 
				
			||||||
            %MYGLOBALS
 | 
					 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MYFUNCS = (
 | 
					%FUNCS =   (
 | 
				
			||||||
 | 
					            %SNMP::Info::Layer2::FUNCS,
 | 
				
			||||||
            'i_type2'        => 'ifType',
 | 
					            'i_type2'        => 'ifType',
 | 
				
			||||||
            # CISCO-STACK-MIB::moduleEntry
 | 
					            # CISCO-STACK-MIB::moduleEntry
 | 
				
			||||||
            #   These are blades in a catalyst device
 | 
					            #   These are blades in a catalyst device
 | 
				
			||||||
@@ -109,20 +103,11 @@ $INIT = 0;
 | 
				
			|||||||
            'v_name'    => 'vtpVlanName',
 | 
					            'v_name'    => 'vtpVlanName',
 | 
				
			||||||
            'v_mtu'     => 'vtpVlanMtu',
 | 
					            'v_mtu'     => 'vtpVlanMtu',
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
%FUNCS   = (
 | 
					 | 
				
			||||||
            %SNMP::Info::Layer2::FUNCS,
 | 
					 | 
				
			||||||
            %MYFUNCS
 | 
					 | 
				
			||||||
        );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
%MYMUNGE = (
 | 
					 | 
				
			||||||
            'm_ports_status' => \&munge_port_status,
 | 
					 | 
				
			||||||
            'p_duplex_admin' => \&SNMP::Info::munge_bits,
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MUNGE =   (
 | 
					%MUNGE =   (
 | 
				
			||||||
            # Inherit all the built in munging
 | 
					 | 
				
			||||||
            %SNMP::Info::Layer2::MUNGE,
 | 
					            %SNMP::Info::Layer2::MUNGE,
 | 
				
			||||||
            %MYMUNGE
 | 
					            'm_ports_status' => \&munge_port_status,
 | 
				
			||||||
 | 
					            'p_duplex_admin' => \&SNMP::Info::munge_bits,
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%PORTSTAT = (1 => 'other',
 | 
					%PORTSTAT = (1 => 'other',
 | 
				
			||||||
@@ -250,6 +235,23 @@ sub vendor {
 | 
				
			|||||||
    return 'cisco';
 | 
					    return 'cisco';
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'catalyst';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $cat = shift;
 | 
				
			||||||
 | 
					    my $os_ver = $cat->SUPER::os_ver();
 | 
				
			||||||
 | 
					    return $os_ver if defined $os_ver;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my $m_swver = $cat->m_swver();
 | 
				
			||||||
 | 
					    return undef unless defined $m_swver;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # assume .1 entry is the chassis and the sw version we want.
 | 
				
			||||||
 | 
					    return $m_swver->{1} if defined $m_swver->{1};
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1;
 | 
					1;
 | 
				
			||||||
__END__
 | 
					__END__
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -257,73 +259,121 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2::Catalyst - Perl5 Interface to Cisco devices running Catalyst OS 
 | 
					SNMP::Info::Layer2::Catalyst - Perl5 Interface to Cisco devices running Catalyst OS 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
Catalyst device through SNMP.  Information is stored in a number of 
 | 
					 | 
				
			||||||
MIB's such as IF-MIB, CISCO-CDP-MIB, CISCO-STACK-MIB, CISCO-VTP-MIB,
 | 
					 | 
				
			||||||
and SWITCH-MIB.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $cat = new SNMP::Info::Layer2::Catalyst(DestHost  => 'router' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $cat = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $cat->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info subclass to provide information for Cisco Catalyst switches running CatOS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This subclass is not for all devices that have the name Catalyst.  Note that some Catalyst
 | 
				
			||||||
 | 
					switches run IOS, like the 2900 and 3550 families.  Cisco Catalyst 1900 switches use their
 | 
				
			||||||
 | 
					own MIB and have a separate subclass.  Use the method above to have SNMP::Info determine the
 | 
				
			||||||
 | 
					appropriate subclass before using this class directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note:  Some older Catalyst switches will only talk SNMP version 1.  Some newer ones will not
 | 
				
			||||||
 | 
					return all their data if connected via Version 1.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $cat = new SNMP::Info::Layer2::Catalyst(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer2::Catalyst()
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $cat = new SNMP::Info::Layer2::Catalyst(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $cat;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBAL Values
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->netmask()
 | 
					=item CISCO-STACK-MIB
 | 
				
			||||||
(B<sysNetMask>)
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-VTP-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes' MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See SNMP::Info::Layer2 for its own MIB requirements.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These MIBs are found in the standard v2 MIBs from Cisco.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->broadcast()
 | 
					=item $cat->broadcast()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<sysBroadcast>)
 | 
					(B<sysBroadcast>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->serial()
 | 
					=item $cat->fan()
 | 
				
			||||||
(B<chassisSerialNumberString>)
 | 
					
 | 
				
			||||||
 | 
					(B<chassisFanStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->model()
 | 
					=item $cat->model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<chassisModel>)
 | 
					(B<chassisModel>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cat->netmask()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<sysNetMask>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cat->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns 'catalyst'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $cat->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Tries to use the value from SNMP::Info::CiscoStats->os_ver() and if it fails 
 | 
				
			||||||
 | 
					it grabs $cat->m_swver()->{1} and uses that.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->ps1_type()
 | 
					=item $cat->ps1_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<chassisPs1Type>)
 | 
					(B<chassisPs1Type>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->ps2_type()
 | 
					=item $cat->ps2_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<chassisPs2Type>)
 | 
					(B<chassisPs2Type>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->ps1_status()
 | 
					=item $cat->ps1_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<chassisPs1Status>)
 | 
					(B<chassisPs1Status>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->ps2_status()
 | 
					=item $cat->ps2_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<chassisPs2Status>)
 | 
					(B<chassisPs2Status>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->slots()
 | 
					=item $cat->serial()
 | 
				
			||||||
(B<chassisNumSlots>)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->fan()
 | 
					(B<chassisSerialNumberString>)
 | 
				
			||||||
(B<chassisFanStatus>)
 | 
					
 | 
				
			||||||
 | 
					=item $cat->slots()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<chassisNumSlots>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->vendor()
 | 
					=item $cat->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -331,8 +381,15 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -375,47 +432,62 @@ the Catalyst device.
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_type()
 | 
					=item $cat->m_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleType>)
 | 
					(B<moduleType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_model()
 | 
					=item $cat->m_model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleModel>)
 | 
					(B<moduleModel>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_serial()
 | 
					=item $cat->m_serial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSerialNumber>)
 | 
					(B<moduleSerialNumber>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_status()
 | 
					=item $cat->m_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleStatus>)
 | 
					(B<moduleStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_name()
 | 
					=item $cat->m_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleName>)
 | 
					(B<moduleName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports()
 | 
					=item $cat->m_ports()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleNumPorts>)
 | 
					(B<moduleNumPorts>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_status()
 | 
					=item $cat->m_ports_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns a list of space separated status strings for the ports.
 | 
					Returns a list of space separated status strings for the ports.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
To see the status of port 4 :
 | 
					To see the status of port 4 :
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @ports_status = split(' ', $cat->m_ports_status() );
 | 
					    @ports_status = split(' ', $cat->m_ports_status() );
 | 
				
			||||||
    $port4 = $ports_status[3];
 | 
					    $port4 = $ports_status[3];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<modulePortStatus>)
 | 
					(B<modulePortStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_hwver()
 | 
					=item $cat->m_ports_hwver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleHwVersion>)
 | 
					(B<moduleHwVersion>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_fwver()
 | 
					=item $cat->m_ports_fwver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleFwVersion>)
 | 
					(B<moduleFwVersion>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_swver()
 | 
					=item $cat->m_ports_swver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSwVersion>)
 | 
					(B<moduleSwVersion>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_ip()
 | 
					=item $cat->m_ports_ip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleIPAddress>)
 | 
					(B<moduleIPAddress>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_sub1()
 | 
					=item $cat->m_ports_sub1()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSubType>)
 | 
					(B<moduleSubType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ports_sub2()
 | 
					=item $cat->m_ports_sub2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSubType2>)
 | 
					(B<moduleSubType2>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -425,12 +497,15 @@ the Catalyst device.
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_ip()
 | 
					=item $cat->m_ip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleIPAddress>)
 | 
					(B<moduleIPAddress>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_sub1()
 | 
					=item $cat->m_sub1()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSubType>)
 | 
					(B<moduleSubType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->m_sub2()
 | 
					=item $cat->m_sub2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<moduleSubType2>)
 | 
					(B<moduleSubType2>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -440,24 +515,31 @@ the Catalyst device.
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_name()
 | 
					=item $cat->p_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portName>)
 | 
					(B<portName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_type()
 | 
					=item $cat->p_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portType>)
 | 
					(B<portType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_status()
 | 
					=item $cat->p_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portOperStatus>)
 | 
					(B<portOperStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_status2()
 | 
					=item $cat->p_status2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portAdditionalStatus>)
 | 
					(B<portAdditionalStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_speed()
 | 
					=item $cat->p_speed()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portAdminSpeed>)
 | 
					(B<portAdminSpeed>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_duplex()
 | 
					=item $cat->p_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portDuplex>)
 | 
					(B<portDuplex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_port()
 | 
					=item $cat->p_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portIfIndex>)
 | 
					(B<portIfIndex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -467,9 +549,11 @@ the Catalyst device.
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_speed_admin()
 | 
					=item $cat->p_speed_admin()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portCpbSpeed>)
 | 
					(B<portCpbSpeed>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->p_duplex_admin()
 | 
					=item $cat->p_duplex_admin()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portCpbDuplex>)
 | 
					(B<portCpbDuplex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -479,21 +563,28 @@ the Catalyst device.
 | 
				
			|||||||
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
 | 
					See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
 | 
				
			||||||
for a good treaty of how to connect to the VLANs
 | 
					for a good treaty of how to connect to the VLANs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->v_state()
 | 
					=item $cat->v_state()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanState>)
 | 
					(B<vtpVlanState>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->v_type()
 | 
					=item $cat->v_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanType>)
 | 
					(B<vtpVlanType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->v_name()
 | 
					=item $cat->v_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanName>)
 | 
					(B<vtpVlanName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $cat->v_mtu()
 | 
					=item $cat->v_mtu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanMtu>)
 | 
					(B<vtpVlanMtu>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer2::HP;
 | 
					package SNMP::Info::Layer2::HP;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -36,68 +36,53 @@ use strict;
 | 
				
			|||||||
use Exporter;
 | 
					use Exporter;
 | 
				
			||||||
use SNMP::Info::Layer2;
 | 
					use SNMP::Info::Layer2;
 | 
				
			||||||
use SNMP::Info::MAU;
 | 
					use SNMP::Info::MAU;
 | 
				
			||||||
 | 
					use SNMP::Info::Entity;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP 
 | 
					use vars qw/$VERSION $DEBUG %GLOBALS %MIBS %FUNCS %PORTSTAT %MODEL_MAP %MUNGE $INIT/ ;
 | 
				
			||||||
            %MYGLOBALS %MYMIBS %MYFUNCS %MYMUNGE %MUNGE $INIT/ ;
 | 
					
 | 
				
			||||||
@SNMP::Info::Layer2::HP::ISA = qw/SNMP::Info::Layer2 SNMP::Info::MAU Exporter/;
 | 
					@SNMP::Info::Layer2::HP::ISA = qw/SNMP::Info::Layer2 SNMP::Info::MAU SNMP::Info::Entity Exporter/;
 | 
				
			||||||
@SNMP::Info::Layer2::HP::EXPORT_OK = qw//;
 | 
					@SNMP::Info::Layer2::HP::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$DEBUG=0;
 | 
					# See SNMP::Info for the details of these data structures and interworkings.
 | 
				
			||||||
$SNMP::debugging=$DEBUG;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# See SNMP::Info for the details of these data structures and 
 | 
					 | 
				
			||||||
#       the interworkings.
 | 
					 | 
				
			||||||
$INIT = 0;
 | 
					$INIT = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MYMIBS = ( 'ENTITY-MIB'  => 'entPhysicalSerialNum',
 | 
					 | 
				
			||||||
            'RFC1271-MIB' => 'logDescription',
 | 
					 | 
				
			||||||
            'HP-ICF-OID'  => 'hpSwitch4000',
 | 
					 | 
				
			||||||
          );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
%MIBS = ( %SNMP::Info::Layer2::MIBS,
 | 
					%MIBS = ( %SNMP::Info::Layer2::MIBS,
 | 
				
			||||||
          %SNMP::Info::MAU::MIBS,
 | 
					          %SNMP::Info::MAU::MIBS,
 | 
				
			||||||
          %MYMIBS );
 | 
					          %SNMP::Info::Entity::MIBS,
 | 
				
			||||||
 | 
					          'RFC1271-MIB' => 'logDescription',
 | 
				
			||||||
%MYGLOBALS = ('serial1' => 'entPhysicalSerialNum.1',
 | 
					          'HP-ICF-OID'  => 'hpSwitch4000',
 | 
				
			||||||
#              'model'  => 'entPhysicalModelName.1',
 | 
					          'STATISTICS-MIB' => 'hpSwitchCpuStat',
 | 
				
			||||||
 | 
					          'NETSWITCH-MIB'  => 'hpMsgBufFree'
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%GLOBALS = (
 | 
					%GLOBALS = (
 | 
				
			||||||
            %SNMP::Info::Layer2::GLOBALS,
 | 
					            %SNMP::Info::Layer2::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::MAU::GLOBALS,
 | 
					            %SNMP::Info::MAU::GLOBALS,
 | 
				
			||||||
            %MYGLOBALS
 | 
					            %SNMP::Info::Entity::GLOBALS,
 | 
				
			||||||
 | 
					            'serial1'   => 'entPhysicalSerialNum.1',
 | 
				
			||||||
 | 
					            'hp_cpu'    => 'hpSwitchCpuStat.0',
 | 
				
			||||||
 | 
					            'hp_mem_total' => 'hpGlobalMemTotalBytes.1',
 | 
				
			||||||
 | 
					            'mem_free'  => 'hpGlobalMemFreeBytes.1',
 | 
				
			||||||
 | 
					            'mem_used'  => 'hpGlobalMemAllocBytes.1',
 | 
				
			||||||
 | 
					            'os_version' => 'hpSwitchOsVersion.0',
 | 
				
			||||||
 | 
					            'os_bin'    => 'hpSwitchRomVersion.0',
 | 
				
			||||||
 | 
					            'mac'       => 'hpSwitchBaseMACAddress.0'
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MYFUNCS = (
 | 
					 | 
				
			||||||
            'i_type2'   => 'ifType',
 | 
					 | 
				
			||||||
            'e_class'   => 'entPhysicalClass',
 | 
					 | 
				
			||||||
            'e_descr'   => 'entPhysicalDescr',
 | 
					 | 
				
			||||||
            'e_fwver'   => 'entPhysicalFirmwareRev',
 | 
					 | 
				
			||||||
            'e_hwver'   => 'entPhysicalHardwareRev',
 | 
					 | 
				
			||||||
            'e_map'     => 'entAliasMappingIdentifier',
 | 
					 | 
				
			||||||
            'e_model'   => 'entPhysicalModelName',
 | 
					 | 
				
			||||||
            'e_name'    => 'entPhysicalName',
 | 
					 | 
				
			||||||
            'e_parent'  => 'entPhysicalContainedIn',
 | 
					 | 
				
			||||||
            'e_serial'  => 'entPhysicalSerialNum',
 | 
					 | 
				
			||||||
            'e_swver'   => 'entPhysicalSoftwareRev',
 | 
					 | 
				
			||||||
            'e_type'    => 'entPhysicalVendorType',
 | 
					 | 
				
			||||||
            # RFC1271
 | 
					 | 
				
			||||||
            'l_descr'   => 'logDescription'
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
           );
 | 
					 | 
				
			||||||
%FUNCS   = (
 | 
					%FUNCS   = (
 | 
				
			||||||
            %SNMP::Info::Layer2::FUNCS,
 | 
					            %SNMP::Info::Layer2::FUNCS,
 | 
				
			||||||
            %SNMP::Info::MAU::FUNCS,
 | 
					            %SNMP::Info::MAU::FUNCS,
 | 
				
			||||||
            %MYFUNCS
 | 
					            %SNMP::Info::Entity::FUNCS,
 | 
				
			||||||
        );
 | 
					            'i_type2'   => 'ifType',
 | 
				
			||||||
 | 
					            # RFC1271
 | 
				
			||||||
%MYMUNGE = (
 | 
					            'l_descr'   => 'logDescription'
 | 
				
			||||||
           );
 | 
					           );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MUNGE = (
 | 
					%MUNGE = (
 | 
				
			||||||
            # Inherit all the built in munging
 | 
					            # Inherit all the built in munging
 | 
				
			||||||
            %SNMP::Info::Layer2::MUNGE,
 | 
					            %SNMP::Info::Layer2::MUNGE,
 | 
				
			||||||
            %SNMP::Info::MAU::MUNGE,
 | 
					            %SNMP::Info::MAU::MUNGE,
 | 
				
			||||||
            %MYMUNGE
 | 
					            %SNMP::Info::Entity::MUNGE
 | 
				
			||||||
         );
 | 
					         );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MODEL_MAP = ( 
 | 
					%MODEL_MAP = ( 
 | 
				
			||||||
@@ -113,6 +98,31 @@ $INIT = 0;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Method Overrides
 | 
					# Method Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub cpu {
 | 
				
			||||||
 | 
					    my $hp = shift;
 | 
				
			||||||
 | 
					    return $hp->hp_cpu();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub mem_total {
 | 
				
			||||||
 | 
					    my $hp = shift;
 | 
				
			||||||
 | 
					    return $hp->hp_mem_total();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'hp';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $hp = shift;
 | 
				
			||||||
 | 
					    my $os_version = $hp->os_version();
 | 
				
			||||||
 | 
					    return $os_version if defined $os_version;
 | 
				
			||||||
 | 
					    # Some older ones don't have this value,so we cull it from the description
 | 
				
			||||||
 | 
					    my $descr = $hp->description();
 | 
				
			||||||
 | 
					    if ($descr =~ m/revision ([A-Z]{1}\.\d{2}\.\d{2})/) {
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Lookup model number, and translate the part number to the common number
 | 
					# Lookup model number, and translate the part number to the common number
 | 
				
			||||||
sub model {
 | 
					sub model {
 | 
				
			||||||
    my $hp = shift;
 | 
					    my $hp = shift;
 | 
				
			||||||
@@ -147,7 +157,6 @@ sub interfaces {
 | 
				
			|||||||
    foreach my $iid (keys %$interfaces){
 | 
					    foreach my $iid (keys %$interfaces){
 | 
				
			||||||
        my $descr = $i_descr->{$iid};
 | 
					        my $descr = $i_descr->{$iid};
 | 
				
			||||||
        next unless defined $descr;
 | 
					        next unless defined $descr;
 | 
				
			||||||
        #$if{$iid} = $iid;
 | 
					 | 
				
			||||||
        $if{$iid} = $descr if (defined $descr and length $descr);
 | 
					        $if{$iid} = $descr if (defined $descr and length $descr);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -155,26 +164,6 @@ sub interfaces {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# e_port maps EntityTable entries to IfTable
 | 
					 | 
				
			||||||
sub e_port {
 | 
					 | 
				
			||||||
    my $hp = shift;
 | 
					 | 
				
			||||||
    my $e_map = $hp->e_map();
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my %e_port;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    foreach my $e_id (keys %$e_map) {
 | 
					 | 
				
			||||||
        my $id = $e_id;
 | 
					 | 
				
			||||||
        $id =~ s/\.0$//;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        my $iid = $e_map->{$e_id};
 | 
					 | 
				
			||||||
        $iid =~ s/.*\.//;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $e_port{$id} = $iid;
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return \%e_port;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
sub i_type {
 | 
					sub i_type {
 | 
				
			||||||
    my $hp = shift;
 | 
					    my $hp = shift;
 | 
				
			||||||
    my $e_descr = $hp->e_descr();
 | 
					    my $e_descr = $hp->e_descr();
 | 
				
			||||||
@@ -344,61 +333,100 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches
 | 
					SNMP::Info::Layer2::HP - SNMP Interface to HP Procurve Switches
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides abstraction to the configuration information obtainable from a 
 | 
					 | 
				
			||||||
HP device through SNMP.  Information is stored in a number of 
 | 
					 | 
				
			||||||
MIB's such as IF-MIB, ENTITY-MIB, RFC1271-MIB, HP-ICF-OID, MAU-MIB
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MIBs required:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=over
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item RFC1271-MIB
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item HP-ICF-OID
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=back
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HP MIBs can be found at http://www.hp.com/rnd/software
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $hp = new SNMP::Info::Layer2::HP(DestHost  => 'router' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $hp = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 See SNMP::Info and SNMP::Info::Layer2 for all the inherited methods.
 | 
					 my $class      = $hp->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides abstraction to the configuration information obtainable from a 
 | 
				
			||||||
 | 
					HP ProCurve Switch via SNMP. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note:  Some HP Switches will connect via SNMP version 1, but a lot of config data will 
 | 
				
			||||||
 | 
					not be available.  Make sure you try and connect with Version 2 first, and then fail back
 | 
				
			||||||
 | 
					to version 1.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $hp = new SNMP::Info::Layer2::HP(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer2::HP()
 | 
					=item SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=item SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::MAU
 | 
				
			||||||
    my $hp = new SNMP::Info::Layer2::HP(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $hp;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 HP Global Configuration Values
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item RFC1271-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Included in V2 mibs from Cisco
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item HP-ICF-OID
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item STATISTICS-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item NETSWITCH-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The last three MIBs listed are from HP and can be found at http://www.hp.com/rnd/software
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 ChangeLog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Version 0.4 - Removed ENTITY-MIB e_*() methods to separate sub-class - SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->cpu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns CPU Utilization in percentage.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->log()
 | 
					=item $hp->log()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns all the log entries from the switch's log that are not Link up or down messages.
 | 
					Returns all the log entries from the switch's log that are not Link up or down messages.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->mem_free()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns bytes of free memory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->mem_total()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Return bytes of total memory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->mem_used()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns bytes of used memory
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->model()
 | 
					=item $hp->model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns the model number of the HP Switch.  Will translate between the HP Part number and 
 | 
					Returns the model number of the HP Switch.  Will translate between the HP Part number and 
 | 
				
			||||||
@@ -415,6 +443,23 @@ the common model number with this map :
 | 
				
			|||||||
               'J4874A' => '9315',
 | 
					               'J4874A' => '9315',
 | 
				
			||||||
              );
 | 
					              );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Returns hp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->os_bin()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<hpSwitchRomVersion.0>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->os_ver()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Tries to use os_version() and if that fails will try and cull the version from
 | 
				
			||||||
 | 
					the description field.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $hp->os_version()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<hpSwitchOsVersion.0>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->serial()
 | 
					=item $hp->serial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns serial number if available through SNMP
 | 
					Returns serial number if available through SNMP
 | 
				
			||||||
@@ -429,69 +474,31 @@ hp
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 HP Table Values
 | 
					=head2 Globals imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Entity Table
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=head2 Globals imported from SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->e_class()
 | 
					See documentation in SNMP::Info::Entity for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(C<entPhysicalClass>)
 | 
					=head2 Globals imported from SNMP::Info::MAU
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->e_descr()
 | 
					See documentation in SNMP::Info::MAU for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(C<entPhysicalClass>)
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->e_fwver()
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(C<entPhysicalFirmwareRev>)
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_hwver()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalHardwareRev>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_map()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entAliasMappingIdentifier>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_model()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalModelName>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_name()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalName>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_parent()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalContainedIn>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_port()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Maps EntityTable entries to the Interface Table (IfTable) using
 | 
					 | 
				
			||||||
$hp->e_map()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_serial()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalSerialNum>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_swver()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalSoftwareRev>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $hp->e_type()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
(C<entPhysicalVendorType>)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=back
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head2 Overriden Methods from SNMP::Info::Layer2
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->interfaces() 
 | 
					=item $hp->interfaces() 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Uses $hp->i_description()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $hp->i_duplex()
 | 
					=item $hp->i_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Maps $hp->mau_index() with $hp->mau_link().  Methods inherited from
 | 
					Maps $hp->mau_index() with $hp->mau_link().  Methods inherited from
 | 
				
			||||||
@@ -512,3 +519,17 @@ Crosses i_name() with $hp->e_name() using $hp->e_port() and i_alias()
 | 
				
			|||||||
Crosses i_type() with $hp->e_descr() using $hp->e_port()
 | 
					Crosses i_type() with $hp->e_descr() using $hp->e_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Layer2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer2 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Entity
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Entity for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::MAU
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::MAU for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										179
									
								
								Info/Layer3.pm
									
									
									
									
									
								
							
							
						
						
									
										179
									
								
								Info/Layer3.pm
									
									
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer3;
 | 
					package SNMP::Info::Layer3;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -36,12 +36,14 @@ use strict;
 | 
				
			|||||||
use Exporter;
 | 
					use Exporter;
 | 
				
			||||||
use SNMP::Info;
 | 
					use SNMP::Info;
 | 
				
			||||||
use SNMP::Info::CDP;
 | 
					use SNMP::Info::CDP;
 | 
				
			||||||
 | 
					use SNMP::Info::CiscoStats;
 | 
				
			||||||
use SNMP::Info::Bridge;
 | 
					use SNMP::Info::Bridge;
 | 
				
			||||||
use SNMP::Info::EtherLike;
 | 
					use SNMP::Info::EtherLike;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
 | 
					use vars qw/$VERSION $DEBUG %GLOBALS %FUNCS $INIT %MIBS %MUNGE/;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@SNMP::Info::Layer3::ISA = qw/SNMP::Info SNMP::Info::CDP SNMP::Info::Bridge SNMP::Info::EtherLike Exporter/;
 | 
					@SNMP::Info::Layer3::ISA = qw/SNMP::Info SNMP::Info::CDP SNMP::Info::Bridge 
 | 
				
			||||||
 | 
					                              SNMP::Info::EtherLike SNMP::Info::CiscoStats Exporter/;
 | 
				
			||||||
@SNMP::Info::Layer3::EXPORT_OK = qw//;
 | 
					@SNMP::Info::Layer3::EXPORT_OK = qw//;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$DEBUG=0;
 | 
					$DEBUG=0;
 | 
				
			||||||
@@ -50,11 +52,11 @@ $SNMP::debugging=$DEBUG;
 | 
				
			|||||||
$INIT = 0;
 | 
					$INIT = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
%MIBS = ( %SNMP::Info::MIBS,
 | 
					%MIBS = ( %SNMP::Info::MIBS,
 | 
				
			||||||
          %SNMP::Info::CDP::MIBS,
 | 
					 | 
				
			||||||
          %SNMP::Info::Bridge::MIBS,
 | 
					          %SNMP::Info::Bridge::MIBS,
 | 
				
			||||||
 | 
					          %SNMP::Info::CDP::MIBS,
 | 
				
			||||||
 | 
					          %SNMP::Info::CiscoStats::MIBS,
 | 
				
			||||||
          %SNMP::Info::EtherLike::MIBS,
 | 
					          %SNMP::Info::EtherLike::MIBS,
 | 
				
			||||||
          'ENTITY-MIB'         => 'entPhysicalName',
 | 
					          'ENTITY-MIB'         => 'entPhysicalName',
 | 
				
			||||||
          'HP-ICF-OID'         => 'hpSwitch4000',
 | 
					 | 
				
			||||||
          'CISCO-PRODUCTS-MIB' => 'sysName',
 | 
					          'CISCO-PRODUCTS-MIB' => 'sysName',
 | 
				
			||||||
          'OSPF-MIB'           => 'ospfRouterId',
 | 
					          'OSPF-MIB'           => 'ospfRouterId',
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
@@ -63,6 +65,7 @@ $INIT = 0;
 | 
				
			|||||||
            # Inherit the super class ones
 | 
					            # Inherit the super class ones
 | 
				
			||||||
            %SNMP::Info::GLOBALS,
 | 
					            %SNMP::Info::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::CDP::GLOBALS,
 | 
					            %SNMP::Info::CDP::GLOBALS,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::Bridge::GLOBALS,
 | 
					            %SNMP::Info::Bridge::GLOBALS,
 | 
				
			||||||
            %SNMP::Info::EtherLike::GLOBALS,
 | 
					            %SNMP::Info::EtherLike::GLOBALS,
 | 
				
			||||||
            'mac'       => 'ifPhysAddress.1',
 | 
					            'mac'       => 'ifPhysAddress.1',
 | 
				
			||||||
@@ -73,6 +76,7 @@ $INIT = 0;
 | 
				
			|||||||
%FUNCS   = (
 | 
					%FUNCS   = (
 | 
				
			||||||
            %SNMP::Info::FUNCS,
 | 
					            %SNMP::Info::FUNCS,
 | 
				
			||||||
            %SNMP::Info::CDP::FUNCS,
 | 
					            %SNMP::Info::CDP::FUNCS,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::FUNCS,
 | 
				
			||||||
            %SNMP::Info::Bridge::FUNCS,
 | 
					            %SNMP::Info::Bridge::FUNCS,
 | 
				
			||||||
            %SNMP::Info::EtherLike::FUNCS,
 | 
					            %SNMP::Info::EtherLike::FUNCS,
 | 
				
			||||||
            # IFMIB
 | 
					            # IFMIB
 | 
				
			||||||
@@ -88,6 +92,7 @@ $INIT = 0;
 | 
				
			|||||||
            # Inherit all the built in munging
 | 
					            # Inherit all the built in munging
 | 
				
			||||||
            %SNMP::Info::MUNGE,
 | 
					            %SNMP::Info::MUNGE,
 | 
				
			||||||
            %SNMP::Info::CDP::MUNGE,
 | 
					            %SNMP::Info::CDP::MUNGE,
 | 
				
			||||||
 | 
					            %SNMP::Info::CiscoStats::MUNGE,
 | 
				
			||||||
            %SNMP::Info::Bridge::MUNGE,
 | 
					            %SNMP::Info::Bridge::MUNGE,
 | 
				
			||||||
            %SNMP::Info::EtherLike::MUNGE,
 | 
					            %SNMP::Info::EtherLike::MUNGE,
 | 
				
			||||||
            'at_paddr' => \&SNMP::Info::munge_mac,
 | 
					            'at_paddr' => \&SNMP::Info::munge_mac,
 | 
				
			||||||
@@ -222,31 +227,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer3 - Perl5 Interface to network devices using Layer3
 | 
					SNMP::Info::Layer3 - Perl5 Interface to network devices serving Layer3 or Layers 2 & 3
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Provides generic methods for accessing SNMP data for Layer 3 network devices. 
 | 
					 | 
				
			||||||
Includes support for Layer2+3 devices. See super classes for other inherited
 | 
					 | 
				
			||||||
methods.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits from:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 SNMP::Info
 | 
					 | 
				
			||||||
 SNMP::Info::Bridge
 | 
					 | 
				
			||||||
 SNMP::Info::CDP
 | 
					 | 
				
			||||||
 SNMP::Info::EtherLike
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Required MIBs:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 ENTITY-MIB         - For model identification
 | 
					 | 
				
			||||||
 CISCO-PRODUCTS-MIB - For model identification
 | 
					 | 
				
			||||||
 HP-ICF-OID         - For model identification
 | 
					 | 
				
			||||||
 MIBS listed in SNMP::Info::CDP, SNMP::Info::Bridge, and SNMP::Info::Etherlike
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Cisco MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
HP MIBs can be found at http://www.hp.com/rnd/software
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -254,36 +235,83 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $l3 = new SNMP::Info::Layer3(DestHost  => 'router' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $l3 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $l3->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 # Let's get some basic Port information
 | 
				
			||||||
 | 
					 my $interfaces = $l3->interfaces();
 | 
				
			||||||
 | 
					 my $i_up       = $l3->i_up();
 | 
				
			||||||
 | 
					 my $i_speed    = $l3->i_speed();
 | 
				
			||||||
 | 
					 foreach my $iid (keys %$interfaces) {
 | 
				
			||||||
 | 
					    my $port  = $interfaces->{$iid};
 | 
				
			||||||
 | 
					    my $up    = $i_up->{$iid};
 | 
				
			||||||
 | 
					    my $speed = $i_speed->{$iid}
 | 
				
			||||||
 | 
					    print "Port $port is $up. Port runs at $speed.\n";
 | 
				
			||||||
 | 
					 }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This class is usually used as a superclass for more specific device classes listed under 
 | 
				
			||||||
 | 
					SNMP::Info::Layer3::*   Please read all docs under SNMP::Info first.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Provides generic methods for accessing SNMP data for Layer 3 network devices. 
 | 
				
			||||||
 | 
					Includes support for Layer2+3 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 $l3 = new SNMP::Info::Layer3(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer3()
 | 
					=item SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=item SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $l3 = new SNMP::Info::Layer3(
 | 
					=item SNMP::Info::CiscoStats
 | 
				
			||||||
        DestHost => $host,
 | 
					
 | 
				
			||||||
        Community => 'public',
 | 
					=item SNMP::Info::EtherLike
 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $l3;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBALS
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l3->mac()
 | 
					=item CISCO-PRODUCTS-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns root port mac address
 | 
					=item ENTITY-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<ifPhysAddress.1>)
 | 
					=item OSPF-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs required by the inherited classes listed above.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					MIBs can be found at ftp://ftp.cisco.com/pub/mibs/v2/v2.tar.gz
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l3->chassis()
 | 
					=item $l3->chassis()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -291,9 +319,21 @@ Returns Chassis type (model).
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
(B<entPhysicalDescr.1>)
 | 
					(B<entPhysicalDescr.1>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l3->serial()
 | 
					=item $l3->mac()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Trys to cull a serial number from $l3->chassis()
 | 
					Returns root port mac address
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<ifPhysAddress.1>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $l3->router_ip()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					(B<ospfRouterId.0>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l3->model()
 | 
					=item $l3->model()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -301,14 +341,41 @@ Trys to reference $l3->id() to one of the product MIBs listed above
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
Removes 'cisco'  from cisco devices for readability.
 | 
					Removes 'cisco'  from cisco devices for readability.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $l3->serial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Trys to cull a serial number from $l3->chassis()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $l3->vendor()
 | 
					=item $l3->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Trys to cull a Vendor name from B<sysDescr>
 | 
					Trys to cull a Vendor name from B<sysDescr>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CDP for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::CiscoStats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CiscoStats for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::EtherLike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::EtherLike for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -366,4 +433,24 @@ Returns reference to hash of Arp Cache Entries to IP Address
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::CDP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CDP for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::CiscoStats
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::CiscoStats for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::EtherLike
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::EtherLike for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer3::Aironet;
 | 
					package SNMP::Info::Layer3::Aironet;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -82,6 +82,26 @@ $INIT = 0;
 | 
				
			|||||||
          'fw_mac2'     => \&SNMP::Info::munge_mac,
 | 
					          'fw_mac2'     => \&SNMP::Info::munge_mac,
 | 
				
			||||||
         );
 | 
					         );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os {
 | 
				
			||||||
 | 
					    return 'aironet';
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub os_ver {
 | 
				
			||||||
 | 
					    my $aironet = shift;
 | 
				
			||||||
 | 
					    my $descr = $aironet->description();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # CAP340 11.21
 | 
				
			||||||
 | 
					    if ($descr =~ /AP\d{3}\s+(\d{2}\.\d{2})/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    if ($descr =~ /Series\s*AP\s+(\d{2}\.\d{2})/){
 | 
				
			||||||
 | 
					        return $1;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return undef;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Override wireless port with static info
 | 
					# Override wireless port with static info
 | 
				
			||||||
sub bp_index {
 | 
					sub bp_index {
 | 
				
			||||||
    my $aironet = shift;
 | 
					    my $aironet = shift;
 | 
				
			||||||
@@ -110,6 +130,7 @@ sub fw_mac {
 | 
				
			|||||||
    # remove port 0 forwarding table entries, only port 0 static entries
 | 
					    # remove port 0 forwarding table entries, only port 0 static entries
 | 
				
			||||||
    foreach my $fw (keys %$fw_mac){
 | 
					    foreach my $fw (keys %$fw_mac){
 | 
				
			||||||
        my $port = $fw_port->{$fw};
 | 
					        my $port = $fw_port->{$fw};
 | 
				
			||||||
 | 
					        next unless defined $port;
 | 
				
			||||||
        delete $fw_mac->{$fw} if $port == 0;
 | 
					        delete $fw_mac->{$fw} if $port == 0;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -189,11 +210,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices
 | 
					SNMP::Info::Layer3::Aironet - Perl5 Interface to Cisco Aironet Wireless Devices running Aironet software, not IOS
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits all methods from SNMP::Info::Layer3
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -201,37 +218,70 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $aironet = new SNMP::Info::Layer3::Aironet(DestHost  => 'myswitch',
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                               Community => 'public');
 | 
					 my $aironet = new SNMP::Info(
 | 
				
			||||||
 my $mac = $aironet->mac(); 
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class      = $aironet->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info subclass to provide access to SNMP data for an Aironet device running Aironet software,
 | 
				
			||||||
 | 
					not cisco IOS.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note there are two classes for Aironet devices :
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer3::Aironet()
 | 
					=item SNMP::Info::Layer3::Aironet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					This class is for devices running Aironet software (older)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item SNMP::Info::Layer2::Aironet
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    my $aironet = new SNMP::Info::Layer3::Aironet(
 | 
					This class is for devices running Cisco IOS software (newer)
 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $aironet;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 Globals
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $aironet = new SNMP::Info::Layer3::Aironet(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $aironet->mac()
 | 
					=item SNMP::Info::Layer3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Gives the MAC Address of the wireless side 
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
B<dot11StationID.2>
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item AWCVX-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item IEEE802dot11-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $aironet->awc_duplex()
 | 
					=item $aironet->awc_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -239,14 +289,68 @@ Gives the admin duplex setting for the Ethernet Port.
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
B<awcEtherDuplex.0>
 | 
					B<awcEtherDuplex.0>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->mac()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Gives the MAC Address of the wireless side 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					B<dot11StationID.2>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->os()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					'aironet'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->os_ver
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Tries to cull the version from the description field.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $aironet->vendor()
 | 
					=item $aironet->vendor()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Returns 'cisco'.
 | 
					Returns 'cisco'.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer3 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->bp_index()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Takes the bp_index() value from SNMP::Info::Bridge and overrides the wireless port 
 | 
				
			||||||
 | 
					to be assigned to the transparent bridge port (port 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->fw_mac()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds static table entries from bs_mac() to port 0 so that wireless MAC addresses will
 | 
				
			||||||
 | 
					be reported.  Forwarding table entries for port 0 are removed.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->fw_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds the static table port mappings to the forwarding table port mappings by adding 
 | 
				
			||||||
 | 
					bs_port() to fw_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->i_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Adds the value of awc_duplex() to each Ethernet port seen.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->i_mac()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Overrides the values for i_mac with the value from awc_mac() if they are set.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item $aironet->i_ignore()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Ignores ports that are of type ``rptr'' and ``lo''.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Aironet specific items
 | 
					=head2 Aironet specific items
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -281,37 +385,8 @@ B<awcIfMSDUMaxLength>
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Table Methods imported from SNMP::Info::Layer3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					See documentation in SNMP::Info::Layer3 for details.
 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->bp_index()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Takes the bp_index() value from SNMP::Info::Bridge and overrides the wireless port 
 | 
					 | 
				
			||||||
to be assigned to the transparent bridge port (port 0)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->fw_mac()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Adds static table entries from bs_mac() to port 0 so that wireless MAC addresses will
 | 
					 | 
				
			||||||
be reported.  Forwarding table entries for port 0 are removed.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->fw_port()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Adds the static table port mappings to the forwarding table port mappings by adding 
 | 
					 | 
				
			||||||
bs_port() to fw_port()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->i_duplex()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Adds the value of awc_duplex() to each Ethernet port seen.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->i_mac()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Overrides the values for i_mac with the value from awc_mac() if they are set.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=item $aironet->i_ignore()
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Ignores ports that are of type ``rptr'' and ``lo''.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=back
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer3::C3550;
 | 
					package SNMP::Info::Layer3::C3550;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -201,44 +201,60 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer3::C3550 - Perl5 Interface to Cisco Catalyst 3550 Layer 2/3 Switches running IOS
 | 
					SNMP::Info::Layer3::C3550 - Perl5 Interface to Cisco Catalyst 3550 Layer 2/3 Switches running IOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Abstraction subclass for Cisco Catalyst 3550 Layer 2/3 Switches.  These devices run
 | 
					 | 
				
			||||||
IOS but have some of the same charactersitics as the Catalyst WS-C family (5xxx,6xxx). 
 | 
					 | 
				
			||||||
For example, forwarding tables are held in VLANs, and extened interface information
 | 
					 | 
				
			||||||
is gleened from CISCO-SWITCH-MIB.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Max Baker (C<max@warped.org>)
 | 
					Max Baker (C<max@warped.org>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $c3550 = new SNMP::Info::Layer3::C3550(DestHost  => 'router' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $c3550 = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 2
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $class      = $c3550->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
See L<SNMP::Info> and L<SNMP::Info::Layer3> for all the inherited methods.
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					Abstraction subclass for Cisco Catalyst 3550 Layer 2/3 Switches.  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These devices run IOS but have some of the same charactersitics as the Catalyst WS-C family (5xxx,6xxx). 
 | 
				
			||||||
 | 
					For example, forwarding tables are held in VLANs, and extened interface information
 | 
				
			||||||
 | 
					is gleened from CISCO-SWITCH-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 $c3550 = new SNMP::Info::Layer3::C3550(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer3::C3550()
 | 
					=item SNMP::Info::Layer3
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $c3550 = new SNMP::Info::Layer3::C3550(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $c3550;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBAL Values
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-STACK-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item CISCO-VTP-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -272,8 +288,15 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Layer3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer3 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -305,24 +328,31 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_name()
 | 
					=item $c3550->p_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portName>)
 | 
					(B<portName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_type()
 | 
					=item $c3550->p_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portType>)
 | 
					(B<portType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_status()
 | 
					=item $c3550->p_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portOperStatus>)
 | 
					(B<portOperStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_status2()
 | 
					=item $c3550->p_status2()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portAdditionalStatus>)
 | 
					(B<portAdditionalStatus>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_speed()
 | 
					=item $c3550->p_speed()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portAdminSpeed>)
 | 
					(B<portAdminSpeed>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_duplex()
 | 
					=item $c3550->p_duplex()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portDuplex>)
 | 
					(B<portDuplex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_port()
 | 
					=item $c3550->p_port()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portIfIndex>)
 | 
					(B<portIfIndex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -332,9 +362,11 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_speed_admin()
 | 
					=item $c3550->p_speed_admin()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portCpbSpeed>)
 | 
					(B<portCpbSpeed>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->p_duplex_admin()
 | 
					=item $c3550->p_duplex_admin()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<portCpbDuplex>)
 | 
					(B<portCpbDuplex>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
@@ -344,22 +376,28 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
 | 
					See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html
 | 
				
			||||||
for a good treaty of how to connect to the VLANs
 | 
					for a good treaty of how to connect to the VLANs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->v_state()
 | 
					=item $c3550->v_state()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanState>)
 | 
					(B<vtpVlanState>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->v_type()
 | 
					=item $c3550->v_type()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanType>)
 | 
					(B<vtpVlanType>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->v_name()
 | 
					=item $c3550->v_name()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanName>)
 | 
					(B<vtpVlanName>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item $c3550->v_mtu()
 | 
					=item $c3550->v_mtu()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
(B<vtpVlanMtu>)
 | 
					(B<vtpVlanMtu>)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=head2 Table Methods imported from SNMP::Info::Layer3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Layer3 for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::Layer3::Foundry;
 | 
					package SNMP::Info::Layer3::Foundry;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -222,16 +222,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::Layer3::Foundry - Perl5 Interface to Foundry Network Devices
 | 
					SNMP::Info::Layer3::Foundry - Perl5 Interface to Foundry FastIron Network Devices
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
This module provides limited functionality from older Foundry devices.
 | 
					 | 
				
			||||||
Specifically designed for a FI4802
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Data comes RFC1213 and FOUNDRY-SN-ROOT-MIB
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits all methods from both SNMP::Info and SNMP::Info::Bridge
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -239,30 +230,60 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $foundry = new SNMP::Info::Layer3::Foundry(DestHost  => 'switch' , 
 | 
					 # Let SNMP::Info determine the correct subclass for you. 
 | 
				
			||||||
                              Community => 'public' ); 
 | 
					 my $foundry = new SNMP::Info(
 | 
				
			||||||
 | 
					                          AutoSpecify => 1,
 | 
				
			||||||
 | 
					                          Debug       => 1,
 | 
				
			||||||
 | 
					                          # These arguments are passed directly on to SNMP::Session
 | 
				
			||||||
 | 
					                          DestHost    => 'myswitch',
 | 
				
			||||||
 | 
					                          Community   => 'public',
 | 
				
			||||||
 | 
					                          Version     => 1
 | 
				
			||||||
 | 
					                        ) 
 | 
				
			||||||
 | 
					    or die "Can't connect to DestHost.\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
See L<SNMP::Info> and L<SNMP::Info::Layer3> for all inherited methods.
 | 
					 my $class      = $foundry->class();
 | 
				
			||||||
 | 
					 print "SNMP::Info determined this device to fall under subclass : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This subclass no longer supported.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					This module provides limited functionality from older Foundry devices.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Specifically designed for a FI4802.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For speed or debugging purposes you can call the subclass directly, but not after determining
 | 
				
			||||||
 | 
					a more specific class using the method above.  Turn off the AutoSpecify flag.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $foundry = new SNMP::Info::Layer3::Foundry(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::Layer3::Foundry()
 | 
					=item SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					=item SNMP::Info::Bridge
 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $foundry = new SNMP::Info::Layer3::Foundry(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $foundry;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 GLOBAL VALUES
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item FOUNDRY-SN-ROOT-MIB
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=item Inherited Classes' MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See classes listed above for their required MIBs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The Foundry MIBS can be downloaded from www.mibdepot.com and ??
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -319,8 +340,19 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Globals imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 TABLE ENTRIES
 | 
					=head1 TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head2 Overrides
 | 
					=head2 Overrides
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
@@ -417,4 +449,12 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Table Methods imported from SNMP::Info::Bridge
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					See documentation in SNMP::Info::Bridge for details.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										69
									
								
								Info/MAU.pm
									
									
									
									
									
								
							
							
						
						
									
										69
									
								
								Info/MAU.pm
									
									
									
									
									
								
							@@ -28,7 +28,7 @@
 | 
				
			|||||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
					# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
package SNMP::Info::MAU;
 | 
					package SNMP::Info::MAU;
 | 
				
			||||||
$VERSION = 0.3;
 | 
					$VERSION = 0.4;
 | 
				
			||||||
# $Id$
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use strict;
 | 
					use strict;
 | 
				
			||||||
@@ -109,15 +109,7 @@ __END__
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 NAME
 | 
					=head1 NAME
 | 
				
			||||||
 | 
					
 | 
				
			||||||
SNMP::Info::MAU - Perl5 Interface to SNMP Medium Access Unit (MAU) MIB (RFC2668) 
 | 
					SNMP::Info::MAU - Perl5 Interface to Medium Access Unit (MAU) MIB (RFC2668) via SNMP
 | 
				
			||||||
 | 
					 | 
				
			||||||
=head1 DESCRIPTION
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
MAU-MIB is used by Layer 2 devices like HP Switches . The MAU table
 | 
					 | 
				
			||||||
contains link and duplex info for the port itself and the device
 | 
					 | 
				
			||||||
connected to that port.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Inherits all methods from SNMP::Info
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 AUTHOR
 | 
					=head1 AUTHOR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -125,28 +117,47 @@ Max Baker (C<max@warped.org>)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=head1 SYNOPSIS
 | 
					=head1 SYNOPSIS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 my $mau = new SNMP::Info::MAU(      DestHost  => 'myswitch',
 | 
					 my $mau = new SNMP::Info ( 
 | 
				
			||||||
                               Community => 'public');
 | 
					                             AutoSpecify => 1,
 | 
				
			||||||
 | 
					                             Debug       => 1,
 | 
				
			||||||
 | 
					                             DestHost    => 'hpswitch', 
 | 
				
			||||||
 | 
					                             Community   => 'public',
 | 
				
			||||||
 | 
					                             Version     => 2
 | 
				
			||||||
 | 
					                           );
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
=head1 CREATING AN OBJECT
 | 
					 my $class = $mau->class();
 | 
				
			||||||
 | 
					 print " Using device sub class : $class\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head1 DESCRIPTION
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP::Info::MAU is a sublcass of SNMP::Info that supplies access to the
 | 
				
			||||||
 | 
					MAU-MIB (RFC2668). This MIB is sometimes implemented on Layer 2 network devices like HP Switches.
 | 
				
			||||||
 | 
					MAU = Media Access Unit.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					The MAU table contains link and duplex info for the port itself and the device
 | 
				
			||||||
 | 
					connected to that port.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Normally you use or create a subclass of SNMP::Info that inherits this one.  Do not use directly.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					For debugging purposes call the class directly as you would SNMP::Info
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 my $mau = new SNMP::Info::MAU(...);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Inherited Classes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					None.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 Required MIBs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=item  new SNMP::Info::MAU()
 | 
					=item MAU-MIB
 | 
				
			||||||
 | 
					 | 
				
			||||||
Arguments passed to new() are passed on to SNMP::Session::new()
 | 
					 | 
				
			||||||
    
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    my $mau = new SNMP::Info::MAU(
 | 
					 | 
				
			||||||
        DestHost => $host,
 | 
					 | 
				
			||||||
        Community => 'public',
 | 
					 | 
				
			||||||
        Version => 3,...
 | 
					 | 
				
			||||||
        ) 
 | 
					 | 
				
			||||||
    die "Couldn't connect.\n" unless defined $mau;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 MAU Global Configuration Values
 | 
					=head1 GLOBALS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return scalar value from SNMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -154,7 +165,12 @@ Arguments passed to new() are passed on to SNMP::Session::new()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=head1 MAU INTERFACE TABLE ENTRIES
 | 
					=head1 TABLE METHODS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					These are methods that return tables of information in the form of a reference
 | 
				
			||||||
 | 
					to a hash.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					=head2 MAU INTERFACE TABLE ENTRIES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=over
 | 
					=over
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -254,4 +270,5 @@ capabilities of the device on the other end.
 | 
				
			|||||||
    high.  Currently bits 10,12,15,17,19.
 | 
					    high.  Currently bits 10,12,15,17,19.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=back
 | 
					=back
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=cut
 | 
					=cut
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								MANIFEST
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								MANIFEST
									
									
									
									
									
								
							@@ -1,8 +1,10 @@
 | 
				
			|||||||
ChangeLog
 | 
					 | 
				
			||||||
COPYRIGHT
 | 
					COPYRIGHT
 | 
				
			||||||
 | 
					ChangeLog
 | 
				
			||||||
Info.pm
 | 
					Info.pm
 | 
				
			||||||
Info/Bridge.pm
 | 
					Info/Bridge.pm
 | 
				
			||||||
Info/CDP.pm
 | 
					Info/CDP.pm
 | 
				
			||||||
 | 
					Info/CiscoStats.pm
 | 
				
			||||||
 | 
					Info/Entity.pm
 | 
				
			||||||
Info/EtherLike.pm
 | 
					Info/EtherLike.pm
 | 
				
			||||||
Info/Layer1.pm
 | 
					Info/Layer1.pm
 | 
				
			||||||
Info/Layer1/Allied.pm
 | 
					Info/Layer1/Allied.pm
 | 
				
			||||||
@@ -15,10 +17,10 @@ Info/Layer2/Catalyst.pm
 | 
				
			|||||||
Info/Layer2/HP.pm
 | 
					Info/Layer2/HP.pm
 | 
				
			||||||
Info/Layer3.pm
 | 
					Info/Layer3.pm
 | 
				
			||||||
Info/Layer3/Aironet.pm
 | 
					Info/Layer3/Aironet.pm
 | 
				
			||||||
Info/Layer3/Foundry.pm
 | 
					 | 
				
			||||||
Info/Layer3/C3550.pm
 | 
					Info/Layer3/C3550.pm
 | 
				
			||||||
 | 
					Info/Layer3/Foundry.pm
 | 
				
			||||||
Info/MAU.pm
 | 
					Info/MAU.pm
 | 
				
			||||||
MANIFEST
 | 
					MANIFEST
 | 
				
			||||||
Makefile.PL
 | 
					Makefile.PL
 | 
				
			||||||
README
 | 
					README
 | 
				
			||||||
test.pl
 | 
					t/prereq.t
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,8 +5,12 @@ use ExtUtils::MakeMaker;
 | 
				
			|||||||
WriteMakefile(
 | 
					WriteMakefile(
 | 
				
			||||||
    'NAME'               => 'SNMP::Info',
 | 
					    'NAME'               => 'SNMP::Info',
 | 
				
			||||||
    'VERSION_FROM'       => 'Info.pm',
 | 
					    'VERSION_FROM'       => 'Info.pm',
 | 
				
			||||||
# SNMP not available on CPAN -- not installable by CPAN
 | 
					    'PREREQ_PM'          => {
 | 
				
			||||||
#    'PREREQ_PM'          => {'SNMP' => '4'},
 | 
					                                'Math::BigInt' => 0
 | 
				
			||||||
 | 
					                                # SNMP not available on CPAN . 
 | 
				
			||||||
 | 
					                                # Install with net-snmp.sourceforge.net
 | 
				
			||||||
 | 
					                                # 'SNMP' => '4'
 | 
				
			||||||
 | 
					                            },
 | 
				
			||||||
    ($] >= 5.005 ?    
 | 
					    ($] >= 5.005 ?    
 | 
				
			||||||
          (ABSTRACT_FROM => 'Info.pm', 
 | 
					          (ABSTRACT_FROM => 'Info.pm', 
 | 
				
			||||||
           AUTHOR        => 'Max Baker <max@warped.org>')
 | 
					           AUTHOR        => 'Max Baker <max@warped.org>')
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										81
									
								
								t/prereq.t
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										81
									
								
								t/prereq.t
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,81 @@
 | 
				
			|||||||
 | 
					#!/usr/local/bin/perl -w
 | 
				
			||||||
 | 
					# prereq.t - Test file for prerequesites for SNMP::Info
 | 
				
			||||||
 | 
					# $Id$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use Test::More tests=> 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check for SNMP Module
 | 
				
			||||||
 | 
					my $have_snmp=0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					eval {
 | 
				
			||||||
 | 
					    require SNMP;
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if ($@){
 | 
				
			||||||
 | 
					    print STDERR <<'end_snmp';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Net-SNMP not found.  Net-SNMP installs the perl modules
 | 
				
			||||||
 | 
					SNMP and SNMP::Session.  As of version 4.2.1 and greater the Perl
 | 
				
			||||||
 | 
					modules are no longer distributed on CPAN, as they are specific to different
 | 
				
			||||||
 | 
					versions of SNMP. 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Install Net-SNMP from http://net-snmp.sourceforge.net and make sure you run
 | 
				
			||||||
 | 
					configure with the --with-perl-modules switch!
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Note to Redhat Users:  Redhat, in its infinite wisdom, does not install the 
 | 
				
			||||||
 | 
					Perl modules as part of their 8.0 RPMS.  Please uninstall them and install the
 | 
				
			||||||
 | 
					newest version by hand.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end_snmp
 | 
				
			||||||
 | 
					    ok(0,'Net-SNMP not installed, or missing Perl modules.');
 | 
				
			||||||
 | 
					} else {
 | 
				
			||||||
 | 
					    $have_snmp=1;
 | 
				
			||||||
 | 
					    ok(1,'Net-SNMP installed');
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check for version
 | 
				
			||||||
 | 
					SKIP: {
 | 
				
			||||||
 | 
					    skip('SNMP not installed, no further testing',2) unless $have_snmp;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my $VERSION = $SNMP::VERSION;
 | 
				
			||||||
 | 
					    ok(defined $VERSION ? 1 : 1, "found version for SNMP");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    my ($ver_maj,$ver_min,$ver_rev) = split(/\./,$VERSION);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ok ($ver_maj >= 4, 'Net-SNMP ver 4 or higher');
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    if ($ver_maj == 4 and $ver_min == 2 and $ver_rev == 0){
 | 
				
			||||||
 | 
					        print STDERR << "end_420";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					SNMP module version 4.2.0 found.  Please triple check that you have
 | 
				
			||||||
 | 
					version 4.2.0 of Net-SNMP installed, and that you did not accidently install
 | 
				
			||||||
 | 
					the SNMP module found on CPAN.  All newer versions are bundled with 
 | 
				
			||||||
 | 
					Net-SNMP, and are not available on CPAN.  Please find them at 
 | 
				
			||||||
 | 
					http://net-snmp.sourceforge.net .  Make sure you run configure with the 
 | 
				
			||||||
 | 
					--with-perl-modules switch.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end_420
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
 | 
					    if( $ver_maj == 5 and $ver_min == 0 and $ver_rev == 1 ){
 | 
				
			||||||
 | 
					        print STDERR << "end_501";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Perl module of Net-SNMP 5.0.1 is buggy. Please upgrade.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end_501
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    } 
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					print STDERR << "end_mibs";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Make sure you download and install the MIBS needed for SNMP::Info.   
 | 
				
			||||||
 | 
					See Man page or perldoc for SNMP::Info.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					end_mibs
 | 
				
			||||||
 | 
					# vim:syntax=perl
 | 
				
			||||||
		Reference in New Issue
	
	Block a user