简体   繁体   English

如何获得Oid的名称? (SnmpSharpNet库)

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

How to get the name of an Oid ? 如何获得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) : 检索MIB字符串,没有问题(例如网站上的示例):

// 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;
    }
}

You are warned that I am the main developer of #SNMP 警告您,我是#SNMP的主要开发人员

To get names of OIDs, you need the corresponding MIB documents. 要获取OID的名称,您需要相应的MIB文档。 However, I don't think SNMP#NET currently has this feature to load the MIB documents and allows you to do translation. 但是,我不认为SNMP#NET当前具有加载MIB​​文档并允许您进行翻译的功能。

#SNMP has this feature for a relatively long time, and its snmptranslate sample shows how to achieve this, #SNMP在较长时间内具有此功能,其snmptranslate示例显示了如何实现此功能,

http://pro.sharpsnmp.com http://pro.sharpsnmp.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM