谁选择不可访问的 MIB 表索引值? SNMP 代理是否强制值的唯一性?
我正在实现一个 SNMP 代理,不确定我对如何选择“t11ZsZoneMemberIndex”对象的值(见下文)以及谁强制执行值唯一性的理解是否正确。
我的理解是,SNMP 管理器会选择“t11ZsZoneMemberIndex”对象的值,并在 SET 操作中的 VarBind 的“名称”字段中使用它。 SNMP 代理在收到 SET 时将强制执行“t11ZsZoneMemberIndex”值的唯一性。这是正确的吗?如果没有,为什么?
MIB 表是 SMIv2,带有 RowStatus 对象。我了解其他索引的值是从哪里得出的。
t11ZsZoneMemberTable OBJECT-TYPE
SYNTAX SEQUENCE OF T11ZsZoneMemberEntry
MAX-ACCESS not-accessible
::= { t11ZsConfiguration 6 }
t11ZsZoneMemberEntry OBJECT-TYPE
SYNTAX T11ZsZoneMemberEntry
MAX-ACCESS not-accessible
INDEX { fcmInstanceIndex, fcmSwitchIndex,
t11ZsServerFabricIndex, t11ZsZoneMemberParentType,
t11ZsZoneMemberParentIndex, t11ZsZoneMemberIndex }
::= { t11ZsZoneMemberTable 1 }
T11ZsZoneMemberEntry ::= SEQUENCE {
t11ZsZoneMemberParentType INTEGER,
t11ZsZoneMemberParentIndex Unsigned32,
t11ZsZoneMemberIndex Unsigned32,
t11ZsZoneMemberFormat T11ZsZoneMemberType,
t11ZsZoneMemberID OCTET STRING,
t11ZsZoneMemberRowStatus RowStatus
}
t11ZsZoneMemberParentType OBJECT-TYPE
SYNTAX INTEGER {
zone(1), -- member belongs to a Zone
alias(2) -- member belongs to a Zone Alias
}
MAX-ACCESS not-accessible
::= { t11ZsZoneMemberEntry 1 }
t11ZsZoneMemberParentIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS not-accessible
::= { t11ZsZoneMemberEntry 2 }
t11ZsZoneMemberIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS not-accessible
DESCRIPTION
"An index value that uniquely identifies this Zone
Member amongst all Zone Members in the Zone Set
database of a particular Fabric on a particular switch."
::= { t11ZsZoneMemberEntry 3 }
t11ZsZoneMemberFormat OBJECT-TYPE
SYNTAX T11ZsZoneMemberType
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 4 }
t11ZsZoneMemberID OBJECT-TYPE
SYNTAX OCTET STRING (SIZE (1..255))
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 5 }
t11ZsZoneMemberRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 6 }
I'm implementing an SNMP agent and am not sure if my understanding is correct on how values for the "t11ZsZoneMemberIndex" object (see below) are chosen, and who enforces value uniqueness.
My understanding is that an SNMP manager would chose the value for the "t11ZsZoneMemberIndex" object and use it in the "name" field of the VarBind in a SET operation. The SNMP agent would enforce the uniqueness of the "t11ZsZoneMemberIndex" value when it receives the SET. Is this correct? If not, why?
The MIB table is SMIv2, with a RowStatus object. I understand where the values for the other indexes are derived.
t11ZsZoneMemberTable OBJECT-TYPE
SYNTAX SEQUENCE OF T11ZsZoneMemberEntry
MAX-ACCESS not-accessible
::= { t11ZsConfiguration 6 }
t11ZsZoneMemberEntry OBJECT-TYPE
SYNTAX T11ZsZoneMemberEntry
MAX-ACCESS not-accessible
INDEX { fcmInstanceIndex, fcmSwitchIndex,
t11ZsServerFabricIndex, t11ZsZoneMemberParentType,
t11ZsZoneMemberParentIndex, t11ZsZoneMemberIndex }
::= { t11ZsZoneMemberTable 1 }
T11ZsZoneMemberEntry ::= SEQUENCE {
t11ZsZoneMemberParentType INTEGER,
t11ZsZoneMemberParentIndex Unsigned32,
t11ZsZoneMemberIndex Unsigned32,
t11ZsZoneMemberFormat T11ZsZoneMemberType,
t11ZsZoneMemberID OCTET STRING,
t11ZsZoneMemberRowStatus RowStatus
}
t11ZsZoneMemberParentType OBJECT-TYPE
SYNTAX INTEGER {
zone(1), -- member belongs to a Zone
alias(2) -- member belongs to a Zone Alias
}
MAX-ACCESS not-accessible
::= { t11ZsZoneMemberEntry 1 }
t11ZsZoneMemberParentIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS not-accessible
::= { t11ZsZoneMemberEntry 2 }
t11ZsZoneMemberIndex OBJECT-TYPE
SYNTAX Unsigned32 (1..4294967295)
MAX-ACCESS not-accessible
DESCRIPTION
"An index value that uniquely identifies this Zone
Member amongst all Zone Members in the Zone Set
database of a particular Fabric on a particular switch."
::= { t11ZsZoneMemberEntry 3 }
t11ZsZoneMemberFormat OBJECT-TYPE
SYNTAX T11ZsZoneMemberType
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 4 }
t11ZsZoneMemberID OBJECT-TYPE
SYNTAX OCTET STRING (SIZE (1..255))
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 5 }
t11ZsZoneMemberRowStatus OBJECT-TYPE
SYNTAX RowStatus
MAX-ACCESS read-create
::= { t11ZsZoneMemberEntry 6 }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你说得对,是的。但它稍微复杂一些:SNMP 要求整套 MIB 索引放在一起时必须是唯一的。因此,上述 MIB 有 6 个索引,因此表中的每一行对于这 6 个值的每种组合都可以有一行。这意味着从技术上讲,只要另一个索引值不同,t11ZsZoneMemberIndex 的值就可能重复。
如果要求 t11ZsZoneMemberIndex 本身是唯一的,那么 MIB 确实应该以这种方式定义,并使其成为 MIB INDEX 列表中的单个且唯一的对象。不需要向索引本身添加多个唯一索引(并且浪费带宽)。
但是,如果有多个唯一实例,并且当管理器执行 SET 时它们可能会发生冲突,那么是的...由管理器拒绝 SET 请求并在发送的数据与内部不兼容时返回错误什么是可以接受的概念。
You have it right, yes. But it's slightly more complex: the SNMP requirements are that the entire set of MIB indexes must be unique when put together. Thus, the above MIB has 6 indexes so each row in the table can have a single row for every combination of those 6 values. Which means that technically the value for t11ZsZoneMemberIndex may be duplicated as long as another index value is different.
If there is a requirement that t11ZsZoneMemberIndex be unique in itself, then the MIB really should have been defined that way and made it the single and only object in the MIB INDEX list. There is no need to add multiple unique indexes to the index itself (and is a waste of bandwidth).
But if there are multiple unique instances, and they can concflict when a manager performs the SET, then yes... It's up to the manager to reject the SET request and return an error when the data being sent isn't compatible with the internal notion of what is acceptable.