Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rfc2737]: Handle unicode error when parsing transceiver (#235)
- What I did If there is an issue in transceiver data and some junk characters are present in transceiver data, then SNMP does not parse this information and transceiver MIB cannot be queried. Error seen in such scenario: show interface transceiver eeprom ... Ethernet5: SFP EEPROM detected Connector: Unknown Encoding: Unknown Extended Identifier: Unknown Extended RateSelect Compliance: Unknown Identifier: Unknown Length Cable Assembly(m): 255 Length OM1(m): 255 Length OM2(m): 255 Length OM3(2m): 255 Length(km): 255 Nominal Bit Rate(100Mbs): 255 Specification compliance: 10/40G Ethernet Compliance Code: 10GBase-LR Fibre Channel Speed: 100 Mbytes/Sec Fibre Channel link length/Transmitter Technology: AAA Fibre Channel transmission media: AAA Gigabit Ethernet Compliant codes: 1000BASE-CX SAS/SATA compliance codes: AAA SONET Compliance codes: AAA Vendor Date Code(YYYY-MM-DD Lot): 20ÿÿ-ÿÿ-ÿÿ ÿÿ Vendor Name: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Vendor OUI: AAA Vendor PN: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Vendor Rev: ÿÿ Vendor SN: ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ Error log in syslog: INFO snmp#supervisord: snmp-subagent ERROR:ax_interface:MIBUpdater.start() caught an unexpected exception during update_data() INFO snmp#supervisord: snmp-subagent Traceback (most recent call last): INFO snmp#supervisord: snmp-subagent File "/usr/local/lib/python3.6/dist-packages/ax_interface/mib.py", line 40, in start INFO snmp#supervisord: snmp-subagent self.reinit_data() INFO snmp#supervisord: snmp-subagent File "/usr/local/lib/python3.6/dist-packages/sonic_ax_impl/mibs/ietf/rfc2737.py", line 192, in reinit_data INFO snmp#supervisord: snmp-subagent self._update_transceiver_cache(interface) INFO snmp#supervisord: snmp-subagent File "/usr/local/lib/python3.6/dist-packages/sonic_ax_impl/mibs/ietf/rfc2737.py", line 276, in _update_transceiver_cache INFO snmp#supervisord: snmp-subagent self.physical_model_name_map[sub_id] = get_transceiver_data(transceiver_info) INFO snmp#supervisord: snmp-subagent File "/usr/local/lib/python3.6/dist-packages/sonic_ax_impl/mibs/ietf/rfc2737.py", line 76, in <genexpr> INFO snmp#supervisord: snmp-subagent for xcvr_field in XcvrInfoDB) Because of this xcvr MIB does not provide expected output: iso.3.6.1.2.1.47.1.1.1.1.13.5000 = No Such Instance currently exists at this OID To avoid seeing this error message and to retrieve the transceiver information that is available in SNMP output, this fix is made. - How I did it Handle unicode error to handle parsing error seen in snmp_ax_impl. - How to verify it In the device where the above error was seen, fix was made and tested. No error message in syslog. Able to retrieve xcvr information using OID: iso.3.6.1.2.1.47.1.1.1.1
- Loading branch information