Help with $node->platform in Automatic Apply Rules (template) script ?

Started by hkusulja, May 07, 2014, 08:34:43 PM

Previous topic - Next topic

hkusulja

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

Victor Kirhenshtein