Hello,
I need to automatically clear (and in some cases mask) particular alarm after an action is taken using tool created as automation script (i.e. Hyperlink). For alarm masking I know that there is WebService method MaskAlarm, but can't find anything with regards to alarm clearing. Is it even possible to clear/mask alarm using any Engine methods?
Regards,
Mateusz
Hi Mateusz,
As far as I know there is no Engine method that is able to mask a specific alarm. As Jarno indicated, you could mask an element (that will also mask the alarm).
However, there is a SLNet call that you could use to mask an alarm. Please find below an example (tested using DMA version 10.1.3.0):
using System;
using Skyline.DataMiner.Automation;
using Skyline.DataMiner.Net;
using Skyline.DataMiner.Net.DataMinerObjectReferences;
using Skyline.DataMiner.Net.Masking;
using Skyline.DataMiner.Net.Messages;public class Script
{
public void Run(Engine engine)
{
// From Hyperlink
ScriptParam spDmaId = engine.GetScriptParam("DMAID");
ScriptParam spAlarmId = engine.GetScriptParam("ALARMID");
ScriptParam spRootKey = engine.GetScriptParam("ROOTKEY");// Convert to integer
int iDmaId = Convert.ToInt32(spDmaId.Value);
int iAlarmId = Convert.ToInt32(spAlarmId.Value);
int iRootKey = Convert.ToInt32(spRootKey.Value);// Define a RefTreeHelper object
DMAObjectRefTreeHelper dMAObjectRefTreeHelper = new DMAObjectRefTreeHelper();// Setup the RefTreeHelper object
dMAObjectRefTreeHelper.SetupHelper(engine.SendSLNetSingleResponseMessage);dMAObjectRefTreeHelper.ChangeMaskInfo(
new DMAObjectRefTree(new Skyline.DataMiner.Net.Messages.SLDataGateway.AlarmID(iDmaId, iAlarmId, iRootKey)),
//new MaskInfo(MaskType.UntilTimeElapsedOrUnmask, 60 /*Number of seconds*/, "Reason for masking"),
//new MaskInfo(MaskType.UntilClearanceOrUnmask,"Reason for masking"),
new MaskInfo(false), // Unmask the alarm
new CPECrawlerConfiguration()
);
}
}
Disclaimer:
Note that this is an internal call and we do not recommend using this, as it is not officially supported and we cannot guarantee that it will still work in the future. As a rule, you should avoid using SLNet calls, as these are subject to change without notice. We recommend to instead always use the correct UI or automation options provided in DataMiner Automation or through our web API.