NetXMS Support Forum

English Support => General Support => Topic started by: anw on August 09, 2016, 06:42:47 PM

Title: Scheduled Tasks - Execute on Template Group
Post by: anw on August 09, 2016, 06:42:47 PM
Hey
im trying to execute a simple script every 10 minutes on my Switches .. but i cant seem to apply it to a group.. it never works , but if i choose one specific switch, it works fine?
What am i doing wrong here? or any suggestion how this can be done?
i tried ExecuteGroup  Templates.. specific template.. entere network... infrastructure services... nothing seems to work?

i dont want to add scripts for all 200 switches ? and have to change all the time if i add a switch..?

thanks
Title: Re: Scheduled Tasks - Execute on Template Group
Post by: tomaskir on August 10, 2016, 01:06:15 PM
You need to retrieve the nodes from the container/template when running a script over it.

Example:

children = GetObjectChildren($object);

foreach (child : children) {
  // watch out, a child can be a node, or another container, or rack, etc.
  println(child->name);
}

Title: Re: Scheduled Tasks - Execute on Template Group
Post by: anw on August 10, 2016, 05:01:09 PM
ok thanks!  i got it working now  - but not on templates directly - but on containers which i created under infrastructure service instead. this works perfect.

Would be nice to get it working on template folders directly - do you know how?

thanks and best regards
Title: Re: Scheduled Tasks - Execute on Template Group
Post by: Victor Kirhenshtein on August 16, 2016, 03:44:08 PM
It will need changes in server code - currently template objects are not exposed to NXSL.

Best regards,
Victor