<?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[NXSL script help]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">when I add a filtering script to the event processing policy, where i can found the output of the print/println command?<br />
If i add a print or a println command to the filter script, when the event occuor i can't find the output in the remote console server or in the server console or in other way.</p>
<p dir="auto">Another questions...in the filtering script of event processing policy, can i put directly the code?Or, have I to add the declaration of the main (sub main(){etc )</p>
<p dir="auto">I have to create a filter script that send the alarm's mail for an interface down for only specific interface...<br />
I tried to insert in the event processing police as source the specific interface, but did'nt work; so i use as source the switch and i wanna to add a filter script that select for which interface the alarm's mail have to start. Any suggestion?</p>
]]></description><link>https://forum.netxms.org/topic/1957/nxsl-script-help</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:19:36 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/1957.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 01 Oct 2012 11:18:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to NXSL script help on Mon, 01 Oct 2012 15:41:14 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tivanni" aria-label="Profile: tivanni">@<bdi>tivanni</bdi></a> said in <a href="/post/8628">NXSL script help</a>:</p>
<blockquote>
<p dir="auto">when I add a filtering script to the event processing policy, where i can found the output of the print/println command?<br />
If i add a print or a println command to the filter script, when the event occuor i can't find the output in the remote console server or in the server console or in other way.</p>
</blockquote>
<p dir="auto">You should use trace() function to write messages to server's log.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tivanni" aria-label="Profile: tivanni">@<bdi>tivanni</bdi></a> said in <a href="/post/8628">NXSL script help</a>:</p>
<blockquote>
<p dir="auto">Another questions...in the filtering script of event processing policy, can i put directly the code?Or, have I to add the declaration of the main (sub main(){etc )</p>
</blockquote>
<p dir="auto">Yes, you can write code directly. Defining main() is not necessary. Also, the following code is also valid:</p>
<pre><code>trace(0, "main() starts here");

sub someFunction()
{
}

trace(0, "main() continues here");
</code></pre>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/tivanni" aria-label="Profile: tivanni">@<bdi>tivanni</bdi></a> said in <a href="/post/8628">NXSL script help</a>:</p>
<blockquote>
<p dir="auto">I have to create a filter script that send the alarm's mail for an interface down for only specific interface...<br />
I tried to insert in the event processing police as source the specific interface, but did'nt work; so i use as source the switch and i wanna to add a filter script that select for which interface the alarm's mail have to start. Any suggestion?</p>
</blockquote>
<p dir="auto">Source of interface down event is the node. You can filter events using script by interface name or index. For example, to pass SYS_IF_DOWN events only for interface named "eth2", you can use the following script:</p>
<pre><code>return $2 == "eth2";
</code></pre>
<p dir="auto">We use $2 here because interface name passed as second parameter with SYS_IF_DOWN event. You can see this from event description:</p>
<p dir="auto">Generated when interface goes down.<br />
Please note that source of event is node, not an interface itself.<br />
Parameters:<br />
  1) Interface object ID<br />
  2) Interface name<br />
  3) Interface IP address<br />
  4) Interface netmask<br />
  5) Interface index</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8631</link><guid isPermaLink="true">https://forum.netxms.org/post/8631</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 01 Oct 2012 15:41:14 GMT</pubDate></item><item><title><![CDATA[Reply to NXSL script help on Mon, 01 Oct 2012 11:54:07 GMT]]></title><description><![CDATA[<p dir="auto"><a href="http://wiki.netxms.org/wiki/NXSL:trace" rel="nofollow ugc">http://wiki.netxms.org/wiki/NXSL:trace</a></p>
]]></description><link>https://forum.netxms.org/post/8629</link><guid isPermaLink="true">https://forum.netxms.org/post/8629</guid><dc:creator><![CDATA[SKYnv]]></dc:creator><pubDate>Mon, 01 Oct 2012 11:54:07 GMT</pubDate></item></channel></rss>