Hi, I've read over nearly all the correlation rule questions but I'm still having trouble getting my rule to work. I need to gather alarms into 1 bucket. The bucket will contain up to 10 clearable alarms with 0 service impact under defined views. When the count is over 10 I want to run a script which get's the bucket of alarm IDs and then sends a message to DataMiner to clear them.
I'm hoping once my buck it working correctly I can use the GetAlarmIds method to return a list of IDs I can then run the SetAlarmStateMessage on. Apologies for the script it might not make sense as I've been testing with it all morning.
I'd rather not use GetActiveAlarmsMessage as it gets all 5000+ alarms on the system each time, I'd rather get the bucket of specific alarm IDs I need and then I can just clear them individually.
I can see from the client test tool that I have 1 bucket but it always is empty so that's what I'm looking into at the moment.
Probably a stupid question but what exactly is a Tree in the bucket?
Thanks!
It seems your GetAlarmIds method is close to what you want. The Buckets field in the GetCorrelationStatusResponse message represents alarms grouped according to what you specified under 'Alarm Grouping' in your correlation rule. Since you did not specify anything, you should only have one bucket.
Each bucket should then a number of alarms in the fields 'TrackedTrees', 'TrackedTreeIDs' and 'Trees' (some fields might be missing depending on your DataMiner version). All three fields should contains the same alarms, but in different formats. (Technically, the three fields refer to the 'alarm tree', i.e. the alarm together with all of its updates, hence the name of the fields.) I am not sure why the bucket is empty in your case. Are you sure you have any active alarms that match your filters? Did you specify the right correlation rule ID?
Once you figure out why your buckets are empty, you can continue as follows. If your DataMiner version is recent enough to have it, the field TrackedTreeIDs is the easiest to work with. It contains a list of IDs of the alarms (actually alarm trees) in your rule. You can just return that list from your method, and send a SetAlarmStateMessage for each member of that list as in the example of A B M Sidddique above
SetAlarmStateMessage setAlarmStateMessage = new SetAlarmStateMessage(treeID, Skyline.DataMiner.Net.Enums.AlarmUserStatus.Clear, clearingMessage);
If you don't have the field 'TrackedTreeIDs', you can use 'Trees' instead which contains the alarms with their history. For each item in Trees you can access History[0] and extract the fields DataMinerId, HostingAgentId, ElementId and AlarmId and use those values to set the respective fields in a SetAlarmStateMessage and send it.
Hi Ross !
I am also working on a similar use case as you stated . And the Dojo community was able to help me with a sample code snippets , you could have a look at it if you like ( I know it doesn’t answer your question , just sharing if it helps in any way)
https://community.dataminer.services/question/method-of-clearing-alarms-from-the-alarm-console-using-an-automation-script/answer/130347/
https://github.com/SkylineCommunications/SLC-AS-ClearNoticeAlarmsOlderThanAWeek/blob/master/ClearNoticeAlarmsOlderThanAWeek_1/ClearNoticeAlarmsOlderThanAWeek_1.cs