---
name: "SNMP::Info::Layer2::C1900"
section: "3pm"
platform: "linux"
package: "libsnmp-info-perl"
version: "3.972002-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SNMP::Info::Layer2::C1900"
---

# SNMP::Info::Layer2::C1900(3pm)

SNMP Interface to data from Cisco Catalyst 1900 Network Switches running CatOS

## NAME

SNMP::Info::Layer2::C1900 - SNMP Interface to data from Cisco Catalyst 1900 Network Switches running CatOS

## AUTHOR

Max Baker

## SYNOPSIS

```
 # Let SNMP::Info determine the correct subclass for you.
 my $c1900 = new SNMP::Info(
                          AutoSpecify => 1,
                          Debug       => 1,
                          DestHost    => 'myswitch',
                          Community   => 'public',
                          Version     => 1
                        )
    or die "Can't connect to DestHost.\n";
 my $class      = $c1900->class();
 print "SNMP::Info determined this device to fall under subclass : $class\n";
```

## 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.

### Inherited classes

- SNMP::Info::CDP

  - SNMP::Info::CiscoStats

  - SNMP::Info::CiscoConfig

  - SNMP::Info::CiscoStpExtensions

  - SNMP::Info::CiscoAgg

  - SNMP::Info::Layer2

  ### Required MIBs

- *STAND-ALONE-ETHERNET-SWITCH-MIB (ESSWITCH-MIB)*

  *ESSWITCH-MIB* is included in the Version 1 MIBs from Cisco.

### Inherited MIBs

See "Required MIBs" in SNMP::Info::CDP for its MIB requirements.

See "Required MIBs" in SNMP::Info::CiscoStats for its MIB requirements.

See "Required MIBs" in SNMP::Info::CiscoConfig for its MIB requirements.

See "Required MIBs" in SNMP::Info::CiscoStpExtensions for its MIB requirements.

See "Required MIBs" in SNMP::Info::CiscoAgg for its MIB requirements.

See "Required MIBs" in SNMP::Info::Layer2 for its MIB requirements.

## GLOBALS

These are methods that return scalar value from SNMP

- $c1900-\>**c1900\_flash\_status()**

  Usually contains the version of the software loaded in flash. Used by **os\_ver()**

  `"STAND-ALONE-ETHERNET-SWITCH-MIB::upgradeFlashBankStatus"`

- $c1900-\>**os()**

  Returns 'catalyst'

- $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.

- $c1900-\>**vendor()**

  Returns 'cisco'

### Overrides

- $c1900-\>**cisco\_comm\_indexing()**

  Returns 1.  Use vlan indexing.

- $c1900-\>bulkwalk\_no

  Return `1`.  Bulkwalk is turned off for this class.

### Globals imported from SNMP::Info::CDP

See "GLOBALS" in SNMP::Info::CDP for details.

### Globals imported from SNMP::Info::CiscoStats

See "GLOBALS" in SNMP::Info::CiscoStats for details.

### Globals imported from SNMP::Info::CiscoConfig

See "GLOBALS" in SNMP::Info::CiscoConfig for details.

### Globals imported from SNMP::Info::CiscoStpExtensions

See "GLOBALS" in SNMP::Info::CiscoStpExtensions for details.

### Globals imported from SNMP::Info::Layer2

See "GLOBALS" in SNMP::Info::Layer2 for details.

## TABLE METHODS

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

### Overrides

- $c1900-\>**interfaces()**

  Returns reference to the map between IID and physical Port.

- $c1900-\>**i\_duplex()**

  Returns reference to map of IIDs to current link duplex

- $c1900-\>**i\_duplex\_admin()**

  Returns reference to hash of IIDs to admin duplex setting

- $c1900-\>**i\_name()**

  Crosses `"ifName"` with `$c1900`-\>**c1900\_p\_name()** and returns the human set port name if exists.

- $c1900-\>**i\_vlan()**

  Returns a mapping between the interface and the VLAN / bridge group if overlap is not enabled.

- $c1900-\>**i\_vlan\_membership()**

  Returns reference to hash of arrays: key = interface, value = array of VLAN / bridge group IDs.

  ```
    Example:
    my $interfaces = $c1900->interfaces();
    my $vlans      = $c1900->i_vlan_membership();
    foreach my $iid (sort keys %$interfaces) {
      my $port = $interfaces->{$iid};
      my $vlan = join(',', sort(@{$vlans->{$iid}}));
      print "Port: $port VLAN: $vlan\n";
    }
  ```

- $c1900-\>**i\_vlan\_membership\_untagged()**

  Unsupported, returns nothing.

- $c1900-\>**bp\_index()**

  Returns a bp\_index that contains the original bp\_index entries and extra entries for those interfaces listed in if\_index, as some C1900 devices do not return complete bp\_indexes.

### *STAND-ALONE-ETHERNET-SWITCH-MIB* Switch Port Table Entries:

- $c1900-\>**c1900\_p\_index()**

  Maps the Switch Port Table to the IID

  `"swPortIfIndex"`

- $c1900-\>**c1900\_p\_duplex()**

  Gives Port Duplex Info

  (`"swPortDuplexStatus"`)

- $c1900-\>**c1900\_p\_duplex\_admin()**

  Gives admin setting for Duplex Info

  (`"swPortFullDuplex"`)

- $c1900-\>**c1900\_p\_name()**

  Gives human set name for port

  (`"swPortName"`)

- $c1900-\>**c1900\_p\_up\_admin()**

  Gives Admin status of port enabled.

  (`"swPortAdminStatus"`)

- $c1900-\>**c1900\_p\_type()**

  Gives Type of port, i.e. `"general-ethernet"`

  (`"swPortMediaCapability"`)

- $c1900-\>**c1900\_p\_media()**

  Gives the media of the port , i.e. "`"fiber-sc"`"

  (`"swPortConnectorType"`)

### Table Methods imported from SNMP::Info::CDP

See "TABLE METHODS" in SNMP::Info::CDP for details.

### Table Methods imported from SNMP::Info::CiscoStats

See "TABLE METHODS" in SNMP::Info::CiscoStats for details.

### Table Methods imported from SNMP::Info::CiscoConfig

See "TABLE METHODS" in SNMP::Info::CiscoConfig for details.

### Table Methods imported from SNMP::Info::CiscoStpExtensions

See "TABLE METHODS" in SNMP::Info::CiscoStpExtensions for details.

### Table Methods imported from SNMP::Info::CiscoAgg

See "TABLE METHODS" in SNMP::Info::CiscoAgg for details.

### Table Methods imported from SNMP::Info::Layer2

See "TABLE METHODS" in SNMP::Info::Layer2 for details.

## SET METHODS

These are methods that provide SNMP set functionality for overridden methods or provide a simpler interface to complex set operations.  See "SETTING DATA VIA SNMP" in SNMP::Info for general information on set operations.

- $c1900-\>set\_i\_duplex\_admin(duplex, ifIndex)

  Sets port duplex, must be supplied with duplex and port `"ifIndex"`.  Speed choices are 'auto', 'half', 'full'.

  ```
    Example:
    my %if_map = reverse %{$c1900->interfaces()};
    $c1900->set_i_duplex_admin('auto', $if_map{'1'})
      or die "Couldn't change port duplex. ",$c1900->error(1);
  ```
