What is the preferred way to put a comment in an alarm without acknowledging it from an Automation Script?
I remember I saw something similar with Engine.SLNet.SendMessage(SetAlarmStateMessage)
Can't find any info about this in the docs.
Hi Peter,
The reason it didnt work with the alarmTreeID overload is because the Info property was not set. This still necessary for legacy reasons.
This should do the trick:
var comment = "Hello world";
engine.GetUserConnection().HandleSingleResponseMessage(new SetAlarmStateMessage(new AlarmTreeID(1, 2, 3), AlarmUserStatus.Comment, comment)
{
Info = new SA(new string[] { "-1", comment }),
});
After a lot of trial and error I found a working solution
SetAlarmStateMessage sam = new SetAlarmStateMessage();
sam.AlarmId = rootAlarmID;
sam.DataMinerID = dmaID;
sam.State = 5; // 2= acknowledge alarm 5= comment
sam.Info = new SA(new string[] { "-1", comment });
engine.SendSLNetMessage(sam);
what Didn't seem to work:
A:
SetAlarmStateMessage sam = new SetAlarmStateMessage(tree, AlarmUserStatus.Comment, comment);
comment);
engine.SendSLNetMessage(sam);
B:
SetAlarmStateMessage sam = new SetAlarmStateMessage(dmaID, alarmID, 5, comment);
engine.SendSLNetMessage(sam);
Is there a reason that the use of alarmTreeID (with rootAlarmID) doesn't work?
tested on DataMiner (10.5.0.0-15683-CU2) and use of Skyline.DataMiner.Dev.Automation 10.5.0.2