大家好,情况是这样的,有一块 arm 开发板,板上未移植net-snmp.
我在pc上用arm-linux-gcc交叉编译了一个使用了net-snmp API的程序。
下载到板上执行时,出现错误:
Did not find 'mgmt' in module #-1 (RFC1213-MIB.txt)
Unlinked OID in RFC1213-MIB: mib-2 ::= { mgmt 1 }
Undefined identifier: mgmt near line 15 of RFC1213-MIB.txt
程序中载入MIB的代码为:
init_mib();
add_mibdir(".");
mib_tree = read_mib("RFC1213-MIB.txt");
其中RFC1213-MIB.txt也下载到了开发板上。
FAQ的说法是:
What about "unlinked OID"?
-------------------------
This means that the library has been able to find the MIB module,
and parse the individual objects defined in it, but is having problems
linking them together into a consistent tree. In particular, it
can't find an object corresponding to the name within the braces
(i.e. the 'xxx' in '{xxx 99}').
This is probably due either to a typo in this name (remember that
names are case sensitive, so a reference to 'xxx' will *not* match
a definition of 'Xxx'), or else the name is defined in another MIB
file, and this dependency is missing from the IMPORT clause of this
MIB file.
我觉得的情况应该”this dependency is missing from the IMPORT clause of this
MIB file."
我的想法是:应该载入定义了'mgmt‘的mib,可我不知道怎么载入多个mib.
以及怎么知道'mgmt‘定义在哪个文件中,望大虾指点。不甚感激.....
另外,能不能解释一下net-snmp中mib相关的知识,如“but is having problems
linking them together into a consistent tree.”所说,好像要连接成一个连续
的树,那么这一步是谁在完成,以及至少需要哪几个mib.