Hi Community,
I would like to retrieve in a script based on view id/name or service id/name the highest severity and the number of alarms according to this highest severity (For 3 critical alarms for view A, and 2 major alarm for view B).
Do you have a script example/template for this?
Thanks
Hello Yvan,
Maybe you can try the following approach:
IDms idms = engine.GetDms();
// Gets the specified view by the id
var view = idms.GetView(viewId);
// Find the highest alarm severity amongst the elements of that view
var highestAlarmLevel = view.Elements.Max(e => e.GetAlarmLevel());
// Get the number of alarms with the highest severity
int countOfHighestAlarms = elements.Count(e => e.GetAlarmLevel() == highestAlarmLevel);
You need to use Skyline.DataMiner.Core.DataMinerSystem.Automation
Hope it helps!
Also a nice way for the View case! 😉