Florian
Florian

Reputation: 4728

How to get the name of an Oid ? (SnmpSharpNet lib)

How to get the name of an Oid ?

I followed examples in the site but I did not found how to do this. To retrieve MIB strings, there is no problem (example from the site) :

// Walk through returned variable bindings
foreach (Vb v in result.Pdu.VbList)
{
    // Check that retrieved Oid is "child" of the root OID
    if (rootOid.IsRootOf(v.Oid))
    {
        Console.WriteLine("{0} ({1}): {2}",
            v.Oid.ToString(),
            SnmpConstants.GetTypeName(v.Value.Type),

            v.Value.ToString());
        if (v.Value.Type == SnmpConstants.SMI_ENDOFMIBVIEW)
            lastOid = null;
        else
            lastOid = v.Oid;
    }
    else
    {
        // we have reached the end of the requested
        // MIB tree. Set lastOid to null and exit loop
        lastOid = null;
    }
}

Upvotes: 0

Views: 4603

Answers (1)

Lex Li
Lex Li

Reputation: 63122

You are warned that I am the main developer of #SNMP

To get names of OIDs, you need the corresponding MIB documents. However, I don't think SNMP#NET currently has this feature to load the MIB documents and allows you to do translation.

#SNMP has this feature for a relatively long time, and its snmptranslate sample shows how to achieve this,

http://pro.sharpsnmp.com

Upvotes: 1

Related Questions