user3379410 user3379410 - 1 year ago 100
Python Question

SNMP OID resolver

I am writing Python code in which a user inputs a SNMP OID in any of the following forms:

I want my code to resolve

I was thinking of creating a dictionary and giving the corresponding values to the object names but I don't think that's a good idea.

Please help me in guiding how should I proceed.

Answer Source
  1. NetSnmp provides a snmptranslate method - that may be useful starting point.

    Its man page says its purpose is to:

    translate MIB OID names between numeric and textual forms.

    There are already Python bindings for net-snmp available, see these SO questions.

  2. Alternatively pysnmp provides similar. See SO question "Translating pysnmp numerical oid output into symbolic names".