Hi Matthew, there is a 'bug' in rrdtool graph, where it fetches one 'step' more data than is visible in the graph. This data is often 'nan'.
The LAST vdef shows you the last non NAN value. In normal operation this works fine, but if you first convert all NAN values to 0, LAST will show you zero since the last fetched value which was NAN was turned into zero. anyway, I have fixed this problem in svn, in the next release of 1.2.x as well as 1.3.0 it is fixed, so that even when you turn nan to zero, you will get the last value visible on the graph. see http://oss.oetiker.ch/rrdtool-trac/changeset/1386 cheers tobi Today Matthew M. Boedicker wrote: > I have a DS x. I create a CDEF xz that is x with all NaN converted to 0. When > I use a VDEF to print the LAST of x it looks ok, but the LAST of xz is always > 0. If I graph a line of xz it looks fine. Does anyone know why this is > always 0 or another way I can do this that will work? > > rrdtool create test.rrd \ > --start 1212566513 \ > --step 3600 \ > DS:x:GAUGE:7200:U:U \ > RRA:AVERAGE:0.5:1:720 > > rrdtool update test.rrd \ > 1212570113:100 \ > 1212573713:50 \ > 1212577313:25 \ > 1212580913:75 > > rrdtool graph test.png \ > --start 1212566513 \ > DEF:x=test.rrd:x:AVERAGE \ > CDEF:xz=x,UN,0,x,IF \ > VDEF:xlast=x,LAST GPRINT:xlast:%lf \ > VDEF:xzlast=xz,LAST GPRINT:xzlast:%lf > > _______________________________________________ > rrd-users mailing list > [email protected] > https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users > > -- Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten http://it.oetiker.ch [EMAIL PROTECTED] ++41 62 213 9902 _______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
