<?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[Actions - Parameter?]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">Having defined several actions, I was wondering whether there is a way to define actions (remote or not) in the server related panel to which some parameters could be given when called through an event policy.</p>
<p dir="auto">That would be very interesting as a defined action could be so generic that it would be called in several events but with different parameters. Example, a script "start_process.pl" to which you would give the process name and the user whose rights shall be used to start it. You may also want to provide the remote node name on which to start this process...</p>
<p dir="auto">Cheers,<br />
Jdamien</p>
]]></description><link>https://forum.netxms.org/topic/668/actions-parameter</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 09:39:14 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/668.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 26 Jun 2009 06:38:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Actions - Parameter? on Tue, 30 Jun 2009 16:50:43 GMT]]></title><description><![CDATA[<p dir="auto">Yes, you right - alarm message is unavailable within script. For the next version, I add new global variable <strong>$alarmMessage</strong> which will hold alarm's text. It's not part of event object (it's only created based on event data), so it will be incorrect and technically slightly harder to put it as <strong>$event</strong> attribute.</p>
<p dir="auto">Currently you able to pass alarm message to action via %A macro - this can help if you don't need it in script.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jdl" aria-label="Profile: jdl">@<bdi>jdl</bdi></a> said in <a href="/post/3190">Actions - Parameter?</a>:</p>
<blockquote>
<p dir="auto">In the script, the <strong>$event-&gt;message</strong> refers to the text message defined in the event not in the alarm which can be more specific as we get additional macro's at that level, right?</p>
</blockquote>
<p dir="auto">You have only two additional macros at alarm definition level - %m (event's message text) and %M (custom message, if set in matching script). All other macros are the same (including scripts and custom node attributes).</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/3191</link><guid isPermaLink="true">https://forum.netxms.org/post/3191</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 30 Jun 2009 16:50:43 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Tue, 30 Jun 2009 13:28:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi</p>
<p dir="auto">One more in this topic...</p>
<p dir="auto">Using <strong>$event-&gt;message</strong> we get the message text defined in the "<em>event</em>" panel.<br />
How do you differentiate between this message text and the one you can re-define in the "<em>event processing</em>" panel when defining an alarm? Is there a property to the <strong>$event</strong> object that covers this one?</p>
<p dir="auto">In the script, the <strong>$event-&gt;message</strong> refers to the text message defined in the event not in the alarm which can be more specific as we get additional macro's at that level, right?</p>
<p dir="auto">Regards,<br />
Jdamien</p>
]]></description><link>https://forum.netxms.org/post/3190</link><guid isPermaLink="true">https://forum.netxms.org/post/3190</guid><dc:creator><![CDATA[jdl]]></dc:creator><pubDate>Tue, 30 Jun 2009 13:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Tue, 30 Jun 2009 06:26:09 GMT]]></title><description><![CDATA[<p dir="auto">Thanks for this rapid feedback!</p>
<p dir="auto">Regards,<br />
Jdamien</p>
]]></description><link>https://forum.netxms.org/post/3183</link><guid isPermaLink="true">https://forum.netxms.org/post/3183</guid><dc:creator><![CDATA[jdl]]></dc:creator><pubDate>Tue, 30 Jun 2009 06:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Mon, 29 Jun 2009 19:00:30 GMT]]></title><description><![CDATA[<p dir="auto">Event object (represented by $event variable) has the following attributes:</p>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th><strong>code</strong></th>
<th>Event code</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>id</strong></td>
<td>Event ID</td>
</tr>
<tr>
<td><strong>severity</strong></td>
<td>Severity code (0=Normal 1=Warning 2=Minor 3=Major 4=Critical)</td>
</tr>
<tr>
<td><strong>timestamp</strong></td>
<td>Timestamp as number of seconds since 1 Jan 1970 00:00:00 UTC</td>
</tr>
<tr>
<td><strong>message</strong></td>
<td>Message text</td>
</tr>
<tr>
<td><strong>customMessage</strong></td>
<td>Custom message text (added in 0.2.27)</td>
</tr>
<tr>
<td><strong>userTag</strong></td>
<td>User tag</td>
</tr>
<tr>
<td><strong>parameters</strong></td>
<td>Event parameters (this property is an array with first element started at 1)</td>
</tr>
</tbody>
</table>
<p dir="auto">Also, starting from version 0.2.27 you can access node's custom attributes directly via object referenced by $node variable, if attribute's name conforms to NXSL identifier naming restrictions (contains only letters, digits, underscore and dollar sign, and not starts with digit). For example, if you define custom attribute <strong>terminalId</strong>, you can access it in script as following:</p>
<pre><code>$node-&gt;terminalId
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/3182</link><guid isPermaLink="true">https://forum.netxms.org/post/3182</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 29 Jun 2009 19:00:30 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Mon, 29 Jun 2009 13:46:25 GMT]]></title><description><![CDATA[<p dir="auto">Jesus... that's great!<br />
Thanks for the info...</p>
<p dir="auto">But you know my next question, don't you <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--wink" style="height:1.4em;width:auto;vertical-align:middle" title=";-)" alt="😉" /></p>
<p dir="auto">Where can I find a description of $node and $event variables/objects?</p>
<p dir="auto">So I found <strong>$nodes</strong> object attributes:<br />
Attributes of node object:</p>
<p dir="auto"><strong>name</strong>		Node name<br />
<strong>id</strong>			Object identifier<br />
<strong>status</strong>		Node status (0 = Normal, 1 = Warning, 2 = Minor, 3 = Major, 4 = Critical, 5 = Unknown, 6 = Unmanaged)<br />
<strong>ipAddr</strong>		Node primary IP address (as text string, like 10.2.1.4)<br />
<strong>isAgent</strong>		Agent presense flag: 1 if NetXMS agent present on node, 0 if not<br />
<strong>isSNMP</strong>		SNMP support flag: 1 if SNMP is supported by node, 0 if not<br />
<strong>isBridge</strong>		Bridge flag: 1 if node is bridge or switch, 0 if not<br />
<strong>isRouter</strong>		IP router flag: 1 if node is Ip router (can forward IP packets), 0 if not<br />
<strong>isPrinter</strong>		Printer flag: 1 if node detected to be a network printer, 0 if not<br />
<strong>isCDP</strong>		CDP (Cisco Discovery Protocol) support flag: 1 node supports CDP, 0 if not<br />
<strong>isSONMP</strong>		SONMP (SynOptics Network Management Protocol) support flag: 1 node supports SONMP, 0 if not<br />
<strong>isLLDP</strong>		LLDP (Link Layer Discovery Protocol) support flag: 1 node supports LLDP, 0 if not<br />
<strong>snmpVersion</strong>	SNMP version used for communication with node's SNMP agent<br />
<strong>snmpOID	SNMP</strong>	object ID<br />
<strong>agentVersion</strong>	NetXMS agent version (as string, like 0.2.26)<br />
<strong>platformName</strong>	Platform name, as returned by NetXMS agent (for example, windows-i386)</p>
<p dir="auto">Remains <strong>$event</strong> object attribute...</p>
<p dir="auto">Regards,<br />
JDamien</p>
]]></description><link>https://forum.netxms.org/post/3181</link><guid isPermaLink="true">https://forum.netxms.org/post/3181</guid><dc:creator><![CDATA[jdl]]></dc:creator><pubDate>Mon, 29 Jun 2009 13:46:25 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Mon, 29 Jun 2009 09:43:57 GMT]]></title><description><![CDATA[<p dir="auto">Hello!</p>
<p dir="auto">You cannot pass parameters to actions directly in event processing policy. However, you can use macros in defined actions - this can cover basic things like host name, event message text, severity, and so on easily. You can also use node's custom attributes (via %{..} macro). And for event more complicated things, you can call NXSL script when expanding macros in actions (via %[..] macro). When called, this script has access to node and event information via $node and $event global variables. You can also set global variable CUSTOM_MESSAGE in event matching script and later insert this value into alarms or actions via %M macro.</p>
<p dir="auto">Little example of using scripts</p>
<p dir="auto">Goal: send e-mail to different people depending on node's domain name.</p>
<p dir="auto">Steps:</p>
<ol>
<li>create e-mail action as usual, in recipient address field enter %[SelectEmail]</li>
<li>create script in script library, named SelectEmail:</li>
</ol>
<pre><code>sub main()
{
   if (right($node-&gt;name, 11) == ".domain.com")
      return "admin@domain.com";
   if (right($node-&gt;name, 12) == ".domain2.com")
      return "admin@domain2.com";
   return "admin@default.com";
}
</code></pre>
<ol start="3">
<li>in event processing policy, use defined action as usual</li>
</ol>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/3178</link><guid isPermaLink="true">https://forum.netxms.org/post/3178</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 29 Jun 2009 09:43:57 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Mon, 29 Jun 2009 06:04:10 GMT]]></title><description><![CDATA[<p dir="auto">I would appreciate if someone could take some time to put some inputs here on this subject...</p>
<p dir="auto">Possible? Not possible?<br />
Another example: Imagine you want to send an email to different staff in function of the alarm/event... do you have to create a specific action for each email?</p>
<p dir="auto">Thanks in advance for ur support and time.<br />
Rgds,</p>
<p dir="auto">Jdamien</p>
]]></description><link>https://forum.netxms.org/post/3174</link><guid isPermaLink="true">https://forum.netxms.org/post/3174</guid><dc:creator><![CDATA[jdl]]></dc:creator><pubDate>Mon, 29 Jun 2009 06:04:10 GMT</pubDate></item><item><title><![CDATA[Reply to Actions - Parameter? on Fri, 26 Jun 2009 06:41:53 GMT]]></title><description><![CDATA[<p dir="auto">In the same context...</p>
<p dir="auto">Would be nice to pass as argument the email addresses for the "sendmail" action!<br />
And why not also content and subject or a specific template... well a bit more flexibility around here would be very powerful.</p>
<p dir="auto">Cheers,</p>
<p dir="auto">Jdamien</p>
]]></description><link>https://forum.netxms.org/post/3160</link><guid isPermaLink="true">https://forum.netxms.org/post/3160</guid><dc:creator><![CDATA[jdl]]></dc:creator><pubDate>Fri, 26 Jun 2009 06:41:53 GMT</pubDate></item></channel></rss>