在Ubuntu 8.04 net-snmp代理扩展的问题
本帖最后由 ma_yee 于 2010-11-08 10:46:29 编辑
环境已经编译成功
这是我自己携带MIB
NETSTONE-MIB DEFINITIONS ::= BEGIN
IMPORTS
enterprises,OBJECT-TYPE,Integer32,TimeTicks,MODULE-IDENTITY
FROM SNMPv2-SMI
OBJECT-GROUP, NOTIFICATION-GROUP
FROM SNMPv2-CONF
IpAddress
FROM RFC1155-SMI
TEXTUAL-CONVENTION, DisplayString
FROM SNMPv2-TC;
netstone OBJECT IDENTIFIER ::= { enterprises 15 }
stone OBJECT IDENTIFIER ::= { netstone 600000 }
stoneNode OBJECT IDENTIFIER ::= { stone 0 }
stoneNode1 OBJECT IDENTIFIER ::= { stoneNode 1 }
stoneNetNode OBJECT IDENTIFIER ::= { stoneNode 2 }
stoneProcNode OBJECT IDENTIFIER ::= { stoneNode 3 }
stoneAgentNode OBJECT IDENTIFIER ::= { stoneNode 4 }
stoneCpuNode OBJECT IDENTIFIER ::= { stoneNode1 3 }
stoneMemNode OBJECT IDENTIFIER ::= { stoneNode1 4 }
stoneHardNode OBJECT IDENTIFIER ::= { stoneNode1 5 }
nsCpuUpperHold OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "Cpu上限阀值"
::= { stoneCpuNode 1 }
nsCpuTemplateValue OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "Cpu瞬时值"
::= { stoneCpuNode 2 }
nsCpuNTimes OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "Cpu连续n次超过阀值产生报警"
::= { stoneCpuNode 3 }
nsMemLowerHold OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "内存下限"
::= { stoneMemNode 1 }
nsMemTemplateValue OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "内存瞬时值"
::= { stoneMemNode 2 }
nsMemNTimes OBJECT-TYPE
SYNTAX Integer32
ACCESS read-write
STATUS mandatory
DESCRIPTION "内存连续n次超过阀值产生报警"
::= { stoneMemNode 3 }
。。。 。。。
END
有mib2c 生成代码
# mib2c -c mib2c.int_watch.conf stoneCpuNode
writing to -
*** Warning: only generating code for nodes of MIB type INTEGER
writing to stoneCpuNode.h
writing to stoneCpuNode.c
running indent on stoneCpuNode.c
running indent on stoneCpuNode.h
把stoneCpuNode.c 和stoneCpuNode.h 放到..../net-snmp-5.4.2.1/agent/mibgroup 目录下,
然后
#./configure --prefix=/usr/local/snmp --enable-mfd-rewrites --with-default-snmp-version="2" --with-sys-contact="mayee" --with-sys-location="China" --enable-embedded-perl --enable-shared --with-perl-modules --with-mib-modules="agentx" -with-mib-modules="stoneCpuNode"
#make
#make install
编译安装没有报错
但是当我执行
#snmpwalk -v 2c -c publi