<?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[Help: Count  Specific Value in DCI Table Column and Graph it]]></title><description><![CDATA[<p dir="auto">Hello NetXMS Support Community</p>
<p dir="auto">I just start to work with scripts, but I cannot achieve yet the way to count the times that some value appears in a  DCI Table column: Here is the idea that I have but I cannot translate to NetXMS code:</p>
<ol>
<li>From a DCI Table column, get the times that "x" value appears in that column.</li>
<li>Store the value and graph it.</li>
</ol>
<p dir="auto">Thanks.</p>
]]></description><link>https://forum.netxms.org/topic/4439/help-count-specific-value-in-dci-table-column-and-graph-it</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 11:45:59 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/4439.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 28 Apr 2016 20:52:23 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help: Count  Specific Value in DCI Table Column and Graph it on Tue, 03 May 2016 14:56:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/user55116" aria-label="Profile: user55116">@<bdi>user55116</bdi></a> said in <a href="/post/19776">Help: Count  Specific Value in DCI Table Column and Graph it</a>:</p>
<blockquote>
<p dir="auto">Instead of using your script within the transformation section, why not create a DCI, which executes your script?</p>
<p dir="auto">This way, you can use the default method for history and graphing from NetXMS.</p>
</blockquote>
<p dir="auto">Thanks for your answer. And yes, I did it yesterday and it worked.</p>
<p dir="auto">I created first this script with the function count, so I can reuse it:</p>
<pre><code>sub CALL_ACTIVE_COUNT(CALL_ACTIVE_TABLE,CALL_ACTIVE_PEER_ID,CALL_TYPE_ID)
{
	COUNT=0;

	for(i = 0; i &lt; CALL_ACTIVE_TABLE-&gt;rowCount; i++)
	{
		if (CALL_ACTIVE_TABLE-&gt;get(i,CALL_ACTIVE_TABLE-&gt;getColumnIndex(CALL_ACTIVE_PEER_ID))==CALL_TYPE_ID)
		{
			COUNT=COUNT+1;
		}

	}

	return COUNT;
}
</code></pre>
<p dir="auto">Then I created this script as source for the DCI Configuration of my node, and thats is how I could obtain performance graphs:</p>
<pre><code>use CUBE_CALL_ACTIVE_COUNT;

sub main()
{
  LOCAL_ACTIVE_CALLS=CALL_ACTIVE_COUNT(GetDCIValue($node,FindDCIByDescription($node, "CALL-ACTIVE-TABLE-1")),"CALL-ACTIVE-PEER-ID",5);

   return LOCAL_ACTIVE_CALLS;
}
</code></pre>
]]></description><link>https://forum.netxms.org/post/19780</link><guid isPermaLink="true">https://forum.netxms.org/post/19780</guid><dc:creator><![CDATA[radw]]></dc:creator><pubDate>Tue, 03 May 2016 14:56:34 GMT</pubDate></item><item><title><![CDATA[Reply to Help: Count  Specific Value in DCI Table Column and Graph it on Mon, 02 May 2016 07:58:51 GMT]]></title><description><![CDATA[<p dir="auto">Instead of using your script within the transformation section, why not create a DCI, which executes your script?</p>
<p dir="auto">This way, you can use the default method for history and graphing from NetXMS.</p>
]]></description><link>https://forum.netxms.org/post/19776</link><guid isPermaLink="true">https://forum.netxms.org/post/19776</guid><dc:creator><![CDATA[user55116]]></dc:creator><pubDate>Mon, 02 May 2016 07:58:51 GMT</pubDate></item><item><title><![CDATA[Reply to Help: Count  Specific Value in DCI Table Column and Graph it on Sun, 01 May 2016 19:43:08 GMT]]></title><description><![CDATA[<p dir="auto">Hello NetXMS Team</p>
<p dir="auto">In the past days I was able to write this script for counting the times a value is present in a DCI Table Column. Here are the steps Im following:</p>
<ol>
<li>I arrived to this function declared in the CUBE_FUNCTIONS_1 script (I'm planning reusing this function many times):</li>
</ol>
<p dir="auto">sub CALL_ACTIVE_COUNT(CALL_ACTIVE_TABLE,CALL_ACTIVE_PEER_ID,CALL_TYPE_ID)<br />
{<br />
    COUNT=0;<br />
    <br />
    for(i = 0; i &lt; CALL_ACTIVE_TABLE-&gt;rowCount; i++)<br />
    {<br />
        if (CALL_ACTIVE_TABLE-&gt;get(i,CALL_ACTIVE_TABLE-&gt;getColumnIndex(CALL_ACTIVE_PEER_ID))==CALL_TYPE_ID)<br />
        {<br />
            COUNT=COUNT+1;<br />
        }<br />
                <br />
    }<br />
    <br />
    return COUNT;<br />
}</p>
<ol start="2">
<li>Now, in the DCI Table configuration, I used this function to count the times that value '5' is find in the selected column and return me that count:</li>
</ol>
<p dir="auto"><img src="http://i64.tinypic.com/29537gl.jpg" alt="" class="img-markdown  img-fluid" /></p>
<ol start="3">
<li>Here, this is value I need to graph , but I dont know how use that value in a graph, even reading all the documentation many times.</li>
</ol>
<p dir="auto">Sorry if my posts are not completely understood at first sight, that because Im tired to trying myself the configurations many times,  reading the documentation, the forum, the videos, and not find in the moment what Im looking for, and I need that some tool (like NetXMS) could report me the SNMP metrics as fast as possible. I changed the title again to help you read my issue.</p>
<p dir="auto">Regards.</p>
]]></description><link>https://forum.netxms.org/post/19775</link><guid isPermaLink="true">https://forum.netxms.org/post/19775</guid><dc:creator><![CDATA[radw]]></dc:creator><pubDate>Sun, 01 May 2016 19:43:08 GMT</pubDate></item></channel></rss>