其實我試圖給出sysSwYear作爲MIBNODE產生的.h & .c文件和我使用下面的命令:如何使用mib2c命令?
mib2c -c mib2c.scalar.conf sysSwYear
,但它產生以下錯誤:
You didn't give mib2c a valid OID to start with. IE, I could not find any information about the mib node "sysSwYear.0". 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 -c mib2c.scalar.conf sysSwYear.0
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.
我已經完成了爲MIB設置環境變量以及在/ usr/share/snmp/mibs中定義私有MIB文件等所有需要,但仍然沒有成功。該怎麼辦?
嗨韋斯,在嘲笑你的建議和做所有描述的事情之後,我無法得到它,然後用-Dparse選項運行snmptranslate as-> snmptranslate -Dparse ZYXEL-ES2108G-MIB :: sysSwYear,然後用這個結果 - - 找不到模塊(ZYXEL-ES2108G-MIB):在l 0 0 in(none) parse-mibs:Module ZYXEL-ES2108G-MIB not found ZYXEL-ES2108G-MIB :: sysSwYear:未知的對象標識符 即使我已經設置了Env變量路徑,並且我的MIB文件被放置在/ usr/share/snmp/mibs目錄.....我還能做什麼????? – Gaurav
嘗試將'MIBDIRS'環境變量設置爲「/ usr/share/snmp/mibs」,如果這是您放置的位置。 –
嗨Wes,我非常努力地發現,爲什麼hostname會在SNMP-Trap v2中以的身份出現......請你幫我解決這個問題..我將非常感謝你......請幫助我。這裏是陷阱的例子 - UDP:[192.168.1.150]:1028 - > [192.168.1.23] .iso.org.dod。internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance 0:0:01:07.00 .iso.org.dod.internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTrap.snmpTrapOID.0 .iso.org.dod。 internet.snmpV2.snmpModules.snmpMIB.snmpMIBObjects.snmpTraps.linkDown –
Gaurav