阅读:2576回复:2
add mib
看来大家和我一样都遇到了“add mib”的麻烦!!
我希望大家可以在此讨论!!! 我在linux-7.2下安装了ucd-snmp-4.2.2 安装方法如下: [root@localhost ucd-snmp-4.2.2]./configure [root@localhost ucd-snmp-4.2.2]make [root@localhost ucd-snmp-4.2.2]make install 安装完毕!!! 运行! [root@localhost ucd-snmp-4.2.2]/usr/local/sbin/snmpd 一切正常! 但是我还想定义自己的mib,我定义了一个自己的mib如下: UCD-SNMP-TUTORIAL-MIB DEFINITIONS ::= BEGIN IMPORTS ucdExperimental FROM UCD-SNMP-MIB, MODULE-IDENTITY FROM SNMPv2-SMI MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CONF; ucdSnmpTutorialMIB MODULE-IDENTITY LAST-UPDATED \"0005150000Z\" ORGANIZATION \"UCDavis\" CONTACT-INFO \" Author: Wes Hardaker University of California at Davis postal: IT-DCAS UCDavis Davis, CA 95616 USA email: wjhardaker@ucdavis.edu phone: +1-530-754-7571 \" DESCRIPTION \"A simple mib for demonstration purposes. \" ::= { ucdExperimental 4242 } ustMIBObjects OBJECT IDENTIFIER ::= { ucdSnmpTutorialMIB 1 } ustMIBConformance OBJECT IDENTIFIER ::= { ucdSnmpTutorialMIB 2 } ustScalarSet OBJECT IDENTIFIER ::= { ustMIBObjects 1 } ustSSSimpleString OBJECT-TYPE SYNTAX OCTET STRING MAX-ACCESS read-write STATUS current DESCRIPTION \"This is a simple test string. It does nothing more than return its current value, and changes values only when set by an incoming SNMP set request.\" DEFVAL { Hello World } ::= { ustScalarSet 1 } ustSSSecondsSinceChanged OBJECT-TYPE SYNTAX TimeTicks UNITS \"1/100th Seconds\" MAX-ACCESS read-only STATUS current DESCRIPTION \"This object indicates the number of 1/100th seconds since the ustSSSimpleString object has changed. If it is has never been modified, it will be the time passed since the start of the agent.\" ::= { ustScalarSet 2 } END 然后,我把它cp到了/usr/local/share/snmp/mibs 进行如下操作: [root@localhost ucd-snmp-4.2.2]# /usr/local/bin/mib2c ustScalarSet \"UCD-SNMP-TUTORIAL-MIB.txt\" -f ustScalarSet [root@localhost ucd-snmp-4.2.2]# cp ustScalarSet.* ./agent/mibgroup/ [root@localhost ucd-snmp-4.2.2]# ./configure -with-mib-modules=\"ustScalarSet\" 以上操作都正确!!!!!!!但是在进行如下操作时却出现了错误! [root@localhost ucd-snmp-4.2.2]#make ustScalarSet.c: In function `var_sysORTable\': ustScalarSet.c:1132: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c:1132: (Each undeclared identifier is reported only once ustScalarSet.c:1132: for each function it appears in.) ustScalarSet.c: In function `var_ifTable\': ustScalarSet.c:1201: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_atTable\': ustScalarSet.c:1366: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ipAddrTable\': ustScalarSet.c:1434: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ipRouteTable\': ustScalarSet.c:1512: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ipNetToMediaTable\': ustScalarSet.c:1633: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_tcpConnTable\': ustScalarSet.c:1706: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_udpTable\': ustScalarSet.c:1784: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_egpNeighTable\': ustScalarSet.c:1846: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ifXTable\': ustScalarSet.c:1973: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ifStackTable\': ustScalarSet.c:2137: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ifTestTable\': ustScalarSet.c:2193: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `var_ifRcvAddressTable\': ustScalarSet.c:2279: `TABLE_SIZE\' undeclared (first use in this function) ustScalarSet.c: In function `write_sysContact\': ustScalarSet.c:2338: incompatible types in assignment ustScalarSet.c: In function `write_sysName\': ustScalarSet.c:2400: incompatible types in assignment ustScalarSet.c: In function `write_sysLocation\': ustScalarSet.c:2462: incompatible types in assignment ustScalarSet.c: In function `write_atPhysAddress\': ustScalarSet.c:2648: incompatible types in assignment ustScalarSet.c: In function `write_atNetAddress\': ustScalarSet.c:2710: incompatible types in assignment ustScalarSet.c: In function `write_ipRouteDest\': ustScalarSet.c:2896: incompatible types in assignment ustScalarSet.c: In function `write_ipRouteNextHop\': ustScalarSet.c:3268: incompatible types in assignment ustScalarSet.c: In function `write_ipRouteMask\': ustScalarSet.c:3454: incompatible types in assignment ustScalarSet.c: In function `write_ipNetToMediaPhysAddress\': ustScalarSet.c:3640: incompatible types in assignment ustScalarSet.c: In function `write_ipNetToMediaNetAddress\': ustScalarSet.c:3702: incompatible types in assignment ustScalarSet.c: In function `write_ifAlias\': ustScalarSet.c:4136: incompatible types in assignment ustScalarSet.c: In function `write_ifTestOwner\': ustScalarSet.c:4446: incompatible types in assignment make[2]: *** [ustScalarSet.lo] Error 1 make[2]: Leaving directory `/home/zhaolx/test/ucd-snmp-4.2.2/agent/mibgroup\' 请大虾帮忙!! 请大虾帮忙!! 非常感谢!! 请大家讨论!!! |
|
最新喜欢:okincn
|
沙发#
发布于:2003-04-03 18:28
俺也遇到和你一样的问题,我也要添加自己定义的一个MIB,用mib2c应该怎么生成企业自定义的.c .h文件阿?
怎么班主 和 有能力的人都不来留言发表高见阿。。 我发现留言回复率越来越低了,这样不利于解决问题阿。 上面的老兄,你的问题解决了么?要是解决了,能否把解决的方法流在下面。 我的QQ:11822654欢迎在线交流 |
|
板凳#
发布于:2003-04-03 18:41
http://www.driverdevelop.com:90/forum/viewthread.php?tid=35887
我原来的问题,希望大家能帮我解决。 |
|