清除 SNMP 陷阱

Clearing SNMP Trap

我正在编写一个 SNMPv2 代理并且需要发送陷阱。

陷阱发送正常,但需要在条件恢复正常时清除陷阱。目前 SNMP 接收器保持报警状态,直到手动清除。

我有发送另一个OID吗?我是 SNMP 新手。

清除逻辑在陷阱接收器端实现。此处的代理任务是为此目的发送另一个 SNMP 陷阱。最常用的场景是 linkDown/linkUp 陷阱定义在 RFC1157RFC1215 :

 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