Hi Community,
I'm looking for a way to trigger to the highest active severity level per DMA/DMS.
Scripts should be triggered by correlation rules when, there is a change:
- [RED] to critical (from normal/warning/minor/major) when a new critical alarm comes in or an existing one is unmasked
- [YELLOW] to warning/minor/major (when a new warning/minor/major alarm comes in or an existing one is unmasked and no active/unmasked critical alarm exists or after masking of all critical alarms)
- [GREEN] to normal when no active warning/minor/major/critical alarm exists / masking all alarms with warning/minor/major/critical
Actually I got this working (grouped by DMA, with 3 scripts/correlation rules) but only when "Trigger on single events. Don't maintain active tree status." is active for the YELLOW and the GREEN script.
But as a result the script is triggered by every matching event, e.g.:
- masking 10 of 10 alarms will trigger the GREEN script 10 times instead of 1
- masking 9 critical alarms and keep one warning alarm active triggers the YELLOW script 9 times.
How to avoid this and just trigger for general change in the severity of active alarms?
It might not be possible to achieve what you want directly with correlation rules, but you can trigger an automation script for every alarm update using correlation rules, and then check every time whether your DMA is in the RED, YELLOW or GREEN state.
I think the easiest way to achieve that is to make a separate view for each DMA with the elements it is hosting. Then, you can check the alarm level of the view in the automation script as follows.
public ViewStateEventMessage GetViewState(Engine engine, IDmsView view)
{
var msg = new GetViewStateMessage()
{
ViewID = view.Id,
};
var resp = engine.SendSLNetSingleResponseMessage(msg);
if (resp is GetViewStateResponse stateResponse)
return stateResponse.States.FirstOrDefault();return null;
}/// <summary>
/// The Script entry point.
/// </summary>
/// <param name="engine">Link with SLAutomation process.</param>
public void Run(Engine engine)
{
var dms = engine.GetDms();
var view = dms.GetView("YOUR_DMA_VIEW");
var viewState = GetViewState(engine, view);
if (viewState != null)
{
if (viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Critical)
{
//Red
}
else if (viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Major || viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Minor ||
viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Warning)
{
//Yellow
}
else if (viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Normal || viewState.Level == Skyline.DataMiner.Net.Messages.AlarmLevel.Masked)
{
//Green
}
}
}
As you can see, I use an SLNet message to fetch the alarm state of the view, as it is not yet available as an automation call as far as I know.
I am not an expert on this, but I did a few tests with the severity critical and it seems to work for me if I disable ‘Trigger on single events’ and I filter on the view in question (which corresponds to the DataMiner agent). I did not turn on any grouping, nor do I execute on clear or base alarm updates.
Hi Tobe,
how did your rule detect a severity change (e.g. for warning to critical)?
I tried what you have described (just a filter for the view), but it just acts on the severity on the first incoming alarm. When a second alarm with a higher sevity pops up or if I mask/unmask alarms nothing happens. Also when an alarm is no longer existing.
OK, unlike what I said above, it seems you will need ‘Execute on clear’. Furthermore, in the alarm filters, I specified both the severity (critical in my case, but it should also work with any other severity) and the view. Then, the script should trigger always whenever a new/updated alarm is the first alarm on that severity, or whenever the last alarm on a certain severity clears or changes severity.
Note that I did not test anything with masking, but I suppose you can achieve this by adding a filter on ‘Extra status’ equal to ‘not masked’.
Hi Tobe,
thanks!
This works for me.
But how should the correlation rule look like to act only in case of a general severity change?
Currently it triggers the script whenever a new alarm comes in or if I mask/unmask existing alarms even if the overall status remains the same.
It will produce a lot of load in case of an alarm strom.
My rule:
Filter: Severity equal to Wa, Mi, Ma Cr and Extra Status not equal to masked
Group by DataMiner
Execute on clear
Execute on base alarm updates
Have a nice weekend,
Felix