Forum Discussion

Clement_Law's avatar
9 years ago

Parsing SNMP OIDs as JSON

Hello,

I thought that this would be an obvious feature, but anyway...

Entering an OID for an SNMP datasource gives me only three ways of interpreting output - none of which are to treat it like JSON.

Can this be added as a feature?

Thanks.

  • It seems unusual for an SNMP query to return a JSON object (can't recall ever coming across such a thing), so at the moment, I don't think we'd put this on the roadmap.

    That being said, you can do this with a little more complexity.

    You can create a complex datapoint that puts all the power of groovy at your disposal to do whatever you want:

    http://www.logicmonitor.com/support/datasources/creating-managing-datasources/complex-datapoints/#Groovy-Script

    You'd add a regular datapoint that collects the data as an OID. (Doesn't really matter how it's defined.)

    Then a complex datapoint, that can access all the raw data returned by all OIDs, by using a map. So adding two datapoints:

    datapoint1 = .1.3.6.1.12.12.12

    datapoint2 = .1.3.6.1.12.12.13

    You can access them in groovy as:

    d1= output[".1.3.6.1.12.12.12"]

    d2= output[".1.3.6.1.12.12.13"]

    The d1 and d2 will contain the raw output of the SNMP response, and can be processed in groovy/java as you like...