[rrd-users] LAST always returning zero

Wes wespvp at msg.bt.com
Sat Mar 8 01:38:53 CET 2008


I thought it was working with the last changes suggested by Alex, but still
not quite there.

The first problem is that if "last / 10 * 10" returns *720, the graph/fetch
tool returns me through *730 instead of *720.  See the first rrdfetch below
- I still get a nan.

No problem - I'll just subtract a couple of seconds.  Now I get exactly the
data I'm after.  However, GPRINT still randomly prints 0 instead of 1.

In the data below, examples 2 and 5 print the correct value of 1 for queue
2.  The queue2_enabled is inverted from a 0 to a 1 and GPRINT prints it
correctly.  In examples 3 and 4, the data is identical, but GPRINT prints a
0 instead of a 1.

The graph looks perfect.  It is just the GPRINT that is randomly wrong.  Any
other ideas?

Wes


The command, keeping only the first two queues:

> /usr/local/rrdtool/bin/rrdtool graph /docs/enabled.png -a PNG -l 0 -t
> "Disabled Queues (mmp11es)" \
> DEF:queue1=/var/log/test.rrd:queue1_enabled:AVERAGE \
> DEF:queue2=/var/log/test.rrd:queue2_enabled:AVERAGE \
> CDEF:queue1N=queue1,UN,1,queue1,IF,0,GT,0,1,IF \
> VDEF:queue1L=queue1N,LAST \
> CDEF:queue2N=queue2,UN,1,queue2,IF,0,GT,0,1,IF \
> VDEF:queue2L=queue2N,LAST \
> AREA:queue1N#00FF00:"MTA-SunSecure-In-Polic" \
> GPRINT:queue1L:'%1.0lf' \
> AREA:queue2N#0000FF:"MTA-SunSecure-In-sendm":STACK \
> GPRINT:queue2L:'%1.0lf' \
> GPRINT:queue9L:'%1.0lf' \
> --upper-limit 10 --vertical-label "xDisabled Queue Count" -w 400 -h 100 -s
> "now-2h" -e "1204935598"
> 
'end' is defined as:  ³int (`$RRDTOOL last $rrdFile`  / 10) * 10²


Sample rrdfetch and debug output.  Rrdfetch is using the same --end
rrdgraph.


In this one, GPRINT prints 0 instead of the correct 1.

  --end specifies 720, but rrdfetch returns through 730.  0 expected.


rrdtool last: 1204934725
rounded end=1204934720
                   queue1_depth        queue1_added      queue1_removed
queue1_enabled        queue2_depth        queue2_added      queue2_removed
queue2_enabled 
1204934700: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00
1204934710: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00
1204934720: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00
1204934730: nan nan nan nan nan nan nan nan


'end' is defined as:  ³int (`$RRDTOOL last $rrdFile`  / 10) * 10 ­ 2².  Now
it returns the correct data.

Returns 1:

rrdtool last: 1204934846
rounded end=1204934838
                   queue1_depth        queue1_added      queue1_removed
queue1_enabled        queue2_depth        queue2_added      queue2_removed
queue2_enabled

1204934820: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934830: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934840: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 


Same data, but GPRINT displays Œ0¹.

rrdtool last: 1204934876
rounded end=1204934868
                   queue1_depth        queue1_added      queue1_removed
queue1_enabled        queue2_depth        queue2_added      queue2_removed
queue2_enabled
                   
1204934850: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934860: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934870: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 


Another 0 from GPRINT:

rrdtool last: 1204934996
rounded end=1204934988
                   queue1_depth        queue1_added      queue1_removed
queue1_enabled        queue2_depth        queue2_added      queue2_removed
queue2_enabled
                   
1204934960: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934970: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934980: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 
1204934990: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00 


This time GPRINT correctly displays 1:

rrdtool last: 1204935107
rounded end=1204935098
                   queue1_depth        queue1_added      queue1_removed
queue1_enabled        queue2_depth        queue2_added      queue2_removed
queue2_enabled
                   
1204935080: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00
1204935090: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00
1204935100: 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
1.0000000000e+00 0.0000000000e+00 0.0000000000e+00 0.0000000000e+00
0.0000000000e+00

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20080307/b723190e/attachment.html 


More information about the rrd-users mailing list