Automation script is made to trigger when an alarm is cleared through the correlation rule, it works fine for a new alarm, but fails for an updated alarm as the alarm id is updated. Is there a solution for this problem?
Hi Nancy,
When an alarm is updated, it is indeed assigned a new alarm ID. However, the root alarm ID remains the same across all updates of that alarm. This root ID can be used to reliably identify the alarm, even when updates occur.
The root alarm ID is available in the input data passed to the automation script triggered by the correlation rule. You can parse it from there and use it instead of the (updated) alarm ID.
For more details on how to retrieve this information, please refer to the documentation: https://docs.dataminer.services/dataminer/Functions/Automation_module/FAQ/How_do_I_parse_Correlation_Alarm_Info_data.html.
ScriptParam paramCorrelationAlarmInfo = engine.GetScriptParam(65006);
string alarmInfo = paramCorrelationAlarmInfo.Value;
string[] parts = alarmInfo.Split('|');int alarmID = Tools.ToInt32(parts[0]);
int rootAlarmID = Tools.ToInt32(parts[5]);