I made a Walker requesting a network device some information.
IPEndPoint receiver = new IPEndPoint(ip, 161);
IList<Variable> result = new List<Variable>();
WalkMode mode = WalkMode.WithinSubtree;
Messenger.Walk(VersionCode.V1, receiver, new OctetString(community), new ObjectIdentifier("1.3"), result, timeout, mode);
The code returns all OIDs perfectly on your device, but I needed to convert these names to OIDs. I saw the example that makes this translation, but it uses the compilation of MIBs, I would make this translation from the list of loaded MibModule method Parser.ParseToModules (...).
How do I link this?
var modules = Parser.ParseToModules(docs, out errors, out warnings);
var assembler = new Assembler();
assembler.Assemble(modules);
You can use Assembler
class to further process the modules. Assembler.Tree
will give you a tree (IObjectTree
) which can be used to perform OID/name translation.