<?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 rules using script in Script Library]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am looking to use some filter located in the Script Library to assign nodes to a container using the automatic rules process.</p>
<p dir="auto">The following rule write in the automatic rule of a container works fine:</p>
<pre><code>sub main() {
	return $node-&gt;platformName=="windows-x64";
}
</code></pre>
<p dir="auto">Therefore if I move the code to the Script Library named TEST<br />
and I used the follonwing command in the automatic rules :</p>
<pre><code>use LibraryScript;
return TEST;
</code></pre>
<p dir="auto">It did not work.<br />
I guess it is a syntax problem, and as I am a newbie, I don't yet how to deal with such problem<br />
Any help would be helpfull</p>
<p dir="auto">Reagrds</p>
]]></description><link>https://forum.netxms.org/topic/4039/automatic-rules-using-script-in-script-library</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:43:55 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4039.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Oct 2015 06:47:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Automatic rules using script in Script Library on Wed, 14 Oct 2015 14:58:22 GMT]]></title><description><![CDATA[<p dir="auto"> :-[</p>
<p dir="auto">Thanks a lot.</p>
]]></description><link>https://forum.netxms.org/post/17976</link><guid isPermaLink="true">https://forum.netxms.org/post/17976</guid><dc:creator><![CDATA[pcamelio]]></dc:creator><pubDate>Wed, 14 Oct 2015 14:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to Automatic rules using script in Script Library on Wed, 14 Oct 2015 11:37:19 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">so you moved your code</p>
<pre><code>sub main() {
   return $node-&gt;platformName=="windows-x64";
}
</code></pre>
<p dir="auto"> into the Script Library and it "TEST", corrrct?</p>
<p dir="auto">Then, your filtering script should look like this:</p>
<pre><code>use TEST;
return ;
</code></pre>
<p dir="auto">But you shouldn't name your sub main(), as you could encouter some problems when using several scripts.</p>
<pre><code>sub OS_platformName() {
   return $node-&gt;platformName=="windows-x64";
}
</code></pre>
<pre><code>use TEST;
return OS_platformName;
</code></pre>
]]></description><link>https://forum.netxms.org/post/17974</link><guid isPermaLink="true">https://forum.netxms.org/post/17974</guid><dc:creator><![CDATA[user55116]]></dc:creator><pubDate>Wed, 14 Oct 2015 11:37:19 GMT</pubDate></item></channel></rss>