NetXMS Support Forum

English Support => General Support => Topic started by: Storm-Donovan on February 28, 2022, 03:51:53 PM

Title: Auto-Apply Template Not Working after Upgrade
Post by: Storm-Donovan on February 28, 2022, 03:51:53 PM
I just noticed that my Auto-Apply scripts are non-functional.  All of them.  Did something change in v4 about the way these are run?  Here's a basic script I have on a template that we apply to all devices:

if (classof($object) != "Node")
return false;
return true;


I just added 6 nodes and none of them came up with this template. 
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: Victor Kirhenshtein on March 02, 2022, 09:04:22 AM
Hi,

what exact server version you are using? There was a bug in auto-apply functionality, but it should be fixed in latest patch release.

Best regards,
Victor
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: Storm-Donovan on March 02, 2022, 02:44:35 PM
This is what's installed:

netxms-agent/bullseye,now 4.0.2157-1 amd64 [installed,automatic]
netxms-base-dbg/bullseye,now 4.0.2157-1 amd64 [installed,automatic]
netxms-base/bullseye,now 4.0.2157-1 amd64 [installed,automatic]
netxms-dbdrv-mariadb-dbg/bullseye,now 4.0.2157-1 amd64 [installed]
netxms-dbdrv-mariadb/bullseye,now 4.0.2157-1 amd64 [installed,automatic]
netxms-dbdrv-sqlite3/bullseye,now 4.0.2157-1 amd64 [installed,automatic]
netxms-server-dbg/bullseye,now 4.0.2157-1 amd64 [installed]
netxms-server/bullseye,now 4.0.2157-1 amd64 [installed]

If I apt-update, I have no new packages to be installed.
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: Filipp Sudanov on March 02, 2022, 05:56:39 PM
This looks to be the most recent version.

What's the value of Objects.AutobindPollingInterval in Configuration -> Server configuration?

Note that now there's poll on templates themselves, what happens if you right-click a template and select Poll -> Automatic bind?

Try adding
trace(0, "some text");
to your auto-bind script. When you do automatic bind poll, does this "some text" appear in server log?
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: Storm-Donovan on March 02, 2022, 08:31:56 PM
Hi Filip,

I just checked the devices I added on Monday and the templates have been applied.  I was just used to the templates being applied automatically when a device was added.  The Objects.AutobindPollingInterval is 3600 (default) so likely the templates were applied within an hour of adding the devices.

Thanks for the help!
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: Filipp Sudanov on March 03, 2022, 01:44:17 PM
In 4.0 auto-apply was reworked so that it happens from template/container side. But the case when a new node is added was kinda forgotten. Will discuss that internally with developers.
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: mjk on April 12, 2022, 05:53:54 PM
I had to alter the server config for trusted nodes back to 1

It seemed to turn off.

Doing this and server restart and they are working again!
Title: Re: Auto-Apply Template Not Working after Upgrade
Post by: hoeth on May 10, 2022, 06:34:52 PM
Quote from: Filipp Sudanov on March 03, 2022, 01:44:17 PM
In 4.0 auto-apply was reworked so that it happens from template/container side. But the case when a new node is added was kinda forgotten. Will discuss that internally with developers.

Thanks, we would greatly appreciate this! We are adding nodes every day, and being able to see values straight away is helpful.