<?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[One kind of trap that covers dozens of alarms - how to configure]]></title><description><![CDATA[<p dir="auto">Hello geeks,</p>
<p dir="auto">I've been playing with processing of traps and generation of events and alarms recently. All works as described. Tho', I am facing a situation I am not successful to cover / or even mentally resolve with the basic knowledge of the framework.</p>
<p dir="auto">For all the possible situations, our lovely device emits traps with the same trap OID and just by analyzing the content of these traps we know what is going on underneath... The device consists of many cards/subcomponents where each can have a different status at the same moment. One of the trap parameters tells exactly the current status of the subcomponent related to the trap... Identification of the subcomponent is another parameter. Of course there are more parameters inside each trap telling more about sub-subcomponents... <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /> (But these are probably not important at the moment.)</p>
<p dir="auto">To describe my issue more practically I will say that I need to see in the Alarm browser (for example) that subcomponent A of my monitored device has a "minor" problem, B ~ "minor", C ~ "critical", no problem on D, and so on. Of course when I receive a trap clearing one of the problems, I need to remove its related alarm in NetXMS too (not from the log, of course; just from the list of active alarms.)</p>
<p dir="auto">I tried to experiment with the Event Processing Policy panel in a way to register a set of policies for my the only one event that is issued upon receiving my special kind of trap.</p>
<p dir="auto">I even tried to look at the NXSL (for the Filtering script)... whether that is the way to go or not. But that appeared to be a bit above my "101" lesson... <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
<p dir="auto">Would you have any suggestions for me, please.</p>
<p dir="auto">Thank you,<br />
Yarda.</p>
]]></description><link>https://forum.netxms.org/topic/2029/one-kind-of-trap-that-covers-dozens-of-alarms-how-to-configure</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 12:29:39 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2029.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 19 Nov 2012 14:52:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Thu, 22 Nov 2012 19:56:40 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">Can you describe this situation with more details? I'm not sure that I understand it correctly...</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8978</link><guid isPermaLink="true">https://forum.netxms.org/post/8978</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Thu, 22 Nov 2012 19:56:40 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Thu, 22 Nov 2012 09:08:48 GMT]]></title><description><![CDATA[<p dir="auto">The $event-&gt;... works like a charm. And that seems to cover all my needs. I am a happy hippo.</p>
<p dir="auto">Will you have any advice also for the previously posted sub-question:</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/yarda" aria-label="Profile: yarda">@<bdi>yarda</bdi></a> said in <a href="/post/8968">One kind of trap that covers dozens of alarms - how to configure</a>:</p>
<blockquote>
<p dir="auto">Also, I noted, and cannot explain it myself (yet), that when I generate my alarms, I have CRITICAL, MAJOR, MINOR and NORMAL all triggered by one "NORMAL" event, only sometimes I get change of the node's status.</p>
<p dir="auto">Only sporadically (but not rarely :)) I see the following events in the Event Monitor:</p>
<p dir="auto">Major	SYS_NODE_MAJOR	Node status changed to MAJOR<br />
Critical	SYS_NODE_CRITICAL	Node status changed to CRITICAL<br />
Warning	SYS_NODE_WARNING	Node status changed to WARNING<br />
Normal	SYS_NODE_NORMAL	Node status changed to NORMAL</p>
</blockquote>
<p dir="auto">Thank you,<br />
Yarda.</p>
]]></description><link>https://forum.netxms.org/post/8973</link><guid isPermaLink="true">https://forum.netxms.org/post/8973</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Thu, 22 Nov 2012 09:08:48 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Wed, 21 Nov 2012 16:00:32 GMT]]></title><description><![CDATA[<p dir="auto">Sorry, that was my mistake. Script called via %[] didn't get event's parameters in $1, $2, etc. Instead, you should use $event variable to access event attributes. Event class described here: <a href="http://wiki.netxms.org/wiki/NXSL:Event" rel="nofollow ugc">http://wiki.netxms.org/wiki/NXSL:Event</a>. To access parameters, you can use $event-&gt;parameters array. So, correct code in my example would be</p>
<pre><code>default: return "Unknown code " . $event-&gt;parameters[5];
</code></pre>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8972</link><guid isPermaLink="true">https://forum.netxms.org/post/8972</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 21 Nov 2012 16:00:32 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Wed, 21 Nov 2012 14:55:20 GMT]]></title><description><![CDATA[<p dir="auto">If my script contains:</p>
<pre><code>return "HELLO";
</code></pre>
<p dir="auto">...I get this string properly in my alarm's message.</p>
<p dir="auto">In case of your suggested code that I simplified (for test purposes) down to:</p>
<pre><code>return "HELLO" . $3;
</code></pre>
<p dir="auto">I get:</p>
<p dir="auto"><strong>Script (CodeToText) execution error: Error 5 in line 1: Invalid operation with NULL value</strong></p>
<p dir="auto">...the same failure with any other parameters, like $2, $4, $5, $6 ... Only $1 doesn't complain, cos' it is an empty string.</p>
<p dir="auto">Definition of my alarm's message follows:</p>
<p dir="auto"><strong>Alarm Card%5 %4: %3 Status: %2, Direction: %8, Port Level: %6, Port Number: %7 %[CodeToText]</strong></p>
<p dir="auto">Misunderstood your comments?</p>
]]></description><link>https://forum.netxms.org/post/8971</link><guid isPermaLink="true">https://forum.netxms.org/post/8971</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Wed, 21 Nov 2012 14:55:20 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Wed, 21 Nov 2012 13:57:32 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">For showing text instead of code in events and alarms, you can use script in script library and macro like %[script_name]. For example, if you have some code as parameter number 5 in trap-generated event, you can create script called CodeToText in library:</p>
<pre><code>switch($5)
{
   case 1: return "CODE 1";
   case 2: return "CODE 2";
   // and so on...
   default: return "Unknown code " . $5;
}
</code></pre>
<p dir="auto">and then use</p>
<p dir="auto">%[CodeToText]</p>
<p dir="auto">in event and alarm message template.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8969</link><guid isPermaLink="true">https://forum.netxms.org/post/8969</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Wed, 21 Nov 2012 13:57:32 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Wed, 21 Nov 2012 12:15:33 GMT]]></title><description><![CDATA[<p dir="auto">Also, I noted, and cannot explain it myself (yet), that when I generate my alarms, I have CRITICAL, MAJOR, MINOR and NORMAL all triggered by one "NORMAL" event, only sometimes I get change of the node's status.</p>
<p dir="auto">Only sporadically (but not rarely :)) I see the following events in the Event Monitor:</p>
<p dir="auto">Major	SYS_NODE_MAJOR	Node status changed to MAJOR<br />
Critical	SYS_NODE_CRITICAL	Node status changed to CRITICAL<br />
Warning	SYS_NODE_WARNING	Node status changed to WARNING<br />
Normal	SYS_NODE_NORMAL	Node status changed to NORMAL</p>
]]></description><link>https://forum.netxms.org/post/8968</link><guid isPermaLink="true">https://forum.netxms.org/post/8968</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Wed, 21 Nov 2012 12:15:33 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Wed, 21 Nov 2012 08:14:46 GMT]]></title><description><![CDATA[<p dir="auto">I was successful with my configuration of multiple event policies. I've got good feelings. Tho' there is one extension to my situation. Imagine that for some of my numeric trap parameters I need to see a written description in alert's message.</p>
<p dir="auto">ID parameter is a good example in my case. We have around 100 possible ids... It would be nice to be able to map numbers to some hardcoded/configured string values.</p>
<p dir="auto">So, I need to go for the hard-core way, at least partially, anyway, don't I...?</p>
<p dir="auto">What approach would you recommend? I am thinking of tweaking (somehow :)) every relevant trap and adding some special parameter that I can refer to as <em>$(X+1)</em> (where <em>X</em> is the number of properly mapped parameters in my SNMP trap mapping config)...</p>
<p dir="auto">Thank you for your opinion.</p>
<p dir="auto">Yarda.</p>
]]></description><link>https://forum.netxms.org/post/8964</link><guid isPermaLink="true">https://forum.netxms.org/post/8964</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Wed, 21 Nov 2012 08:14:46 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Tue, 20 Nov 2012 11:24:25 GMT]]></title><description><![CDATA[<p dir="auto">Yes, exactly.</p>
]]></description><link>https://forum.netxms.org/post/8960</link><guid isPermaLink="true">https://forum.netxms.org/post/8960</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 20 Nov 2012 11:24:25 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Tue, 20 Nov 2012 11:15:23 GMT]]></title><description><![CDATA[<p dir="auto">Yes, that's what I meant; in my case where I am gonna generate multiple Alarms out of one Event, I will decide manually what would be their statuses. So that my Event's status is nothing else but only color label in the Event Monitor.</p>
]]></description><link>https://forum.netxms.org/post/8959</link><guid isPermaLink="true">https://forum.netxms.org/post/8959</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Tue, 20 Nov 2012 11:15:23 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Tue, 20 Nov 2012 09:31:41 GMT]]></title><description><![CDATA[<p dir="auto">Alarm severity may or may not be of same severity as originating event. When you create alarm from event in event processing policy, you have an option to set same severity as in event or any other fixed severity.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8958</link><guid isPermaLink="true">https://forum.netxms.org/post/8958</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 20 Nov 2012 09:31:41 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Tue, 20 Nov 2012 09:25:33 GMT]]></title><description><![CDATA[<p dir="auto">That's promising. Thank you for the cookbook, I'll try your suggestions from the top. Hoping not to reach the hard-core... <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">Just a confirmation of my understanding. Every configured Event has a severity, this one will play no role in my scenario, won't it? I am going to set my Event as Normal, to have a lot of relaxing green color in the Event Monitor. <img src="https://forum.netxms.org/assets/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=72b86a538fc" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" style="height:1.4em;width:auto;vertical-align:middle" title=":)" alt="🙂" /></p>
]]></description><link>https://forum.netxms.org/post/8957</link><guid isPermaLink="true">https://forum.netxms.org/post/8957</guid><dc:creator><![CDATA[Yarda]]></dc:creator><pubDate>Tue, 20 Nov 2012 09:25:33 GMT</pubDate></item><item><title><![CDATA[Reply to One kind of trap that covers dozens of alarms - how to configure on Tue, 20 Nov 2012 08:56:06 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">There are few different ways to achieve required functionality. First is to create alarm message texts and keys based on subcomponent. Let's assume that you have mapped subcomponend identifier to parameter number 2 of your event. Then you can create alarms with key like DEVICETRAP_%i_%2 . With such key, events related to different subcomponents will create separate alarms, and events related to subcomponent with already active alarm will replace existing alarm's text, severity, etc. and update repeat count. Creating alarms of different severity is abit more tricky - you will need separate rule for each severity. Rules have to be identical except filtering script which should check severity in the trap. For example, if you have mapped severity to event's parameter number 3, and it is text string like "minor", "major", etc., you can use filtering scripts like this:</p>
<pre><code>return $3 == "minor";
</code></pre>
<p dir="auto">or simply</p>
<pre><code>$3 == "minor"
</code></pre>
<p dir="auto">(note the absence of the semicolon in last case).</p>
<p dir="auto">Another possible way is to create single rule in event processing policy that will call NXSL script for trap-based event and stop processing, and in that script create different new event based on trap parameters (using <a href="http://wiki.netxms.org/wiki/NXSL:PostEvent" rel="nofollow ugc">PostEvent</a> function).</p>
<p dir="auto">And the hardcore way is to create server module that will process traps and do whatever needed - generate events, update object attributes, etc.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/8955</link><guid isPermaLink="true">https://forum.netxms.org/post/8955</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 20 Nov 2012 08:56:06 GMT</pubDate></item></channel></rss>