NetXMS Support Forum

English Support => General Support => Topic started by: hkusulja on May 07, 2014, 08:34:43 PM

Title: Help with $node->platform in Automatic Apply Rules (template) script ?
Post by: hkusulja on May 07, 2014, 08:34:43 PM
Hi,
I do have some Templates with DCIs that I wish to monitor on some nodes that has NetXMS agent installed.
I have simple script that will automatically apply templates to nodes who has NetXMS Agent installed, my current script inside Template - Automatic Apply Rules is:

sub main() {
return $node->isAgent;
}

This script works and solves the problem.

However, I can not find proper documentation for $node object and its attributes / methods.
I need to write different script for my different template which will check if $node - platform name, contains string "windows" then to automatically apply different template.

Please help me with simple if expression, contains (or RegExp) and how to get platform name from $node object ?

Thank you
Title: Re: Help with $node->platform in Automatic Apply Rules (template) script ?
Post by: Victor Kirhenshtein on May 08, 2014, 04:52:55 PM
Description of node class is here: http://wiki.netxms.org/wiki/NXSL:Node (http://wiki.netxms.org/wiki/NXSL:Node) and all scripting reference information is here: http://wiki.netxms.org/wiki/Scripting_Guide (http://wiki.netxms.org/wiki/Scripting_Guide)

Best regards,
Victor