0

Ok, following the advice of Lex Li and I try to get Oid name using an other lib : #SnmpLib

Here the sample :

public static void Main(string[] args)
{

    string oid = ".1.3.6.1.4.1";
    IObjectRegistry registry = new ReloadableObjectRegistry(@"C:\Users\Fnizz\Desktop\MIBS_BARCO\");
    IObjectTree tree = registry.Tree;
    var o = tree.Search(ObjectIdentifier.Convert(oid));
    string textual = o.AlternativeText;
    Console.WriteLine(textual);
    if (o.GetRemaining().Count == 0)
    {
        Console.WriteLine(o.Definition.Type.ToString());
    }

    Console.ReadKey();
}

But instead of to get the value .iso.org.dod.internet.private.enterprises I get this one : .iso.3.6.1.4.1

Community
  • 1
  • 1
Florian
  • 4,507
  • 10
  • 53
  • 73

1 Answers1

0

You must use #SNMP MIB Compiler (Compiler.exe) to compile your MIB documents first. If there is any dependency missing, it will tell. Only when all dependencies are there, the Compiler can compile your documents without an error.

The compiler generates *.module files in modules folder. Then you need to put these files (*.module) into C:\Users\Fnizz\Desktop\MIBS_BARCO\ folder.

The object registry is able to load them and perform the name resolution correctly. The object registry does not under MIB documents directly, so feeding it with MIB documents will not work.

Lex Li
  • 60,503
  • 9
  • 116
  • 147