<?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[How to call a script from "instance-name" ?]]></title><description><![CDATA[<p dir="auto">Hello everyone, do you know how can I call a script from a dci description?<br />
for example, this is the description of a dci: TrafficIN %{script:getIfNameByName({instance-name})}<br />
this is my script:<br />
scriptName:getIfNameByName<br />
sub getIfName(netString)<br />
{<br />
     if (length(netString) &gt; 0)<br />
     array a;<br />
     a [length(netString)];<br />
     a = SplitString(netString, " ");<br />
     return (a [<br />
                       (a-&gt;size)-1<br />
                  ]<br />
              );<br />
}<br />
return getIfName($1);<br />
how can I call that script and send "instance-name" as parameter?</p>
]]></description><link>https://forum.netxms.org/topic/5131/how-to-call-a-script-from-instance-name</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:47:13 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5131.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 05 Jul 2017 21:45:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to call a script from "instance-name" ? on Tue, 25 Jul 2017 16:56:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">{instance-name} is a placeholder which is replaced only during instance discovery. You can set it's value by returning third element from instance filter script, like this:</p>
<p dir="auto">return %(true, "this will became instance", "this will became instance name");</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/22772</link><guid isPermaLink="true">https://forum.netxms.org/post/22772</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 25 Jul 2017 16:56:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to call a script from "instance-name" ? on Wed, 19 Jul 2017 00:49:27 GMT]]></title><description><![CDATA[<p dir="auto">Sounds like {instance-name} is not being interpreted prior to calling the script.<br />
Maybe add some trace commands to your script, e.g. something like this:</p>
<pre><code>trace(0,"Instance Name: ".$1);
</code></pre>
<p dir="auto">Then check your server logs and see what is being returned: Nothing? Literally "{instance-name}"? Something else?</p>
]]></description><link>https://forum.netxms.org/post/22718</link><guid isPermaLink="true">https://forum.netxms.org/post/22718</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Wed, 19 Jul 2017 00:49:27 GMT</pubDate></item><item><title><![CDATA[Reply to How to call a script from "instance-name" ? on Tue, 18 Jul 2017 20:30:23 GMT]]></title><description><![CDATA[<p dir="auto">Yes your point is valid but I know that is possible, if I change the script and return any value, It appears on dci description.<br />
I would like to know how to do it.</p>
]]></description><link>https://forum.netxms.org/post/22713</link><guid isPermaLink="true">https://forum.netxms.org/post/22713</guid><dc:creator><![CDATA[lmontano]]></dc:creator><pubDate>Tue, 18 Jul 2017 20:30:23 GMT</pubDate></item><item><title><![CDATA[Reply to How to call a script from "instance-name" ? on Wed, 05 Jul 2017 22:01:38 GMT]]></title><description><![CDATA[<p dir="auto">It looks to me as if what you are trying to do should probably be done in the instance discovery filter script, rather than via attempting to call a script within the DCI description?</p>
]]></description><link>https://forum.netxms.org/post/22583</link><guid isPermaLink="true">https://forum.netxms.org/post/22583</guid><dc:creator><![CDATA[Tursiops]]></dc:creator><pubDate>Wed, 05 Jul 2017 22:01:38 GMT</pubDate></item></channel></rss>