<?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 display duration between trap events?]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I would like to ask that is there any solution to calculate the elapsed time between a traps pair?<br />
A little more detailed, the problem what I need to solve is the following:<br />
I get a trap about the starting of a signal drop.<br />
From this I generate an event for example with the following text: "Started from 11:00:12 10/02/2020 the RF signal out of tolerance."<br />
When the signal loss ceases (typically max. few minutes), the end-of alarm trap arrives as well. From this I also generate an event that works properly and clears the existing alarm as well.<br />
What I can't solve for the moment is to display the duration of the signal loss (e.g. in seconds) in the end of event text.<br />
Is there any solution to this?<br />
Thank you very much for any suggestions in advance.</p>
]]></description><link>https://forum.netxms.org/topic/7296/how-to-display-duration-between-trap-events</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 08:48:46 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/7296.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 12 Feb 2022 18:12:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to display duration between trap events? on Mon, 21 Feb 2022 15:33:45 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor,</p>
<p dir="auto">Thank you very much for your detailed support. It works fine.</p>
<p dir="auto">Best regards, Zsolt</p>
]]></description><link>https://forum.netxms.org/post/31057</link><guid isPermaLink="true">https://forum.netxms.org/post/31057</guid><dc:creator><![CDATA[cserzs]]></dc:creator><pubDate>Mon, 21 Feb 2022 15:33:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to display duration between trap events? on Fri, 18 Feb 2022 15:29:35 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">you can set custom attribute on a node to current time from first event, and for the second event use script macro to read custom attribute value and return the difference with current time. For example:</p>
<ol>
<li>Create script in script library called SetSignalLossTime:</li>
</ol>
<pre><code>$node-&gt;setCustomAttribute(".signalLossTime", time());
</code></pre>
<ol start="2">
<li>Create script in script library called GetSignalLossDuration:</li>
</ol>
<pre><code>t = $node-&gt;getCustomAttribute(".signalLossTime");
return (t != null) ? time() - t : 0;
</code></pre>
<ol start="3">
<li>
<p dir="auto">Create server action of type script that will execute script SetSignalLossTime.</p>
</li>
<li>
<p dir="auto">Add action from #3 to EPP rule where you generate alarm for signal loss.</p>
</li>
<li>
<p dir="auto">In the message template for recovery event add %[GetSignalLossDuration] to insert duration of signal loss.</p>
</li>
</ol>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/31045</link><guid isPermaLink="true">https://forum.netxms.org/post/31045</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Fri, 18 Feb 2022 15:29:35 GMT</pubDate></item></channel></rss>