当前位置: 技术问答>linux和unix
关于linux系统下基于NET-SNMP开发使用mib2c工具生成出现错误。--在线等。
来源: 互联网 发布时间:2016-03-07
本文导语: 使用HOST-RESOURCES-MIB.txt(NET-SNMP现有的文件)生成host.c和host.h出现错误,请大家指教 iz:~/Desktop/mibcode20080305# /usr/local/bin/mib2c hostResourcesMib---------执行语句 根据错误提示,应该是node没有找到,或者是mib文本...
使用HOST-RESOURCES-MIB.txt(NET-SNMP现有的文件)生成host.c和host.h出现错误,请大家指教
iz:~/Desktop/mibcode20080305# /usr/local/bin/mib2c hostResourcesMib---------执行语句
根据错误提示,应该是node没有找到,或者是mib文本文件需要load,可是这些我都做了,还是出现这样的问题,请大家指教。
You didn't give mib2c a valid OID to start with. IE, I could not find
any information about the mib node "hostResourcesMib". 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 hostResourcesMib
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.
iz:~/Desktop/mibcode20080305# /usr/local/bin/mib2c hostResourcesMib---------执行语句
根据错误提示,应该是node没有找到,或者是mib文本文件需要load,可是这些我都做了,还是出现这样的问题,请大家指教。
You didn't give mib2c a valid OID to start with. IE, I could not find
any information about the mib node "hostResourcesMib". 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 hostResourcesMib
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.
|
你写个perl脚本吧:
#!/usr/bin/perl
$| = 1;
use SNMP;
$ENV{'MIBS'} = 'ALL';
&SNMP::initMib();
$SNMP::best_guess = 2;
$include_module = 1;
print "n";
`mib2c -c Your.mib2c.conf hostResourcesMib`;
#!/usr/bin/perl
$| = 1;
use SNMP;
$ENV{'MIBS'} = 'ALL';
&SNMP::initMib();
$SNMP::best_guess = 2;
$include_module = 1;
print "n";
`mib2c -c Your.mib2c.conf hostResourcesMib`;