NetXMS Support Forum

English Support => General Support => Topic started by: curruscanis on June 25, 2015, 07:03:20 PM

Title: Changing Template - reapply
Post by: curruscanis on June 25, 2015, 07:03:20 PM
I am starting to use templates in my install to make mass changes easier.  I have a template for windows systems to apply various data collection parameters.  I have applied the template to various systems across several containers.  I have made changes to the template but have noticed that these changes are not applied to the nodes automatically without manually re-applying the template.

I see that the template configuration has a "Automatic Apply Rules", so I entered the following script:

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

I am not seeing the changed template "automaticly" applied to the existing nodes.  Am I missing something?

Also I would really like to only apply this to "Windows" agents not all agents but I am not familiar with how to script this.

Please help if you can, and thank you.


Title: Re: Changing Template - reapply
Post by: Victor Kirhenshtein on June 29, 2015, 05:42:16 PM
Hi,

you do not need auto-apply script to propagate changes on nodes where template already applied. Changes in template will be propagated on all related nodes as soon as you close data collection editor for template.

Best regards,
Victor
Title: Re: Changing Template - reapply
Post by: curruscanis on June 29, 2015, 06:47:34 PM
How long does this take, I have changed my template several times and it does not change the given DCI values on the nodes that it has been applied to.
Title: Re: Changing Template - reapply
Post by: Victor Kirhenshtein on June 29, 2015, 06:54:01 PM
Change should be instant. Another issue could be opened data collection editors for nodes - while data collection for node is open, server will not apply template changes. If this is not the case, then there is serious bug that needs additional debug.

Best regards,
Victor
Title: Re: Changing Template - reapply
Post by: joni on July 06, 2015, 01:32:30 PM
Also I got this problemon the M5 version. Have been disabled two DCI on Template, and then activate them - all node's have disabled DCI. I tried to repeat the same thing, after restarting the server, so that no server has not been is locked for editing.
Title: Re: Changing Template - reapply
Post by: Marco Incalcaterra on July 08, 2015, 01:20:47 AM
Quote from: joni on July 06, 2015, 01:32:30 PM
Also I got this problemon the M5 version. Have been disabled two DCI on Template, and then activate them - all node's have disabled DCI. I tried to repeat the same thing, after restarting the server, so that no server has not been is locked for editing.

For M5 sounds like the caching problem:

https://www.netxms.org/forum/announcements/netxms-2-0-m5-released/msg17129/#msg17129

Best regards,
Marco
Title: Re: Changing Template - reapply
Post by: joni on July 09, 2015, 09:51:57 AM

nxdbmgr get DefaultAgentCacheMode
NetXMS Database Manager Version 2.0-M5 Build 8027
2
Title: Re: Changing Template - reapply
Post by: joni on July 09, 2015, 04:30:27 PM
Disabling DCI is working, but enabling is not working from template.
Title: Re: Changing Template - reapply
Post by: Victor Kirhenshtein on July 09, 2015, 04:49:42 PM
Hi,

templates may be configured not override "disabled" flag on node DCIs. This is done to allow to disable unsupported/unwanted items on some nodes and not re-disable them after each template change. You can turn this off by setting ApplyDCIFromTemplateToDisabledDCI to 1.

Best regards,
Victor