I'm getting warnings when I validate my old automations in DM version 10.5 about the arguments to SetAlarmStateMessage.
If I read the warnings correctly they indicate that I should rather use AlarmTreeID instead of the combination DataMinerID and AlarmID when I call SetAlarmStateMessage
SetAlarmStateMessage(AlarmTreeID, AlarmUserStatus, String)
vs
SetAlarmStateMessage(DataMinerID, AlarmID, AlarmUserStatus, String)
My question is how do I get the AlarmTreeID for an alarm?
The AlarmUserStatus is an enum that belongs to
Skyline.DataMiner.Net.Enums
In your case the code snippet will likely look similar to:
using Skyline.DataMiner.Net.Enums;
var request = new SetAlarmStateMessage(
alarm.TreeID,
AlarmUserStatus.Clear,
"Cleared by automation");engine.SendSLNetMessage(request);
Ref:
- Correlation Rule - DataMiner Dojo
- Alarm Type Update via Automation Script - DataMiner Dojo
- Namespace Skyline.DataMiner.Net | DataMiner Docs (holds more details on AlarmTreeID, not the enum)
Hi Jan-Terje
I believe the following will be a good read: Preparing scripts and connectors for Swarming | DataMiner Docs
It nicely differentiates between the different definitions, this includes AlarmTreeID.
I'm guessing the script might have gotten triggered via a correlation rule, you'll notice the AlarmTreeID field got added here as well (see bottom): How do I parse Correlation Alarm Info data? | DataMiner Docs
=> I'm guessing this is what you need?
So in short, the AlarmTreeID is formatted like "<DMA ID>/<ElementID>/<RootAlarmID>"
I hope that helps!
Thanks, I understand the AlarmTreeID now. The next hurdle is the AlarmUserStatus. Where can I find more documentation for the SetAlarmStateMessage, and AlarmUserStatus (which namespace does it belong to)?
What I'm trying to accomplish is to clear an alarm that is in a clearable state.