++ed by:

3 PAUSE users
1 non-PAUSE user.

Author image Max Baker


SNMP::Info::Layer2::Catalyst - Perl5 Interface to Cisco devices running Catalyst OS


Max Baker (max@warped.org)


 # Let SNMP::Info determine the correct subclass for you. 
 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";

 my $class      = $cat->class();
 print "SNMP::Info determined this device to fall under subclass : $class\n";


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(...);

Inherited Classes


Required MIBs

Inherited Classes' MIBs

See SNMP::Info::Layer2 for its own MIB requirements.

These MIBs are found in the standard v2 MIBs from Cisco.


These are methods that return scalar value from SNMP










Returns 'catalyst'


Tries to use the value from SNMP::Info::CiscoStats->os_ver() and if it fails it grabs $cat->m_swver()->{1} and uses that.














Returns 'cisco'

Globals imported from SNMP::Info::Layer2

See documentation in SNMP::Info::Layer2 for details.


These are methods that return tables of information in the form of a reference to a hash.



Crosses p_port() with i_index() to get physical names.


Returns a map to IID for ports that are physical ports, not vlans, etc.


Crosses p_port() with p_type() and returns the results.

Overrides with ifType if p_type() isn't available.


Crosses p_name with p_port and returns results.


Crosses p_duplex with p_port and returns results.


Crosses p_duplex_admin with p_port.

Munges bit_string returned from p_duplex_admin to get duplex settings.

Module table

This table holds configuration information for each of the blades installed in the Catalyst device.














Returns a list of space separated status strings for the ports.

To see the status of port 4 :

    @ports_status = split(' ', $cat->m_ports_status() );
    $port4 = $ports_status[3];














Modules - Router Blades







Port Entry Table (CISCO-STACK-MIB::portTable)















Port Capability Table (CISCO-STACK-MIB::portCpbTable)





VLAN Entry Table

See ftp://ftp.cisco.com/pub/mibs/supportlists/wsc5000/wsc5000-communityIndexing.html for a good treaty of how to connect to the VLANs









Table Methods imported from SNMP::Info::Layer2

See documentation in SNMP::Info::Layer2 for details.