<?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[Adding details to table threshold alarm / no SNMPReadTable function]]></title><description><![CDATA[<p dir="auto">Right now I get alarm messages like</p>
<blockquote>
<p dir="auto">Threshold activated on table "prtAlert" row 1 (12)</p>
</blockquote>
<p dir="auto">but I'd prefer to get messages like</p>
<blockquote>
<p dir="auto">Threshold activated on table "prtAlert": YELLOW CARTRIDGE LOW</p>
</blockquote>
<p dir="auto">i.e. it should pull the message from a cell in row 1 in the table. A screenshot of this table is attached to this post.<br />
<img src="/assets/uploads/files/smf/0000000002054-Screen_Shot_2014-11-03_at_10.26.10.png" alt="" class="img-markdown  img-fluid" width="309" height="93" /></p>
<hr />
<p dir="auto">I'm trying to put together a script to add more information to the <em>SYS_TABLE_THRESHOLD_ACTIVATED</em> event message. The script is called <em>Table_Alarm_Description</em>, so I added <code>%[Table_Alarm_Description]</code> to the <em>Message</em> field in the <em>Generate alarm</em> action of event number 18 (Generate alarm on table threshold violation). The script gets called when the alarm is triggered and all is well in that regard.</p>
<p dir="auto">This is the script I'm using:</p>
<pre><code>sub main()
{
	table = AgentReadTable($node, $event-&gt;parameters[2]);
	if (table == null)
	{
		return "[AgentReadTable(" . $node-&gt;name . ", " . $event-&gt;parameters[2] . ") failed.]";
	}
	colNum = 1;
	alertMsg = table-&gt;get($event-&gt;parameters[4], colNum);
	if (alertMsg == null)
	{
		return "[table-&gt;get(" . $event-&gt;parameters[4] . ", " . colNum . ") failed.]";
	}
	return alertMsg;
}
</code></pre>
<p dir="auto">I'm seeing that <em>AgentReadTable</em> always fails. I suspect this is due to the fact that my node is monitored via SNMP and not via the agent. How can I fix this? Unfortunately, there is no function named something like <em>SNMPReadTable</em> that could be used instead.</p>
<p dir="auto">Alternatively, do you know any other way to add more details as in the example above to a table threshold alarm?<br />
Please note that I CANNOT use anything like</p>
<pre><code>transport = CreateSNMPTransport($node);
oid = ".1.3.6.1.2.1.43.18.1.1.8." . $event-&gt;parameters[5];
varbind = SNMPGet(transport, oid);
varbind-&gt;value
</code></pre>
<p dir="auto">in my script because the OID is different for different tables I have; also the value of $event-&gt;parameters[5] is not always the same as the final number in the OID.<br />
I need to have the script read the value from the table.</p>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000002054-Screen_Shot_2014-11-03_at_10.26.10.png" alt="Screen Shot 2014-11-03 at 10.26.10.png" class="img-markdown  img-fluid" width="309" height="93" /></p>
]]></description><link>https://forum.netxms.org/topic/3449/adding-details-to-table-threshold-alarm-no-snmpreadtable-function</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 13:58:31 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/3449.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Nov 2014 09:29:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Adding details to table threshold alarm / no SNMPReadTable function on Mon, 03 Nov 2014 17:26:12 GMT]]></title><description><![CDATA[<p dir="auto">I figured it out. <a href="http://wiki.netxms.org/wiki/NXSL:GetDCIValueByName" rel="nofollow ugc">GetDCIValueByName</a> is able to return table objects, so it's quite simple:</p>
<pre><code>sub main()
{
	table = GetDCIValueByName($node, $event-&gt;parameters[1]);
	if (table == null)
	{
		return "[GetDCIValueByName(" . $node-&gt;name . ", " . $event-&gt;parameters[1] . ") failed.]";
	}
	colNum = 1;
	alertMsg = table-&gt;get($event-&gt;parameters[4], colNum);
	if (alertMsg == null)
	{
		return "[table-&gt;get(" . $event-&gt;parameters[4] . ", " . colNum . ") failed.]";
	}
	return alertMsg;
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/15190</link><guid isPermaLink="true">https://forum.netxms.org/post/15190</guid><dc:creator><![CDATA[mk]]></dc:creator><pubDate>Mon, 03 Nov 2014 17:26:12 GMT</pubDate></item></channel></rss>