2

I am writing an SNMPv2 Agent and need to send traps.

Traps are being sent fine but there is a requirement to clear a trap when the condition comes back to OK. Presently the SNMP receiver remains in an alarmed state until manually cleared.

Do I have send another OID? I am new to SNMP.

Jolta
  • 2,620
  • 1
  • 29
  • 42
Lalita Kumar
  • 311
  • 1
  • 5
  • 14
  • 2
    Terminology like "clear a trap" causes confusion I think you mean "... the SNMP Manager should indicate the alarm has cleared ...". An alarm is a persistent indication of a fault that clears only when the triggering condition has been resolved. The agent may use (optionally) a trap to lets SNMP Managers know that this has happened, but it is the underlying alarm that is cleared NOT the trap per se. The manage may additionally (or solely) rely on SNMP polling to discover the change. – k1eran Dec 11 '15 at 13:41
  • Thanks so may be on SNMP Manager we should make the change that on receiving linkUP or other trap assume that previous trap is cleared out. – Lalita Kumar Dec 11 '15 at 13:49
  • Yes, when the manager learns the link is now up (either via linkUp trap or by polling) then it would be normal for the SNMP manager to clear its alarm. – k1eran Dec 11 '15 at 13:54

1 Answers1

4

Clearing logic is implemented on Trap Receiver side. The agent task here is to send another SNMP trap for that purpose. The most commonly used scenario is linkDown/linkUp traps defined in RFC1157 and RFC1215:

 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
Andrew Komiagin
  • 6,446
  • 1
  • 13
  • 23