我正在编写一个SNMP管理器和一个来自MIB的模拟SNMP代理(用来测试管理器)。我有一个类似于下面的表格,经理应该能够添加/删除行。使用RowStatus做这件事的习惯方法是什么?是否先设置RowStatus?PDU中是否可以包含其他OID?
我最初的用例是启动时表是空的。因此,如果我像这样发送一个设置的PDU:
createStuffEntry.1.1.1 = 1
createStuffEntry.2.1.1 = 1
createStuffEntry.3.1.1 = 99
createStuffEntry.4.1.1 = "Dustbunnies"
createStuffEntry.5.1.1 = 5这是否适用于下面的定义?如果省略了cRowStatus,会发生什么?
createStuffTable OBJECT-TYPE
SYNTAX SEQUENCE OF CreateStuffEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"A table for creating stuff."
::= { parentGroup 1 }
createStuffEntry OBJECT-TYPE
SYNTAX CreateStuffEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"An entry for building a stuff to create."
INDEX { cPlanID, cID }
::= { createStuffTable 1 }
CreateStuffEntry ::=
SEQUENCE {
cPlanID
INTEGER,
cID
INTEGER,
cTemplateID
INTEGER,
cStuffName
DisplayString,
cRowStatus
RowStatus
}
cPlanID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The plan ID (cpPlanID)"
::= { createStuffEntry 1 }
cID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The table entry index."
::= { createStuffEntry 2 }
cTemplateID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The ID of the stuff template to create this stuff from."
::= { createStuffEntry 3 }
cStuffName OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The stuff name."
::= { createStuffEntry 4 }
cRowStatus OBJECT-TYPE
SYNTAX RowStatus
ACCESS read-write
STATUS current
DESCRIPTION
"This OID uses six main statuses:
active(1) is in use and available in stuffTable
notinService(2) it is present but not yet created
notReady(3) it is present but missing info
createAndGo(4) create stuff in stuffTable. Row will be
added to this table if necessary.
createAndWait(5) add stuff row to this table
destroy(6) will remove the stuff row
This OID is used to add/remove rows for stuff creation.
It can also be used to determine if a stuff has been
created successfully."
::= { createStuffEntry 5 }注意:这是一个使用RowStatus作为定义类型的SMI v1 MIB,类似于所述的here。因此,read-create是隐含的,而不是这里声明的。
发布于 2011-02-04 06:27:17
RowStatus文本约定实际上为代理如何实现它提供了相当大的回旋余地。因此,管理器必须支持这两种方式,而代理只能支持其中一种方式(但可以支持两种方式):
将row状态变量设置为"createAndWait"
中的变量包括****
不幸的是,管理者需要聪明,并知道如何与支持其中之一的代理交谈。人们普遍认为,与微不足道的代理相比,管理者更强大,有更多的空间来处理问题。然而,许多小型设备只支持上面的#2。
https://stackoverflow.com/questions/4891988
复制相似问题