[rrd-users] Using RPN variables in the RRD graph title label: simple yes or no answer

Rob Newman rlnewman at ucsd.edu
Fri Nov 12 23:47:31 CET 2010

Hi RRD gurus,

In an earlier email to the users group a couple days ago I was asking about CDEF and VDEF variables. Is it possible to take one of these values and use it in the graph's title or GPRINT label?

For example, I use VDEF to create a variable dtfoo:


Is it possible to substitute this value into the graphs title label thus:

rrdtool graph /path/to/outputimage/rrd.png \
    --interlaced --imgformat PNG --end 1289434618 --start 1286756217 \
    --width 600 --height 200 \
    DEF:dt=/path/to/dt.rrd:dt:AVERAGE \
    VDEF:dtfoo=dt,MAXIMUM \
    CDEF:dtmaxdiff=dt,POP,dtfoo,16,- \
    LINE1:dtmaxdiff#990000:'TESTFOO' \
    GPRINT:dt:LAST:'Latest value for TESTFOO\: %4.0lf%s\j' \
    --title 'Max value for graph is: dtfoo'

Obviously my pseudocode will fail and just output the string 'dtfoo', but can I substitute it in somehow? My users need to know the max value that is being used to calibrate all the other values in the graph.

Alternatively can I concatenate the GPRINT variable substitution? Something like (here I have used a comma as the variable splitter):

    GPRINT:dt,dtfoo:LAST:'Latest value for TESTFOO\: %4.0lf%s from a maximum of %4.0lf%s\j'

A simple 'yes, here is the documentation' or 'nope, you are crazy' answer is fine.

Thanks in advance and have a great weekend all!
- Rob Newman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20101112/d40f57b5/attachment.htm 

More information about the rrd-users mailing list