0

I'm using net-snmp. Given a specific OID such as .1.3.6.1, how do I find the corresponding MIB/module/filename/anything where that OID is described?

I've looked through all the #include file in <net-snmp/*> but I cannot figure it out.

I was expecting something along the lines of:

struct module *netsnmp_get_module_from_oid( oid *, int oidlen );
4

1 回答 1

0

我想到了。这是一个 3 步过程:

struct tree *head = get_tree_head();
struct tree *t = get_tree( o, l, head );
struct module *m = find_module( t->modid );

这给出了模块名称、文件名和模块所做的导入列表,然后可以进一步查找。当用.1.3.6.1原始问题中的示例调用它时,这给了我:

NAME=SNMPv2-SMI
FILE=/usr/share/mibs/ietf/SNMPv2-SMI
COUNT=3
#0: LABEL=joint-iso-ccitt, ID=-1
#1: LABEL=ccitt, ID=-1
#2: LABEL=iso, ID=-1
于 2013-03-02T21:06:30.390 回答