Hello,
I'm developing a protocol to get history alarms over a certain date interval. To do this I'm using the Repository API (https://community.dataminer.services/question/paging-when-using-getalarmdetailsfromdbmessage-and-sendslnetmessage-calls/) but I am only able to get the alarms from the Dataminer Agent where the element is installed. Is it possible to retrieve the alarms of the entire cluster (DMS)?
Thanks in advance,
Hi Max,
In that case, you can use an AlarmFilterTrue() to retrieve alarms from all elements. You should find a filter to select specific elements, limiting the number of returned alarms. The code should be something like this:
var repositoryRegistry = SLDataGateway.API.Repositories.Registry.DatabaseRepositoryRegistry.Builder
.WithConnection(Engine.SLNetRaw)
.Build();
var alarmRepository = repositoryRegistry.Get<IAlarmRepository>();
var alarmsFromDb = alarmRepository.Read(new AlarmFilterTrue(), startTime, endTime)
.Cast<AlarmEventMessage>()
.Where(a => a.Severity == "Critical")
.ToList();