Hello Team
On dataminer for a specific element, I have a setup where an alarm triggers a correlation rule based on defined filters, which in turn executes an Automation script to send emails based on some business logic.
My requirement is to suppress that specific alarm from appearing in the Alarm Console for 24 hours after it is first handled. If the same alarm condition still persists after 24 hours, it should trigger the workflow again (i.e., generate a new email) and then be suppressed again for another 24 hours.
However, I’m facing the following challenges:
- I cannot acknowledge the alarm, as it is polling-based and reappears on every poll cycle.
- I cannot apply parameter maintenance, since the alarm is on a table column (row-level).
Given these constraints, what would be the recommended approach to suppress or “mask” this specific alarm for a fixed duration (24 hours) while still allowing it to re-trigger the workflow after that period?
I am unable to find an option to mask an alarm via automation script or via correlation rule.
Hi Ramesh,
I probably need a bit more detail on why masking the alarm or parameter for 24hrs would not work. You mention 'polling-based' and table column parameter, but what does that mean exactly? Does one polling cycle create a new row each time in your table? In case you need to mask, do you want to mask all rows in that table? or a subset?
Hi Ramesh,
For masking parameters in automation scripts, I'm typically using this class (simplified working version):
public static class Masking
{
private static DMAObjectRefTreeHelper _helper;
public static void InitMasking(Engine engine){
_helper= new DMAObjectRefTreeHelper();
_helper.SetupHelper(engine.SendSLNetSingleResponseMessage);
}
public static void SetMaskedStateForParameter(bool mask, int dmaID, int elementID, int parameterID, int seconds)
{
_helper.ChangeMaskInfo(
new DMAObjectRefTree(new ParamID(dmaID, elementID, parameterID)),
new MaskInfo()
{
DoMask = mask,
MaskType = MaskType.UntilTimeElapsedOrUnmask,
Reason = "masking test",
Time = seconds
},
new CPECrawlerConfiguration());
}
}
From the script I then call
Masking.InitMasking(engine);
Masking.SetMaskedStateForParameter(true,_dmaID, _elementID, _parameterID, _timeInSec);
I have these usings in my script btw
using Skyline.DataMiner.Automation;
using System;
using Skyline.DataMiner.Net.DataMinerObjectReferences;
using Skyline.DataMiner.Net.Apps.Sections.SectionDefinitions;
using Skyline.DataMiner.Net;
using Skyline.DataMiner.Net.Masking;
using Skyline.DataMiner.Net.Messages;
Hope this helps you moving forward.
Thanks Pieter
//DateTime maskUntil = DateTime.UtcNow.AddSeconds(300);
SetAlarmStateMessage msg = new SetAlarmStateMessage
{
AlarmId = alarmdata.AlarmID,
DataMinerID = alarmdata.DmaID,
ElementID = alarmdata.ElementID,
State = 8, // Mask
};
msg.Info = new SA(new string[]
{
"300", // 5min
});
engine.SendSLNetMessage(msg);
On previous code I was passing date time instead of seconds. This piece of code worked.
ok, wonderful. This means your problem has been resolved?
Hi Pieter
DateTime maskUntil = DateTime.UtcNow.AddMinutes(5);
SetAlarmStateMessage msg = new SetAlarmStateMessage
{
AlarmId = alarmdata.AlarmID,
DataMinerID = alarmdata.DmaID,
ElementID = alarmdata.ElementID,
State = 8, // Mask
};
msg.Info = new SA(new string[]
{
maskUntil.ToString("yyyy-MM-dd HH:mm:ss"),
});
engine.SendSLNetMessage(msg);
I am able to mask it. But I want to mask it via automation script only for a time period (Ex:5min) Then it should auto unmask.