<?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[Cumulative network traffic]]></title><description><![CDATA[<p dir="auto">I grab the Victor's suggestion present in this post:</p>
<p dir="auto"><a href="https://www.netxms.org/forum/general-support/summary-of-network-traffic-1387/msg6048/#msg6048" rel="nofollow ugc">https://www.netxms.org/forum/general-support/summary-of-network-traffic-1387/msg6048/#msg6048</a></p>
<p dir="auto">And I wrote my transformation for the Internal DCI in this way (keeping the original value):</p>
<pre><code>sub getValue(paramDescr)
{
	obj = FindDCIByDescription($node, paramDescr);
	if (obj != null)
	{
	   dci = GetDCIObject($node, obj);
	   if (dci != null &amp;&amp; dci-&gt;status == 0 &amp;&amp; dci-&gt;errorCount == 0)
	   {
	   	val = GetDCIValue($node, dci-&gt;id);
	   	if (val != null)
				   return val;
		  }
	}
   return 0;
}

return $1+getValue("_HF - Download on eth0 (bytes)");
</code></pre>
<p dir="auto">My problem is that I'm getting exactly the value of the original DCI ("_HF - Download on eth0 (bytes)"). Where am I wrong?</p>
<p dir="auto">Do you have a suggestion on how to reset the counter once per month still mantaining an history (even in another DCI)? The goal is to obtain network traffic statistics per each month.</p>
<p dir="auto">Best regards,<br />
Marco</p>
]]></description><link>https://forum.netxms.org/topic/2777/cumulative-network-traffic</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:49:58 GMT</lastBuildDate><atom:link href="https://forum.netxms.org/topic/2777.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Dec 2013 17:12:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cumulative network traffic on Tue, 10 Dec 2013 07:27:07 GMT]]></title><description><![CDATA[<p dir="auto">Hi!</p>
<p dir="auto">You can create new internal DCI with custom schedule to run once per month and either read current value of cumulative counter in transformation script. The tricky part is timing to ensure that monthly DCI runs before cumulative counter resets at month change. Alternative option could be storing value temporarily in node's custom parameters - when cumulative counter resets, it stores it's current value into some custom attribute, and then monthly DCI reads it.</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/12126</link><guid isPermaLink="true">https://forum.netxms.org/post/12126</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Tue, 10 Dec 2013 07:27:07 GMT</pubDate></item><item><title><![CDATA[Reply to Cumulative network traffic on Mon, 09 Dec 2013 19:25:27 GMT]]></title><description><![CDATA[<p dir="auto">Hi Victor,</p>
<p dir="auto">it works, thank you for your help. Do you have a suggestion on how to store cumulative values month by month (e.g. traffic for january, february, etc.)?</p>
<p dir="auto">I have a suggestion for the transformation editor: add the line numbers, if the script is long it is difficult to reach the line indicated by the error message without manually counting the lines.</p>
<p dir="auto">Best regards,<br />
Marco</p>
]]></description><link>https://forum.netxms.org/post/12124</link><guid isPermaLink="true">https://forum.netxms.org/post/12124</guid><dc:creator><![CDATA[Jmp_3f8h]]></dc:creator><pubDate>Mon, 09 Dec 2013 19:25:27 GMT</pubDate></item><item><title><![CDATA[Reply to Cumulative network traffic on Mon, 09 Dec 2013 06:20:51 GMT]]></title><description><![CDATA[<p dir="auto">You returning value of original DCI in your transformation script, but if you want cumulative counter, you should return sum of current value of your dummy DCI and current value of original DCI, something like</p>
<p dir="auto">GetDCIValue($node, dci-&gt;id) + GetDCIValue($node, $dci-&gt;id)</p>
<p dir="auto">($dci refers to current DCI being processed).</p>
<p dir="auto">And to reset the counter - check if last poll time for your dummy DCI is in different month, and return 0 in that case, like this:</p>
<p dir="auto">if (strftime("%m", $dci-&gt;lastPollTime) &lt; strftime("%m", time()))<br />
   return 0;</p>
<p dir="auto">Best regards,<br />
Victor</p>
]]></description><link>https://forum.netxms.org/post/12118</link><guid isPermaLink="true">https://forum.netxms.org/post/12118</guid><dc:creator><![CDATA[victor]]></dc:creator><pubDate>Mon, 09 Dec 2013 06:20:51 GMT</pubDate></item></channel></rss>