[rrd-users] Concatenated VDEF and CDEF commands in a rrdtool graph cmd
Rob Newman
rlnewman at ucsd.edu
Thu Nov 11 05:11:13 CET 2010
Hi Steve and Tobi,
Thanks so much for the insight and RRD-kungfu. That worked.
Owe you all one.
- Rob
On Nov 10, 2010, at 6:17 PM, Tobias Oetiker wrote:
> Today Steve Shipway wrote:
>
>> Have you tried this:
>>
>> CDEF:dtmaxdiff=dt,POP,dtfoo,16,-
>>
>> This uses a DEF variable (dt) although it is removed by the POP
>> to trick the CDEF into having at least one dataset variable (dt)
>> to base the new sequence off of. I'm still not sure if RRDTool
>> lets you use the VDEF value as a constant, though... I suspect
>> not but havent tried it in the latest version of RRDTool
>
> this will work
> tobi
>
>>
>> Steve
>> Steve Shipway
>> University of Auckland ITS
>> UNIX Systems Design Lead
>> s.shipway at auckland.ac.nz<mailto:s.shipway at auckland.ac.nz>
>> Ph: +64 9 373 7599 ext 86487
>>
>> ________________________________
>> From: rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch [rrd-users-bounces+s.shipway=auckland.ac.nz at lists.oetiker.ch] on behalf of Rob Newman [rlnewman at ucsd.edu]
>> Sent: Thursday, 11 November 2010 2:03 p.m.
>> To: rrd-users at lists.oetiker.ch
>> 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
>>
>
> --
> Tobi Oetiker, OETIKER+PARTNER AG, Aarweg 15 CH-4600 Olten, Switzerland
> http://it.oetiker.ch tobi at oetiker.ch ++41 62 775 9902 / sb: -9900
________________________________________________________
Rob Newman Ph.D.
Institute of Geophysics and Planetary Physics
Scripps Institution of Oceanography
University of California, San Diego
9500 Gilman Drive, La Jolla, CA 92093-0225, USA
More information about the rrd-users
mailing list