I'm implementing custom tool to create ticket for selected alarm. Tool is impelemented as automation script. I'd like to get Severity and RootTime as script parameters, but not able to do that. I'm able to fetch Tool should fetch as much data as possible from alarm itself. I'm able to fetch attributes like alarmId and rootId using the following functions - engine.GetScriptParam("rootId").Value; engine.GetScriptParam("alarmId").Value). Also, I'm able to get custom alarm properties with GetAlarmProperty. Is there a way to get in a similar way Severity and RootTime?
The following - engine.GetScriptParam("Severity").Value - does not work.
Hi Mateusz,
I believe you are using a hyperlinks to create a ticket from a selected alarm. Please could you confirm if this is the case?
With hyperlinks you can pass information from the selected alarm to the automation script:
<HyperLink id="1">Script:Create Ticket||ALARMID=[ALARMID];ALARMTYPE=[ALARMTYPE];DMAID=[DMAID];EID=[EID];ENAME=[ENAME];OWNER=[OWNER];PID=[PID];PNAME=[PNAME];POLLINGIP=[POLLINGIP];RCA=[RCA];ROOTKEY=[ROOTKEY];ROOTTIME=[ROOTTIME];SEVERITY=[SEVERITY];STATUS=[STATUS];TIME=[TIME];USERSTATUS=[USERSTATUS];VALUE=[VALUE]||Create Ticket|NoConfirmation,CloseWhenFinished</HyperLink>
As you can see in the example above, you can pass to the automation script the root time and severity.
Thank you for prompt answers. Yes, we’re using hyperlinks. After restarting of DMA it started working.
Hello again! I have additional question. I noticed that for in case of discreet parameter measurmentsin value=[VALUE] instruction returns actual value of Param.Measurement.Discreets.Discreet.Value tag, which is expected. However, is there a way to pass parameter the actual value of value of Param.Measurement.Discreets.Discreet.Display instead?
Hi Mateusz,
As far as I know, it is not possible to pass the displayed value to the automation script (using hyperlinks). In this case an option could be retrieving the displayed value using the method GetParameterDisplay (available in the element class). Since you have the DMAID, EID and PID, you will be able to map the Element object to the element retrieved from the hyperlink.
More information in the DataMiner Help:
help.dataminer.services/dataminer/#t=DataMinerUserGuidepart_7CsharpReferenceElement_methods.htm
Hi Mateusz,
To get the RootID and Severity, you can use the following code. You only need to supply the GetAlarmDetailsMessage with the DataMinerID and AlarmID.
GetAlarmDetailsMessage message = new GetAlarmDetailsMessage(iDmaID, iAlarmID);
DMSMessage[] responseMessage = Engine.SLNet.SendMessage(message);
if (responseMessage.Length > 0)
{
AlarmEventMessage alarmEvent = (AlarmEventMessage)responseMessage[0];
int RootAlarmID = alarmEvent.RootAlarmID;
string severity = alarmEvent.Severity;
}
This approach is preferred over the usage of the GetAlarmsDetailsMessage, because it doesn’t require an extra call (SlNet in this case) to the software.