I may be wrong, but I don't believe that you can have a CDEF refer to a VDEF -- only to a DEF or a CDEF. A VDEF can be defined over a DEF or a CDEF but with no complex calculations. This is because a VDEF is a single value (possibly with a time) but a CDEF (like a DEF) is a full set of data over the time interval.
Steve Steve Shipway University of Auckland ITS UNIX Systems Design Lead [email protected]<mailto:[email protected]> Ph: +64 9 373 7599 ext 86487 ________________________________ From: [email protected] [[email protected]] on behalf of Rob Newman [[email protected]] Sent: Thursday, 11 November 2010 2:03 p.m. To: [email protected] Subject: [rrd-users] Concatenated VDEF and CDEF commands in a rrdtool graph cmd Hi there, Does anyone know why this fails: rrdtool graph /path/to/outputimage/rrd.png \ --interlaced --imgformat PNG --end 1289434618 --start 1286756217 \ --width 600 --height 200 --title 'TEST' \ DEF:dt=/path/to/dt.rrd:dt:AVERAGE \ VDEF:dtfoo=dt,MAXIMUM \ CDEF:dtmaxdiff=dtfoo,16,- \ LINE1:dtmaxdiff#990000:'TESTFOO' \ GPRINT:dt:LAST:'Latest value for TESTFOO\: %4.0lf%s\j' The output I get from rrdtool is: ERROR: rpn expressions without DEF or CDEF variables are not supported If I try and add backslashes to the path (a la http://www.mrtg.org/rrdtool/doc/rrdgraph_rpn.en.html, note between the VDEF and CDEF rpn command there is not a carriage return anymore, just whitespace and a backslash): rrdtool graph /path/to/outputimage/rrd.png \ --interlaced --imgformat PNG --end 1289434618 --start 1286756217 \ --width 600 --height 200 --title 'TEST' \ DEF:dt=/path/to/dt.rrd:dt:AVERAGE \ VDEF:dtfoo=dt,MAXIMUM \ CDEF:dtmaxdiff=dtfoo,16,- \ LINE1:dtmaxdiff#990000:'TESTFOO' \ GPRINT:dt:LAST:'Latest value for TESTFOO\: %4.0lf%s\j' I now get the output: ERROR: Could not make sense out of ' CDEF:dtmaxdiff=dtfoo,16,-' What I want is to find the maximum value for the data set ('dtfoo = dt,MAXIMUM'), then take that value and subtract 16 from it (dtmaxdiff = dtfoo,16,-), then plot that value. Any ideas why both of these fail? Thanks in advance, - Rob
_______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
