[rrd-users] extracting tabular data with rrdgraph

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Fri Dec 3 04:00:53 CET 2010


> On Thu, Dec 2, 2010 at 11:34 AM, Simon Hobson
> <linux at thehobsons.co.uk>wrote:
>
>> AFAIK you are supposed to be able to use PRINT statements and have
>> the results output as text rather than generating a graph. I've never
>> tried with with a CDEF though (as opposed to printing a single value
>> VDEF) so I don't know if that works.

(G)PRINT prints a single value. The difference between GPRINT and PRINT is
that the first one prints it in a graph, the latter prints it on stdout.

> Regarding this, there is a contradiction in the documentation.  The man
> page
> for rrdgraph_graph shows the "new" form of PRINT as
> PRINT:vname:format[:strftime], and immediately after, it says "It is an
> error to specify a vname generated by a DEF or CDEF."  But then it goes on
> to list the other (deprecated) form, and then says "The first form of this
> command is to be used with CDEF vnames."

It seems to be some remainder of an older form of the documentation.
Still, "the first form" does not refer to another section.

A few paragraphs further it is corrected, so maybe this is just an oversight.

> Regardless, I have not found any way to specify the "new" PRINT form that
> the command line parser likes.  For example, if I use:
>
> $ rrdtool graph /tmp/graphout DEF:du=diskutil-sda.rrd:percent:AVERAGE
> CDEF:foo=du PRINT:foo:%lf --start end-30min
>
> Then I get:
> ERROR: Cannot parse CF in 'PRINT:foo:%lf'
>
> However, the new form of PRINT is not supposed to contain a CF.

I think you try to use PRINT to print an array of values. That does not
work. PRINT (and GPRINT) prints one value.

If you start with data from a DEF or a CDEF, RRDtool needs to consolidate
the values in that data into one value. Thus it needs a Consolidation
Function, thus it is looking for one, thus it expects the old version of
(G)PRINT.

If you try to print data from a VDEF, you have one value to print, and
need no CF, thus RRDtool is not looking for one, thus it expects the new
version of (G)PRINT.

HTH
Alex



More information about the rrd-users mailing list