I am trying to get past alarms from a DMA. For example, alarms between the dates 11/07/2020 - 11/12/2020. I was looking at the list of SLNet calls and saw a "GetHistoryAlarmsMessage". I am not sure if this is the correct call to use, but I did use it in the client test tool, however, I was not able to see earlier alarms from that day. Any suggestions on how I can retrieve older alarms or how to correctly use the "GetHistoryAlarmsMessage" would be greatly appreciated.
Hello, In QA we use the GetAlarmDetailsFromDbMessage to retrieve history alarms or information events. If you don't need any filter, you need to use new Skyline.DataMiner.Net.Filters.AlarmFilterTrue() as filter in the message.
public List<AlarmEventMessage> checkHistoryAlarm(QAElement e, DateTime dtStart, DateTime dtStop) { AlarmFilter AF = new AlarmFilter(); AlarmFilterItem AFIelement = new AlarmFilterItemString(AlarmFilterField.ElementID, AlarmFilterCompareType.WildcardEquality, new string[] { e.GetElementName() }); AF.FilterItems = new AlarmFilterItem[] { AFIelement }; GetAlarmDetailsFromDbMessage GADFMDB2 = new GetAlarmDetailsFromDbMessage(e.HostingDMAID, AF, dtStart, dtStop, true, false); DMSMessage[] DMSarr = Engine.SLNet.SendMessage(GADFMDB2); List<AlarmEventMessage> AlarmList = new List<AlarmEventMessage>(); foreach (AlarmEventMessage AEM in DMSarr) { AlarmList.Add(AEM); } return AlarmList; }
Regards,
Moderator note: This is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice.