<?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[AutoAdd node if last value is X]]></title><description><![CDATA[<p dir="auto">Is it possible to autoadd a node if i have a Generic template gathering a value i want to decide where the node should be put?</p>
<p dir="auto">Ex i have template that check for program version "Templates-&gt;Generic-&gt;AppVersion"</p>
<p dir="auto">If AppVersion &gt;=1.0 add to node to "Templates-&gt;Generiv_v1"<br />
If AppVersion &gt;=2.0 add to node to "Templates-&gt;Generiv_v2"</p>
]]></description><link>https://forum.netxms.org/topic/2783/autoadd-node-if-last-value-is-x</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:55:42 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2783.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 11 Dec 2013 12:38:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to AutoAdd node if last value is X on Thu, 12 Dec 2013 14:38:19 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for the help.</p>
<p dir="auto">I ended up with this AutomaticApplyRules that worked:</p>
<pre><code>sub main() {
   $ver = GetDCIValue($node, FindDCIByDescription($node, "AppVersionDescription"));
   return ($ver != NULL &amp;&amp;
           $node-&gt;name ~= "node-name-regexp" &amp;&amp;
           real($ver) &gt; 2);
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/12149</link><guid isPermaLink="true">https://forum.netxms.org/post/12149</guid><dc:creator><![CDATA[Borgso]]></dc:creator><pubDate>Thu, 12 Dec 2013 14:38:19 GMT</pubDate></item><item><title><![CDATA[Reply to AutoAdd node if last value is X on Wed, 11 Dec 2013 20:27:52 GMT]]></title><description><![CDATA[<p dir="auto">It is possible to check DCI values in template autoapply scripts.</p>
<p dir="auto">In the generic template, create a DCI that collects the application version.<br />
In the autoapply script of the version-specific template use something like this. (Not tested, may contain errors)</p>
<pre><code>sub main() {
   ver = GetDCIValue($node, FindDCIByName($node, "AppVersion(theApp)"));
   // nxsl finally uses short-circuit evaluation :-)
   return (ver != NULL &amp;&amp; $node-&gt;name ~= "node-name-regexp" &amp;&amp; real(ver) &gt; 1.2 &amp;&amp; real(ver) &lt; 2.0);
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/12134</link><guid isPermaLink="true">https://forum.netxms.org/post/12134</guid><dc:creator><![CDATA[KjellO]]></dc:creator><pubDate>Wed, 11 Dec 2013 20:27:52 GMT</pubDate></item></channel></rss>