使用mib2c报错如下:
root@ecs-435a-0002:/net-snmp/share/snmp/mibs# mib2c ZINFO-DEV-MIB:INFO
You didn't give mib2c a valid OID to start with. IE, I could not find
any information about the mib node "ZINFO-DEV-MIB:INFO". This could be caused
because you supplied an incorrectly node, or by the MIB that you're
trying to generate code from isn't loaded. To make sure your mib is
loaded, run mib2c using this as an example:
env MIBS="+MY-PERSONAL-MIB" mib2c ZINFO-DEV-MIB:INFO
You might wish to start by reading the MIB loading tutorial at:
http://www.net-snmp.org/tutorial-5/commands/mib-options.html
And making sure you can get snmptranslate to display information about
your MIB node. Once snmptranslate works, then come back and try mib2c
again.
出现这个错误之后使用snmptranslate查看错误原因;
命令行输入:
export MIBS=ZINFO-DEV-MIB
‘’ZINFO-DEV-MIB‘’就是你的mib文件的名字,无后缀;
然后使用snmptranslate查看错误原因:
snmptranslate -IR -Dparse info
最后这个info是mib文件中的一个节点的名字;执行完成之后会报如下错误,这里就是文件报错的原因,就是文件内的第几行有什么错误,书写格式什么的错误。如果没有报错说明就没有问题了。
parse-mibs:
Bad operator (IMPORTS): At line 8 in /net-snmp/share/snmp/mibs/ZINFO-DEV-MIB.txt
Unknown object identifier: info