<div dir="ltr"><div><div><div>Hi Steve.<br></div>Thanks a lot for the ADDNAN hint.<br></div>I changed summarization formula to:<br>CDEF:sum_in=in1,in3,ADDNAN,in4,ADDNAN,in5,ADDNAN,......<br>CDEF:sum_out=out1,out3,ADDNAN,out4,ADDNAN,out5,ADDNAN,......<br>

<br></div>Now it works great.<br><div><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/11/6 Steve Shipway <span dir="ltr">&lt;<a href="mailto:s.shipway@auckland.ac.nz" target="_blank">s.shipway@auckland.ac.nz</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="EN-NZ"><div><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Looks like a race condition with regard to ‘Current’ value.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">For example, the RRD ‘buckets’ (step size) may be of size 5min.  Thus, they run 12:00-12:05, 12:05-12:10, etc etc<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">If the current time is 12:01, but your data comes in at 12:04, then the ‘current’ value is ‘unknown’ – since there is no data for the current bucket.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Not knowing your RRD configuration, heartbeat, step, etc I can’t say for sure, but I have seen this happen many times in RRD graphs.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">The way around it is to cheat </span><span style="font-size:11.0pt;font-family:Wingdings;color:#1f497d">J</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">.  You can define a CDEF that uses something like “x,UN,PREV,x,IF” and then use this for your ‘Current’ calculation; though this will hide when a DS is really unknown.  <u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Otherwise, if you know the graph is base at ‘now’, and your step is 5 min, then try “NOW,TIME,-,300,LT,x,UN,+,2,EQ,PREV(x),x,IF”<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">This says “If this data point is &lt;5min old, and is unknown, then take the previous value, else take the current value”<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">You may also want to take a look at the ADDNAN function for your sum_in and sum_out instead of all the UN,IF etc.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Steve<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><div class="MsoNormal" style="text-align:center" align="center"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d" lang="EN-US"><hr align="center" size="2" width="100%">

</span></div><p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Steve Shipway</span></b><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u><u></u></span></b></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">ITS Unix Services Design Lead<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">University of Auckland, New Zealand<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Floor 1, 58 Symonds Street, Auckland<u></u><u></u></span></p><p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#595959">Phone: <a href="tel:%2B64%20%280%299%203737599%20ext%2086487" value="+6493737599" target="_blank">+64 (0)9 3737599 ext 86487</a><u></u><u></u></span></i></p>

<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#595959">DDI: <a href="tel:%2B64%20%280%299%20923%206487" value="+6499236487" target="_blank">+64 (0)9 923 6487</a><u></u><u></u></span></i></p>

<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#595959">Mobile: <a href="tel:%2B64%20%280%2921%20753%20189" value="+6421753189" target="_blank">+64 (0)21 753 189</a><u></u><u></u></span></i></p>

<p class="MsoNormal"><i><span style="font-size:10.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#595959">Email: <a href="mailto:s.shipway@auckland.ac.nz" target="_blank"><span style="color:#595959">s.shipway@auckland.ac.nz</span></a><u></u><u></u></span></i></p>

<p class="MsoNormal"><span style="font-size:18.0pt;font-family:Webdings;color:green" lang="EN-GB">P</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:blue" lang="EN-GB"> </span><span style="font-size:10.0pt;font-family:&quot;Arial Narrow&quot;,&quot;sans-serif&quot;;color:green" lang="EN-GB">Please consider the environment before printing this e-mail</span><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:blue" lang="EN-GB"> : </span><span style="font-size:10.0pt;font-family:&quot;MS Gothic&quot;;color:green" lang="ZH-TW">打印本</span><span style="font-size:10.0pt;font-family:MingLiU;color:green" lang="ZH-TW">邮件,将减少一棵树存活的机会</span><span style="font-size:7.5pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:navy" lang="EN-GB"><u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">

<div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;" lang="EN-US"> rrd-users-bounces+s.shipway=<a href="mailto:auckland.ac.nz@lists.oetiker.ch" target="_blank">auckland.ac.nz@lists.oetiker.ch</a> [mailto:<a href="mailto:rrd-users-bounces%2Bs.shipway" target="_blank">rrd-users-bounces+s.shipway</a>=<a href="mailto:auckland.ac.nz@lists.oetiker.ch" target="_blank">auckland.ac.nz@lists.oetiker.ch</a>] <b>On Behalf Of </b>Stanislav Datskevich<br>

<b>Sent:</b> Wednesday, 6 November 2013 4:34 a.m.<br><b>To:</b> <a href="mailto:rrd-users@lists.oetiker.ch" target="_blank">rrd-users@lists.oetiker.ch</a><br><b>Subject:</b> [rrd-users] Strange behavior of rrdgraph with data summarization from multiple RRDs by CDEF<u></u><u></u></span></p>

</div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Hello, list!<br>I&#39;ve found a strange behavior of rrdgraph when I trying to summarize traffic data from multiple RRDs. I use this CDEF expression to summarize traffic:<br>

CDEF:sum_in=in1,UN,0,in1,IF,in3,UN,0,in3,IF,+,in4,UN,0,in4,IF,+,&lt;others&gt;,8,*<br>CDEF:sum_out=out1,UN,0,out1,IF,out3,UN,0,out3,IF,+,out4,UN,0,out4,IF,+,&lt;others&gt;,8,*<br>Point is to check every variable to &#39;unknown&#39; value and replace it with 0, then sum with previous values, and at last multiple sum by 8 to get bits instead of bytes.<br>

Result is very strange: <a href="http://noc.nek0.net/configs/graph_good.png" target="_blank">http://noc.nek0.net/configs/graph_good.png</a> shows graph on even minutes (i.e. 14:16 ), <a href="http://noc.nek0.net/configs/graph_bad.png" target="_blank">http://noc.nek0.net/configs/graph_bad.png</a> shows graph on odd minutes (14:17). Look at the graph legend: it shows now is 0.00 bps traffic.<br>

<br>Workaround is to not check first variable in CDEF for unknown, like this:<br>CDEF:sum_in=in1,in3,UN,0,in3,IF,+,in4,UN,0,in4,IF,+,&lt;others&gt;,8,*<br>CDEF:sum_out=out1,out3,UN,0,out3,IF,+,out4,UN,0,out4,IF,+,&lt;others&gt;,8,*<br>

With this formula, it will show last value correct regardless of current minute.<br><br>RRDs updates every minute, at first 2-3 seconds of the minute.<br><br>Can somebody explain this please?<br>I will appreciate any help.<br>

My whole rrdgraph expression also is in attach.<u></u><u></u></p></div></div></div></div></div></div></blockquote></div><br></div></div>