[rrd-users] Strange behavior of rrdgraph with data summarization from multiple RRDs by CDEF

Stanislav Datskevich sdatskevich at gmail.com
Wed Nov 6 10:12:18 CET 2013


Hi Steve.
Thanks a lot for the ADDNAN hint.
I changed summarization formula to:
CDEF:sum_in=in1,in3,ADDNAN,in4,ADDNAN,in5,ADDNAN,......
CDEF:sum_out=out1,out3,ADDNAN,out4,ADDNAN,out5,ADDNAN,......

Now it works great.



2013/11/6 Steve Shipway <s.shipway at auckland.ac.nz>

> Looks like a race condition with regard to ‘Current’ value.
>
>
>
> 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
>
>
>
> 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.
>
>
>
> 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.
>
>
>
> The way around it is to cheat J.  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.
>
>
>
> 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”
>
>
>
> This says “If this data point is <5min old, and is unknown, then take the
> previous value, else take the current value”
>
>
>
> 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.
>
>
>
> Steve
>
>
> ------------------------------
>
> *Steve Shipway*
>
> ITS Unix Services Design Lead
>
> University of Auckland, New Zealand
>
> Floor 1, 58 Symonds Street, Auckland
>
> *Phone: +64 (0)9 3737599 ext 86487
> <%2B64%20%280%299%203737599%20ext%2086487>*
>
> *DDI: +64 (0)9 923 6487 <%2B64%20%280%299%20923%206487>*
>
> *Mobile: +64 (0)21 753 189 <%2B64%20%280%2921%20753%20189>*
>
> *Email: s.shipway at auckland.ac.nz <s.shipway at auckland.ac.nz>*
>
> P Please consider the environment before printing this e-mail : 打印本
> 邮件,将减少一棵树存活的机会
>
>
>
> *From:* rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch[mailto:
> rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] *On Behalf
> Of *Stanislav Datskevich
> *Sent:* Wednesday, 6 November 2013 4:34 a.m.
> *To:* rrd-users at lists.oetiker.ch
> *Subject:* [rrd-users] Strange behavior of rrdgraph with data
> summarization from multiple RRDs by CDEF
>
>
>
> Hello, list!
> I'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:
>
> CDEF:sum_in=in1,UN,0,in1,IF,in3,UN,0,in3,IF,+,in4,UN,0,in4,IF,+,<others>,8,*
>
> CDEF:sum_out=out1,UN,0,out1,IF,out3,UN,0,out3,IF,+,out4,UN,0,out4,IF,+,<others>,8,*
> Point is to check every variable to 'unknown' value and replace it with 0,
> then sum with previous values, and at last multiple sum by 8 to get bits
> instead of bytes.
> Result is very strange: http://noc.nek0.net/configs/graph_good.png shows
> graph on even minutes (i.e. 14:16 ),
> http://noc.nek0.net/configs/graph_bad.png shows graph on odd minutes
> (14:17). Look at the graph legend: it shows now is 0.00 bps traffic.
>
> Workaround is to not check first variable in CDEF for unknown, like this:
> CDEF:sum_in=in1,in3,UN,0,in3,IF,+,in4,UN,0,in4,IF,+,<others>,8,*
> CDEF:sum_out=out1,out3,UN,0,out3,IF,+,out4,UN,0,out4,IF,+,<others>,8,*
> With this formula, it will show last value correct regardless of current
> minute.
>
> RRDs updates every minute, at first 2-3 seconds of the minute.
>
> Can somebody explain this please?
> I will appreciate any help.
> My whole rrdgraph expression also is in attach.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20131106/3e63fce3/attachment.htm 


More information about the rrd-users mailing list