<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Auto-bind script for new node]]></title><description><![CDATA[<p dir="auto">Hi again and sory for my following question, im new to NetXMS and i am having some headaches trying to do simple tasks.<br />
Here it goes</p>
<p dir="auto">I need to make an auto-bind script template to bind new nodes to a specific container</p>
<p dir="auto">Something like this:</p>
<p dir="auto">return $node-&gt;isNew bind to container "container";</p>
<p dir="auto">How can i achieve this simple script? i cant find the correct syntax to make it work</p>
<p dir="auto">Thanks!</p>
]]></description><link>https://forum.netxms.org/topic/6538/auto-bind-script-for-new-node</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 10:23:50 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/6538.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 18 May 2020 23:59:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Auto-bind script for new node on Thu, 21 May 2020 17:10:27 GMT]]></title><description><![CDATA[<p dir="auto">Thanks!!!!</p>
<p dir="auto">It works very well!</p>
<p dir="auto">But the problem that i need to solve is that i need to bind the nodes matched by the template to "infrastructure Services\new nodes" container so i can then organize them in infrastructure.</p>
]]></description><link>https://forum.netxms.org/post/27919</link><guid isPermaLink="true">https://forum.netxms.org/post/27919</guid><dc:creator><![CDATA[sNsReal]]></dc:creator><pubDate>Thu, 21 May 2020 17:10:27 GMT</pubDate></item><item><title><![CDATA[Reply to Auto-bind script for new node on Thu, 21 May 2020 00:28:50 GMT]]></title><description><![CDATA[<p dir="auto">Hey sNsReal,</p>
<p dir="auto">You could probably use the newly available creationTime attribute on the NetObj class (added sometime in v3) which is epoch of when the object was created.</p>
<p dir="auto">So on the container that you want nodes to autobind to, you could enable "Automatically bind nodes selected by filter to this container", and disable the unbind option.<br />
And your filtering script would be something like this:</p>
<pre><code>HOURS_IN_SECONDS = 3600;
if($node-&gt;creationTime != 0 &amp;&amp; (time() - $node-&gt;creationTime) &lt; HOURS_IN_SECONDS) return true;
</code></pre>
<p dir="auto">This will bind nodes that have been created within the last hour.  So long as the node performs a config poll within that time, then it should bind.<br />
If it does not return true, then it will implicitly return null, and null means that it won't bind or unbind the node being processed.<br />
If the object was created prior to the CreationTime being added to NetXMS, then CreationTime will be 0.</p>
]]></description><link>https://forum.netxms.org/post/27913</link><guid isPermaLink="true">https://forum.netxms.org/post/27913</guid><dc:creator><![CDATA[johnnyva]]></dc:creator><pubDate>Thu, 21 May 2020 00:28:50 GMT</pubDate></item></channel></rss>