The alarmLink property is included in SNMP trap messages and can be used to retrieve the alarmID from the URL but its value is not consistently present for "cleared" alarm events.
For example:
clearAlarm method, the alarmLink property includes the complete URL—for example, https://foglight.yourdomain:8443/aui/alarm-details/1c43fd65-638b-4fcf-801e-efe0a01a0ca1alarmLink value is No alarm reported.This behavior is intentional.
When an alarm is automatically cleared, Foglight recognizes that the condition has returned to normal and updates the URL accordingly. However, when alarms are cleared manually or via script, it’s uncertain whether the condition has truly normalized, so the original URL is retained.
As a workaround, to obtain the alarmID value, the Forward Alarms as SNMP Traps rule can be customized to include the alarmID property value in the SNMP Trap message; for example:
eventAlarmID with the Expression/Messages set to @event.get("alarmID")VarBind01OID user defined value to 1.3.6.1.4.1.7572.1.4.100VarBind01Value user defined value to the name of the variable @eventAlarmIDNote: Use the next available binding variable and specify the OID value accordingly, for more information refer to Support for customized values in Foglight trap actions (4228912).