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

Steve Shipway s.shipway at auckland.ac.nz
Wed Nov 6 03:58:05 CET 2013


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

DDI: +64 (0)9 923 6487

Mobile: +64 (0)21 753 189

Email:  <mailto: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/1b5eded5/attachment-0001.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5900 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/rrd-users/attachments/20131106/1b5eded5/attachment-0001.bin 


More information about the rrd-users mailing list