<?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[Alarm notification call API]]></title><description><![CDATA[<p dir="auto">Hi is it possible to set up an Alarm action that will call an external systems API</p>
]]></description><link>https://forum.netxms.org/topic/8261/alarm-notification-call-api</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 12:14:57 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/8261.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 Sep 2025 18:52:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Alarm notification call API on Tue, 07 Oct 2025 11:14:21 GMT]]></title><description><![CDATA[<p dir="auto">Well, yes, FindAlarmByKey() is not searching through already terminated alarms, only current ones. And even if everything happens within one  EPP rule, alarm termination happens first and server action happens after that.</p>
<p dir="auto">So the solution for now is to store the ID somehow before alarm termination. We can use filtering script in the EPP rule:</p>
<pre><code>a = FindAlarmByKey($event.lastAlarmKey);
$event.setNamedParameter("lastAlarmID", a.id);
return true;
</code></pre>
<p dir="auto">return true; is needed since this is filtering script and EPP rule will be processed further only if this script returns true.</p>
<p dir="auto">And in your script that is used by the %[script] macro:</p>
<pre><code>return $event.getParameter("lastAlarmID");
</code></pre>
<p dir="auto">We are adding a new parameter to the event. This parameter will be accessible in any EPP rule that goes below the one where it's being added.</p>
<p dir="auto">Ah, and actually you don't need the %[script] thing any more - you can just use %&lt;lastAlarmID&gt; macro - this should return value of event's parameter.</p>
]]></description><link>https://forum.netxms.org/post/34895</link><guid isPermaLink="true">https://forum.netxms.org/post/34895</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Tue, 07 Oct 2025 11:14:21 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Tue, 07 Oct 2025 08:23:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi Filipp,</p>
<p dir="auto">thanks for the reply that also works for new Alarms but this issue I have is when the event is raised for terminating the alarm it doesn't work and raises the below</p>
<p dir="auto">Error:<br />
Minor	vm-netxms-srev	SYS_SCRIPT_ERROR	Script (getAlarmID) execution error: Error 14 in line 3: Function or operation argument is not an object	07.10.2025 08:58:16</p>
<p dir="auto">Script:<br />
//return $<a href="http://event.id" rel="nofollow ugc">event.id</a>;<br />
a = FindAlarmByKey($event.lastAlarmKey);<br />
return <a href="http://a.id" rel="nofollow ugc">a.id</a>;</p>
]]></description><link>https://forum.netxms.org/post/34894</link><guid isPermaLink="true">https://forum.netxms.org/post/34894</guid><dc:creator><![CDATA[richard21]]></dc:creator><pubDate>Tue, 07 Oct 2025 08:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Mon, 06 Oct 2025 12:22:23 GMT]]></title><description><![CDATA[<p dir="auto">Well, while not being a LLM, I've hallucinated about $alarm :). It does not actually exist.</p>
<p dir="auto">But in $event there's lastAlarmKey attribute, so we can use that to get alarm's ID:</p>
<pre><code>a = FindAlarmByKey($event.lastAlarmKey);
return a.id;
</code></pre>
<p dir="auto">Or course, alarm should have a key and this key should be unique.</p>
<p dir="auto">At some point we will add lastAlarmID attribute to $event.</p>
]]></description><link>https://forum.netxms.org/post/34890</link><guid isPermaLink="true">https://forum.netxms.org/post/34890</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Mon, 06 Oct 2025 12:22:23 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Sat, 04 Oct 2025 15:25:55 GMT]]></title><description><![CDATA[<p dir="auto">Hi Filipp</p>
<p dir="auto">thanks for the assistance that works great for new alarms unfortunately when it runs for a terminating alarm it doesn't return the alarm id</p>
<p dir="auto">Regards<br />
Richard</p>
]]></description><link>https://forum.netxms.org/post/34888</link><guid isPermaLink="true">https://forum.netxms.org/post/34888</guid><dc:creator><![CDATA[richard21]]></dc:creator><pubDate>Sat, 04 Oct 2025 15:25:55 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Mon, 06 Oct 2025 12:07:14 GMT]]></title><description><![CDATA[<p dir="auto">Yes, right, these are the macros described here: <a href="https://netxms.org/documentation/adminguide/event-processing.html#macros-for-event-processing" rel="nofollow ugc">https://netxms.org/documentation/adminguide/event-processing.html#macros-for-event-processing</a></p>
<p dir="auto">There's no built-in macro for alarm ID, but there's %[script_name] which will call a script from script library. There'll be a few variables set in the script, specifically:<br />
$object - always is set<br />
$node - set if event is created on a node<br />
$event - when script is called from EPP<br />
<s>$alarm - if at given moment of event processing by EPP rules an alarm is already created.</s></p>
<p dir="auto"><s>$alarm variable has Alarm class described here: <a href="https://netxms.org/documentation/nxsl-latest/#class-alarm" rel="nofollow ugc">https://netxms.org/documentation/nxsl-latest/#class-alarm</a> , so simple script</s></p>
<p dir="auto"><s>return $<a href="http://alarm.id" rel="nofollow ugc">alarm.id</a>;</s></p>
<p dir="auto"><s>should do the job.</s></p>
]]></description><link>https://forum.netxms.org/post/34877</link><guid isPermaLink="true">https://forum.netxms.org/post/34877</guid><dc:creator><![CDATA[Filipp Sudanov]]></dc:creator><pubDate>Mon, 06 Oct 2025 12:07:14 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Tue, 30 Sep 2025 15:44:14 GMT]]></title><description><![CDATA[<p dir="auto">I have found the Variables and they are now passing to the API via the alarm action as below but is there a variable for the Alarm ID as shown in the UI</p>
<p dir="auto">/etc/netxms/scripts/send_event.sh "%K" "%I" "%n" "%S" "%c" "%A"</p>
]]></description><link>https://forum.netxms.org/post/34876</link><guid isPermaLink="true">https://forum.netxms.org/post/34876</guid><dc:creator><![CDATA[richard21]]></dc:creator><pubDate>Tue, 30 Sep 2025 15:44:14 GMT</pubDate></item><item><title><![CDATA[Reply to Alarm notification call API on Sun, 21 Sep 2025 18:57:57 GMT]]></title><description><![CDATA[<p dir="auto">Add "server action" in EPP rule where you are creating alarm</p>
]]></description><link>https://forum.netxms.org/post/34847</link><guid isPermaLink="true">https://forum.netxms.org/post/34847</guid><dc:creator><![CDATA[alk]]></dc:creator><pubDate>Sun, 21 Sep 2025 18:57:57 GMT</pubDate></item></channel></rss>