<?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[Template autoapply rules]]></title><description><![CDATA[<p dir="auto">Dear community.</p>
<p dir="auto">I'm trying to apply a template for ICMP monitoring to devices that are under specific containers and I'm having issues with the Automatic apply rule configuration</p>
<p dir="auto">for (p : $node-&gt;parents) {<br />
    if (p-&gt;type == 5 &amp;&amp; (p-&gt;id==109031 || p-&gt;id==42342))<br />
        return true;<br />
}</p>
<p dir="auto">What would be the best way to apply a template if the device is under specific containers?</p>
<p dir="auto">Has someone used the new function isDirectParent(object)?</p>
<p dir="auto">Thank you</p>
<p dir="auto"> </p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005534-Properties_for_ICMP_2021-08-15_12-36-33.png" alt="Properties for ICMP 2021-08-15 12-36-33.png" class="img-markdown  img-fluid" width="652" height="484" /></p>
]]></description><link>https://forum.netxms.org/topic/7132/template-autoapply-rules</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:51:06 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7132.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Aug 2021 18:37:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Template autoapply rules on Tue, 17 Aug 2021 17:37:04 GMT]]></title><description><![CDATA[<p dir="auto">Glad to hear it is working, mark topic [SOLVED]!</p>
]]></description><link>https://forum.netxms.org/post/30358</link><guid isPermaLink="true">https://forum.netxms.org/post/30358</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Tue, 17 Aug 2021 17:37:04 GMT</pubDate></item><item><title><![CDATA[Reply to Template autoapply rules on Tue, 17 Aug 2021 17:31:30 GMT]]></title><description><![CDATA[<p dir="auto">The code that worked is:</p>
<p dir="auto">Thanks Filipp/Iweidig</p>
<p dir="auto">parents = GetNodeParents($node);<br />
for (p : parents) {<br />
    if (p-&gt;type == 5 &amp;&amp; (p-&gt;id==109031 || p-&gt;id==55839 ||p-&gt;id==177))<br />
        {<br />
        <br />
        return true;<br />
    }<br />
}<br />
return false;</p>
]]></description><link>https://forum.netxms.org/post/30357</link><guid isPermaLink="true">https://forum.netxms.org/post/30357</guid><dc:creator><![CDATA[mmarin11]]></dc:creator><pubDate>Tue, 17 Aug 2021 17:31:30 GMT</pubDate></item><item><title><![CDATA[Reply to Template autoapply rules on Mon, 16 Aug 2021 11:56:31 GMT]]></title><description><![CDATA[<p dir="auto">In addition to what Filipp stated the screenshot attached does not actually match the code in the message.  You simply have <strong>return;</strong> and not <strong>return true;</strong>.  I would probably not include the <strong>return false;</strong> in an else clause either, but simply as the last statement so that anything falling through gets tagged like this.</p>
]]></description><link>https://forum.netxms.org/post/30351</link><guid isPermaLink="true">https://forum.netxms.org/post/30351</guid><dc:creator><![CDATA[lweidig]]></dc:creator><pubDate>Mon, 16 Aug 2021 11:56:31 GMT</pubDate></item><item><title><![CDATA[Reply to Template autoapply rules on Mon, 16 Aug 2021 11:06:16 GMT]]></title><description><![CDATA[<p dir="auto">chances are that adding</p>
<pre><code>else
{
  return false;
}
</code></pre>
<p dir="auto">will fix the issue.</p>
<p dir="auto">In overall you can use<br />
trace(0, "your debug");<br />
PollerTrace("your debug");<br />
to debug what's happeing. First one adds to server log, the latter - to the output of poll messages when you do e.g. Configuration poll from node's context menu.</p>
]]></description><link>https://forum.netxms.org/post/30348</link><guid isPermaLink="true">https://forum.netxms.org/post/30348</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Mon, 16 Aug 2021 11:06:16 GMT</pubDate></item></channel></rss>