<?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[Automatic Apply Rule for template not working]]></title><description><![CDATA[<p dir="auto">I am trying to make some SNMP templates for devices, but I am having trouble getting them to apply automatically.<br />
For example, I want to log the POE power usage for switches.<br />
I can apply them manually and they work, but if I leave it for NetXMS to apply them automatically, nothing happens.<br />
Please see the attached image.<br />
For some switches, there is no 2nd PSU, could this be why it doesn't apply automatically?</p>
<p dir="auto">Secondly, for switches that don't have a second PSU, is there any way of making the 2nd set of DCIs (1435, 1436 and 1437) optional so it doesn't error?<br />
I assume I should really be using a loop somehow to find anything under the root of the PSU OID, but I have no idea how to do that yet!<br />
Thanks!</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000005554-Screenshot_2021-09-17_084817.png" alt="Screenshot 2021-09-17 084817.png" class="img-markdown  img-fluid" width="908" height="436" /></p>
]]></description><link>https://forum.netxms.org/topic/7177/automatic-apply-rule-for-template-not-working</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 16:56:33 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7177.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 17 Sep 2021 07:53:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatic Apply Rule for template not working on Thu, 23 Sep 2021 20:06:02 GMT]]></title><description><![CDATA[<p dir="auto">Thanks, it was the "\" causing the problems.<br />
Once I found the contents of <code>println $node-&gt;snmpOID;</code> for the node and use that, it applied with out problems.<br />
Using "like" will also help for other templates I am trying to make.</p>
]]></description><link>https://forum.netxms.org/post/30555</link><guid isPermaLink="true">https://forum.netxms.org/post/30555</guid><dc:creator><![CDATA[ChrisC]]></dc:creator><pubDate>Thu, 23 Sep 2021 20:06:02 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Apply Rule for template not working on Thu, 23 Sep 2021 11:49:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">\ is an escape character in NXSL string, so for actually passing \ to regex processor, you can escape it, like this: "^\\.1\\.3\\.6".</p>
<p dir="auto">In simple cases you can use like instead of regexp matching. For example, to match all OIDs starting with .1.3.6.1.2.1 you can use condition</p>
<pre><code>if (oid like ".1.3.6.1.2.1.*")
{
   /* match, dio something */
}
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/30550</link><guid isPermaLink="true">https://forum.netxms.org/post/30550</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 23 Sep 2021 11:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic Apply Rule for template not working on Fri, 17 Sep 2021 10:32:01 GMT]]></title><description><![CDATA[<p dir="auto">In context menu of that node you can select "Execute server script" and try your script there; The node that you right-clicked will be available as $node, so all the attributes will be there.<br />
You can do</p>
<pre><code>println $node-&gt;snmpOID;
</code></pre>
<p dir="auto">to see what's actually in there.</p>
<p dir="auto">Match operation ~= looks to be correct, but you could just use simple comparison with == , then you'd not need to escape with backslashes.<br />
In out-of-the-box templates there's e.g. SNMP-&gt;UPS-&gt;APC that has automatic apply rule that is checking some SNMP data.</p>
<p dir="auto">The other debugging approach is to use<br />
PollerTrace("your text");<br />
or<br />
trace(0, "your text");<br />
First one will produce debug output in nxmc when you do Poll-&gt; Configuration poll from node context menu.<br />
Second will put debug to server log (at debug level 0 in this example)</p>
]]></description><link>https://forum.netxms.org/post/30507</link><guid isPermaLink="true">https://forum.netxms.org/post/30507</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Fri, 17 Sep 2021 10:32:01 GMT</pubDate></item></channel></rss>