Hi Skyline team,
I'm currently working on building a real-time updating table using GQI and automation. I'm trying to apply a saved alarm filter (created previously in the Alarm Console) to retrieve the initial set of alarms. I'm using a filter because the alarms are being generated by a correlation rule.
I'm using GetActiveAlarmsMessage
filtered by name, as suggested in the documentation. However, it's not working as expected when I implement it through automation, I'm receiving all alarms instead of just the filtered ones.
Here's the snippet of code I'm using:
var filterItem = new AlarmFilterItemFilter(new[] { $"{_filter} (Saved filter)" });
var filter = new AlarmFilter(filterItem);
var msg = new GetActiveAlarmsMessage() { Filter = filter };
var alarmsResponse = _dms.SendMessage(msg) as ActiveAlarmsResponseMessage;
if (alarmsResponse != null)
{
return alarmsResponse.ActiveAlarms.WhereNotNull().ToList();
}
I took this code fragment from the original automation. I tested the entire automation on my DMA, but it's not working:
I'm also trying to use that same saved filter to create a subscription to AlarmEventMessage
so I can receive real-time updates when alarm changes happen. I'm doing it like this:
_subscriptionId = subscriptionId;
_subscriptionFilter = new SubscriptionFilter("AlarmEventMessage", new[] { "FoxDummyTesting" });
_connection.AddSubscription(subscriptionId, _subscriptionFilter);
_connection.Subscribe();
However, I haven’t been able to find documentation confirming whether using a saved/shared alarm filter by name like this is supported for subscriptions.
Could you please confirm if this is the correct way to subscribe using a named filter? Or is there a recommended approach or documentation you could point me to for this use case?
Thanks in advance,
Gina
is it a Shared filter you're trying to use?
have you tried adding " (shared filter)" at the end of your filtername?
That worked for me.
var filterItem = new AlarmFilterItemFilter(new[] { $"{filtername} (shared filter)" });
var filter = new AlarmFilter(filterItem);
var msg = new GetActiveAlarmsMessage() { Filter = filter };
var alarmsResponse = _dms.SendMessage(msg) as ActiveAlarmsResponseMessage;
if (alarmsResponse != null)
{
return alarmsResponse.ActiveAlarms.WhereNotNull().ToList();
}