NAME

SNMP::Info::Layer3::SONiC - SNMP Interface to SONiC switches

AUTHOR

SNMP::Info Developers

SYNOPSIS

# Let SNMP::Info determine the correct subclass for you.
my $sonic = new SNMP::Info(
                         AutoSpecify => 1,
                         Debug       => 1,
                         DestHost    => 'myswitch',
                         Community   => 'public',
                         Version     => 2
                       )
   or die "Can't connect to DestHost.\n";

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

DESCRIPTION

Subclass for switches running SONiC, both the community builds and the enterprise distributions from Dell and Broadcom. They are recognized by their sysDescr, since their sysObjectID may be Net-SNMP's, Dell's or Broadcom's.

The SNMP agent serves no ifStackTable and no IEEE8023-LAG-MIB, so link aggregation members are not reported.

Inherited Classes

SNMP::Info::Layer3::NetSNMP

Required MIBs

None.

Inherited MIBs

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

GLOBALS

These are methods that return scalar value from SNMP

Overrides

$sonic->layers()

Returns sysServices with layers 2 and 3 added. The agent reports a fixed sysServices of 72 (layers 4 and 7) whatever the switch does.

$sonic->vendor()

Returns the hardware maker named at the start of the hardware SKU, such as 'dell' for DellEMC-S5248f-P-25G-DPB or Force10-S6000, or 'accton' for Accton-AS7726-32X. Returns 'sonic' for a SKU it does not recognize.

$sonic->os()

Returns 'sonic'.

$sonic->os_ver()

Returns the software version from sysDescr, the text after SONiC., such as 4.4.1-Enterprise_Base.

$sonic->model()

Returns the hardware SKU from sysDescr (HwSku).

$sonic->serial()

Returns the chassis serial number from ENTITY-MIB.

$sonic->mac()

Returns the LLDP chassis ID when it is a MAC address, which is how the switch's neighbors identify it. Otherwise returns the inherited mac().

(lldpLocChassisId)

$sonic->sonic_loc_id_type()

The LLDP chassis ID subtype, read without the .0 instance that community builds leave off.

(lldpLocChassisIdSubtype)

$sonic->sonic_loc_id_os()

The LLDP chassis ID, read without the .0 instance.

(lldpLocChassisId)

$sonic->lldp_loc_id_type()

Returns lldpLocChassisIdSubtype, or sonic_loc_id_type() when the agent serves no .0 instance.

$sonic->lldp_loc_id_os()

Returns lldpLocChassisId, or sonic_loc_id_os() when the agent serves no .0 instance.

Global Methods imported from SNMP::Info::Layer3::NetSNMP

See documentation in SNMP::Info::Layer3::NetSNMP for details.

TABLE METHODS

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

Overrides

The keys of every LLDP neighbor method begin with 0 in place of the time mark, since the agent can serve lldpRemManAddrTable under a later time mark than lldpRemTable.

$sonic->i_index()

Returns reference to hash. Maps each interface's row index to itself. The agent serves ifIndex values one less than the row index.

$sonic->bp_index()

Returns reference to hash. Returns dot1dBasePortIfIndex when the agent serves it. Otherwise maps each interface to itself, since dot1qTpFdbPort then holds an ifIndex.

$sonic->fw_port()

Returns reference to hash. Returns the bridge port of each forwarding entry, mapped back from the ifIndex that dot1qTpFdbPort holds through bp_index(). Entries whose interface has no bridge port are left out.

$sonic->at_netaddr()

Returns reference to hash. The IPv4 address of each at_paddr() row, taken from its index. ipNetToMediaTable serves only its PhysAddress column.

$sonic->i_vlan()

Returns reference to hash of the port VLAN ID, keyed by ifIndex, as the inherited method does, leaving out ports whose dot1qPvid is 0. Enterprise SONiC 4.4 serves 0 on most ports, including ports learning addresses in a VLAN.

$sonic->i_untagged()

Same as i_vlan().

$sonic->i_vlan_membership()

Returns reference to an empty hash. Enterprise SONiC 4.4 serves the Q-BRIDGE VLAN port lists as text that does not decode to the VLAN membership, and the community agent serves none.

$sonic->i_vlan_membership_untagged()

Returns reference to an empty hash, for the reason given under i_vlan_membership().

Table Methods imported from SNMP::Info::Layer3::NetSNMP

See documentation in SNMP::Info::Layer3::NetSNMP for details.