Skip to content

Make get_snmp_data more robust#6798

Merged
pvizeli merged 1 commit into
home-assistant:devfrom
tantecky:snmp-robust
Mar 27, 2017
Merged

Make get_snmp_data more robust#6798
pvizeli merged 1 commit into
home-assistant:devfrom
tantecky:snmp-robust

Conversation

@tantecky
Copy link
Copy Markdown
Contributor

Description:

Handle cases when non-binary data are encounter in a SNMP response.

E.g. the following command: snmpwalk -v1 -c public myrouter 1.3.6.1.2.1.9999 returns a list of currently assigned MAC addresses from Mikrotik router:

SNMPv2-SMI::mib-2.9999.1.1.6.4.1.7.192.168.3.4 = INTEGER: 3
SNMPv2-SMI::mib-2.9999.1.1.6.4.1.7.192.168.3.2 = INTEGER: 3
SNMPv2-SMI::mib-2.9999.1.1.6.4.1.8.192.168.3.4 = Hex-STRING: 01 06 BC 5F F4 FF 03 27 
SNMPv2-SMI::mib-2.9999.1.1.6.4.1.8.192.168.3.2 = Hex-STRING: 01 06 BC 5F F4 FF 02 9C

which throws an AttributeError, because Integer does not have asOctets() method.

@mention-bot
Copy link
Copy Markdown

@tantecky, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tomduijf, @fabaff and @T3m3z to be potential reviewers.

@homeassistant
Copy link
Copy Markdown
Contributor

Hi @tantecky,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@pvizeli pvizeli merged commit a70af62 into home-assistant:dev Mar 27, 2017
@tantecky tantecky deleted the snmp-robust branch March 27, 2017 10:43
@fabaff fabaff mentioned this pull request Apr 6, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants