NetXMS Support Forum

English Support => General Support => Topic started by: twparker on April 23, 2025, 09:53:19 PM

Title: Object Container Name in Alarm Message?
Post by: twparker on April 23, 2025, 09:53:19 PM
Hello all,

I would like to add the container name of a node to an alarm message, but I am not quite sure how to go about it. Any suggestions?
Title: Re: Object Container Name in Alarm Message?
Post by: twparker on April 23, 2025, 11:34:19 PM
Thanks, Amay. I tried using the Script Library method, but the message is not displaying anything before the node macro.

%[GetContainerName]%n is unresponsive - %a

UVC G3Ext 2 is unresponsive - 10.1.110.166
Title: Re: Object Container Name in Alarm Message?
Post by: Victor Kirhenshtein on April 24, 2025, 09:08:29 AM
For version 5.x script GetContainerName could look like this:

for(p : $object.parents)
  if (classof(p) == "Container")
      return p.name;
return "";
Title: Re: Object Container Name in Alarm Message?
Post by: twparker on April 24, 2025, 06:15:25 PM
Thanks Victor - that did it!