阅读:3067回复:8
ucd-snmp求助
我为了扩展代理的MIB在重新编译snmpd的时候出错
cd /usr/local/src/ucd-4.2.1 ./configure -with-mib-modules=\"ucdDemoMIB\"loading cache ./config.cache checking if I need to feed myself to ksh... no checking for gcc... (cached) gcc checking whether the C compiler (gcc ) works... no configure:error:insallation or configuration problem:C compiler cannot create executables 请问是什么原因,如何解决? 注:我已经用mib2c生成了2个文件ucdDemoMIB.h和ucdDemoMIB.c,而且已经copy在/usr/local/src/ucd-snmp-4.2.1/agent/mibgroup目录下面。ucdDemoMIB.txt是copy来的例子。 |
|
沙发#
发布于:2002-08-19 08:04
你安装的是什么版本的Linux?
是否确信已经安装了所要的开发工具! |
|
|
板凳#
发布于:2002-08-19 09:49
我装的是Red Hat Linux 7.2,请问tugen gg,还要装什么开发工具?请明示(写出要装的工具名称)!请多指教!3x
|
|
地板#
发布于:2002-08-20 12:34
怎么没有高手给点指导啊,我都已经半个多月没有进展了。救命啊!
今天怎么连mib2c都没有生成.c和.h文件: [root@hfw work]#/usr/local/bin/mib2c UCD-DEMO-MIB Couldn\'t find mib reference:UCD-DEMO-MIB (注:UCD-DEMO-MIB.txt是copy的,在/usr/local/share/snmp/mibs目录下有) 到底具体应该怎么配置和设置啊?大虾怎么都不肯回答啊?快救救我吧! |
|
地下室#
发布于:2002-08-21 08:36
其实我也是接触这东西不久,所以也没有什么经验,只是多讨论一下有好处。mib2c是perl脚本,它需要SNMP.pm支持,在ucd-snmp软件包中有详细说明, 你可以按照它上面所说的进行安装。不论什么发行版的Linux,在mib2c执行前加上“export MIBS=ALL”准没有错。祝你早日成功!!!
|
|
|
5楼#
发布于:2002-08-21 08:47
多谢tugen哥哥,我去试试!
|
|
6楼#
发布于:2002-08-22 23:42
现在我重装linux(Red Hat 7.2),又重装ucd-snmp-4.2.5,认真都了INSTALL和其他的一些文章,终于能mib2c了。不过扩展mib还是不行。具体问题如下:
/usr/local/src/ucd-snmp-4.2.5/mibs /usr/local/share/snmp/mibs /usr/share/snmp/mibs 三个目录都已经有UCD-SNMP-TUTORIAL-MIB.txt /usr/local/src/ucd-snmp-4.2.5/agent/mibgroup 目录下有ustScalarSet.c & ustScalarSet.h 注::ustScalarSet.c & ustScalarSet.h 是由下面的命令生成的(我已经配置了perl/SNMP模块): # mib2c -f ustScalarSet UCD-SNMP-TUTORIAL-MIB.txt 我重新编译ucd-snmp-4.2.5(遵照INSTALL): # ./configure -with-mib-modules=\"ustScalarSet\" # make # umask 022 # <-- zero-two-two # make install # make clean 运行snmpd,然后 # snmpwalk localhost public UCD-SNMP-TUTORIAL-MIB::ustScalarSet (no any output) # snmpwalk localhost public UCD-SNMP-TUTORIAL-MIB::ustScalarSet# snmpget localhost public UCD-SNMP-TUTORIAL-MIB::ustSSSimpleString.0 Error in packet Reason: (noSuchName) There is no such variable name in this MIB. Failed object: enterprises.ucdavis.ucdExperimental.ucdSnmpTutorialMIB.ustMIBObjects.ustScalarSet.ustSSSimpleString.0 请问这是怎么回事啊?如何解决。怎么还是不支持啊? |
|
7楼#
发布于:2002-08-22 23:49
附:UCD-SNMP-TUTORIAL-MIB.txt
-- UCD-SNMP-TUTORIAL-MIB.txt 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 |
|
8楼#
发布于:2003-04-03 18:31
我也遇到了同样的问题,怎么大家不来关注阿。
在net-snmp 5.0.7中有win32的程序代码,现在我要生成企业自定义的MIB,应该怎么做,MIB文件我已经定义好了,可是不知道怎么生成这个.c .h文件。楼上说可以用mib2c,能否具体说说操作的方法阿“”“”“”“ Up 关注关注!!!!!! 非常痛恨DDOS的人 |
|