NetXMS Support Forum

English Support => General Support => Topic started by: gkaudewitz on August 09, 2016, 01:41:15 PM

Title: Accessing Custom Attributes in condotion-Objects
Post by: gkaudewitz on August 09, 2016, 01:41:15 PM
Is there a possibility accessing custom attributes within the script of a condition Attribute?

Best regards

Georg
Title: Re: Accessing Custom Attributes in condotion-Objects
Post by: tomaskir on August 09, 2016, 02:48:39 PM
If you have a $node object available (which should be in EPP Condition scripts), you have multiple options:

Get a single known attribute:
https://wiki.netxms.org/wiki/NXSL:GetCustomAttribute

Get all custom attributes of a node:

attributes = $node->customAttributes;
foreach(attrib : attributes->keys) {
  // name
  println(attrib);

  // value
  println(attributes[attrib])
}