Hi, how do we automate the action of uploading an alarm and trend template .xml files into DataMiner via automation scripts? We need to repeat this process over and over again for about 10 protocols in a test procedure and it would greatly help to be able to automate this action.
Hi Bing,
You can use this snippet to upload an alarm template.
public static void InstallAlarmTemplate(string protocolName, string protocolVersion, string templateName, string protocolFileUri)
{
// install alarm template in one go
CreateProtocolFileMessage create_template = new CreateProtocolFileMessage(1 /*=IAF_TEMPLATE*/, File.ReadAllText(protocolFileUri))
{
Sa = new SA(new string[] { protocolName, protocolVersion, templateName }),
iInfo = 0
};
Engine.SLNet.SendMessage(create_template);
}
note: 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.
Hi, if the first parameter is 0 then it’s a protocol, to upload trend templates another message is used.
Hi Debeuf, thanks for the code snippet. Regarding the first parameter to CreateProtocolFileMessage() is Alarm template represented by ‘1’ and Trend template represented by ‘0’?