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.

Hello both, Miguel and Jorge, you are both correct about getting the service parameters. But the issue is, how do I know which child element was the one that it triggered from. Meaning that if the parameter alarmed came from input 4, how can I tell in the code, that it came from input 4 and not from any other input?
In your code do you have the alarm information?
If so in there you have the Agent/Element ID from where it was triggered, then you can compare that with the ones in the childElements array from the service info.
If not, could you please clarify what information you have in the script and how it was triggered.

Hey Jorge, I am able to get the element ID by doing what you suggest. But I can't compare it to the childElement because all of the child elements have the same element ID. In other words, all child elements belong to 1 element, but the parameters inside these child elements are different. For example, childElement-1 has all that belongs to input 1 in the unit, childElement-2 has all that belongs to input 2, etc. So what I need, is to know which input is being triggered on, so that I can run a scrip that will use the number of the input and run some actions. At the moment, I have it where it is reading the parameter description of the alarm that triggered, and taking the input from there. But as this solution grows more, I can't maintain it this way, because there are parameters that don't contain the input number in the description. So it will be up to the alarmed childElement to determine which input is it. At least that's what I'm imaging.
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