After enabling the Forward Alarms as SNMP Traps rule, we noticed that the trap was actually sent twice, once when the alarm was cleared and once when it was raised again.
Is there a way to suppress sending the SNMP Trap for a cleared alarm?
How to filter alarms that are forwarded as SNMP Traps?
The Forward Alarms as SNMP Traps doesn't filter any AlarmSystemEvents. Foglight generates an event when an Alarm fires but also when it's cleared or acknowledged.
The default rule condition statement can be customized to filter forwarded alarms based on the event properties.
To suppress sending an SNMP Trap for an alarm cleared event, modify the condition statement from:
true
to:
!@event.get("isCleared")
To suppress sending an SNMP Trap for alarm cleared and alarm acknowledged events, update the condition statement to:
!@event.get("isCleared") && !@event.get("isAcknowledged")
Notes:
Additional information about the Forward Alarms as SNMP Traps action and available parameters can be found under the Manage Rules section of the Foglight documentation.
Information on the event properties is available on the same documentation under section Write a conditional expression for an event-driven rule.
Other related solutions:
Unable to use Send SNMP Trap Action from Event Driven rules