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
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
sysServiceswith layers 2 and 3 added. The agent reports a fixedsysServicesof 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-DPBorForce10-S6000, or 'accton' forAccton-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 afterSONiC., such as4.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
.0instance that community builds leave off.(
lldpLocChassisIdSubtype) - $sonic->sonic_loc_id_os()
-
The LLDP chassis ID, read without the
.0instance.(
lldpLocChassisId) - $sonic->lldp_loc_id_type()
-
Returns
lldpLocChassisIdSubtype, orsonic_loc_id_type()when the agent serves no.0instance. - $sonic->lldp_loc_id_os()
-
Returns
lldpLocChassisId, orsonic_loc_id_os()when the agent serves no.0instance.
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
ifIndexvalues one less than the row index. - $sonic->bp_index()
-
Returns reference to hash. Returns
dot1dBasePortIfIndexwhen the agent serves it. Otherwise maps each interface to itself, sincedot1qTpFdbPortthen holds an ifIndex. - $sonic->fw_port()
-
Returns reference to hash. Returns the bridge port of each forwarding entry, mapped back from the ifIndex that
dot1qTpFdbPortholds throughbp_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.ipNetToMediaTableserves only itsPhysAddresscolumn. - $sonic->i_vlan()
-
Returns reference to hash of the port VLAN ID, keyed by ifIndex, as the inherited method does, leaving out ports whose
dot1qPvidis 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.