Rabbit Guy
Rabbit Guy

Reputation: 1892

How to walk OIDs in SNMP

I am writing an application to monitor SNMP devices in our network. There are a poop ton of OIDs that I can and cannot ask data for on these devices. How do I determine what I can and what I cannot ask for data from these? First, what are all the OIDs that are valid, and then secondly, which ones are valid for the device I am querying.

In just one subnet I found approximate 3 dozen devices that replied, so I am assuming that I've got a couple of hundred here to query.

Upvotes: 0

Views: 383

Answers (1)

Gambit Support
Gambit Support

Reputation: 1463

There is no information beforehand that you can query to find out the set of OIDs you can retrieve. You have to query them, and on failure you know you cannot query them. Anything else would be a security risk.

Luckily, the SNMP standard has GETNEXT, ie. you don't need to know what OIDs to query. You can automatically traverse (walk) all variables available to you (given authentication/privacy access), then determine what to do.

If you traverse the system group in MIB-2, which is the most basic info you can retrieve, then you can determine the type of system, and get it's capabilities from that. NMS application vendors have databases of that, which is proprietary IP. You can consult your vendors' documentation for that.

Upvotes: 2

Related Questions