I need to retrieve the ALIAS of the child element in the service that triggered the alarm. For example, in the following image I have one service with 4 inputs, each is a child element of the service:
a correlation rule on the service triggers an automation to run, on this automation I gather the alarm information. But I can't find which child element or device the alarm came from. On the image you can see 2 parameters on Input 3 and 4, the one that triggered the alarm was Input 4 (You can see that is in yellow). I need to get the Alias or Input 4 so that I can create an IDX to gather some information from another element.
Please help, thank you!
Hi Miguel,
I believe you will need to use a SLNet call to retrieve the alias of the child elements linked to the service. Assuming that you are using this option to get information from the alarm that triggered the correlation rule, you already have information about the impacted services. With this information you can perform the following call:
GetServiceByNameMessage getServiceByNameMessage = new GetServiceByNameMessage();
getServiceByNameMessage.ServiceName = "TEST_SERVICE_01";
DMSMessage dmsMessage = engine.SendSLNetSingleResponseMessage(getServiceByNameMessage);
ServiceInfoEventMessage serviceInfoEventMessage = (ServiceInfoEventMessage)dmsMessage;
ServiceInfoParams[] childElements = serviceInfoEventMessage.ServiceParams;
for (int i = 0; i < childElements.Length; i++)
{
engine.GenerateInformation(childElements[i].Alias);
}
Hope it helps.
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.
Hi,
You can avoid the use of the SLNet call by using:
var service = engine.FindService("Service Name");
childElement = service.ServiceInfo.ServiceParams;
Then you have the same list as in the reply above