<?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[Wrong interface speed in DCI threshold script]]></title><description><![CDATA[<p dir="auto">We use this script for interface load threshold</p>
<pre><code>dci_instance = SplitString($dci-&gt;instance, ";");
node_interface_array = GetNodeInterfaces($node);
node_interface = node_interface_array[dci_instance[0]];
interface_speed = node_interface-&gt;speed;
trace(0, "DCI instance:" . dci_instance[0] .
		" threshold on " . $node-&gt;name .
		" : " . ($2 * interface_speed) . "&lt;=" . $1 .
		" = " . ($2 * interface_speed)&lt;=$1);
if (($2 * interface_speed) &lt;= $1)
	return true;
return false;
</code></pre>
<p dir="auto">some interfaces have wrong speed = 0.000000</p>
<pre><code>2019.03.25 13:02:33.767 *I* DCI instance:11 threshold on 34760 : 750000000.000000&lt;=11931472 = 0
2019.03.25 13:02:33.787 *I* DCI instance:12 threshold on 34760 : 0.000000&lt;=366424 = 1
2019.03.25 13:02:33.807 *I* DCI instance:14 threshold on 34760 : 0.000000&lt;=8077080 = 1
2019.03.25 13:02:33.827 *I* DCI instance:18 threshold on 34760 : 750000000.000000&lt;=280684232 = 0
</code></pre>
<p dir="auto">but in database and console has correct speed:</p>
<pre><code>mysql&gt; SELECT `id`, `speed` FROM interfaces WHERE `node_id` = 34760 AND `if_index` IN (12, 14);
+-------+------------+
| id    | speed      |
+-------+------------+
| 34772 | 1000000000 |
| 34774 | 1000000000 |
+-------+------------+
2 rows in set
</code></pre>
<hr />
<p dir="auto"><img src="/assets/uploads/files/smf/0000000004424-2019-03-25_13-17-01.png" alt="2019-03-25_13-17-01.png" class="img-markdown  img-fluid" width="1202" height="659" /></p>
]]></description><link>https://forum.netxms.org/topic/5875/wrong-interface-speed-in-dci-threshold-script</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:40:53 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/5875.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Mar 2019 10:22:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wrong interface speed in DCI threshold script on Mon, 25 Mar 2019 10:37:14 GMT]]></title><description><![CDATA[<p dir="auto">we found mistake in array index:</p>
<pre><code>node_interface = node_interface_array[dci_instance[0] - 1];
</code></pre>
]]></description><link>https://forum.netxms.org/post/25489</link><guid isPermaLink="true">https://forum.netxms.org/post/25489</guid><dc:creator><![CDATA[simplex]]></dc:creator><pubDate>Mon, 25 Mar 2019 10:37:14 GMT</pubDate></item></channel></rss>