我正在编写一个 SNMPv2 代理并需要发送陷阱。
陷阱发送正常,但需要在条件恢复正常时清除陷阱。目前 SNMP 接收器保持报警状态,直到手动清除。
我是否发送了另一个 OID?我是 SNMP 新手。
清除逻辑在 Trap Receiver 端实现。此处的代理任务是为此目的发送另一个 SNMP 陷阱。最常用的场景是RFC1157和RFC1215中定义的linkDown / linkUp陷阱:
linkDown TRAP-TYPE
ENTERPRISE snmp
VARIABLES { ifIndex }
DESCRIPTION
"A linkDown trap signifies that the sending
protocol entity recognizes a failure in one of
the communication links represented in the
agent's configuration."
::= 2
linkUp TRAP-TYPE
ENTERPRISE snmp
VARIABLES { ifIndex }
DESCRIPTION
"A linkUp trap signifies that the sending
protocol entity recognizes that one of the
communication links represented in the agent's
configuration has come up."
::= 3