1RRDGRAPH_DATA(1)                    rrdtool                   RRDGRAPH_DATA(1)
2
3
4

NAME

6       rrdgraph_data - preparing data for graphing in rrdtool graph
7

SYNOPSIS

9       DEF:<vname>=<rrdfile>:<ds-
10       name>:<CF>[:step=<step>][:start=<time>][:end=<time>][:reduce=<CF>]
11
12       VDEF:vname=RPN expression
13
14       CDEF:vname=RPN expression
15

DESCRIPTION

17       These three instructions extract data values out of the RRD files,
18       optionally altering them (think, for example, of a bytes to bits con‐
19       version). If so desired, you can also define variables containing use‐
20       ful information such as maximum, minimum etcetera. Two of the instruc‐
21       tions use a language called RPN which is described in its own manual
22       page.
23
24       Variable names (vname) must be made up strings of the following charac‐
25       ters "A-Z, a-z, 0-9, -,_" and a maximum length of 255 characters.
26
27       When picking variable names, make sure you do not choose a name that is
28       already taken by an RPN operator. A save bet it to use lowercase or
29       mixedcase names for variables since operators will always be in upper‐
30       case.
31

DEF

33       DEF:<vname>=<rrdfile>:<ds-
34       name>:<CF>[:step=<step>][:start=<time>][:end=<time>][:reduce=<CF>]
35
36       This command fetches data from an RRD file.  The virtual name vname can
37       then be used throughout the rest of the script. By default, an RRA
38       which contains the correct consolidated data at an appropriate resolu‐
39       tion will be chosen.  The resolution can be overridden with the --step
40       option.  The resolution can again be overridden by specifying the step
41       size.  The time span of this data is the same as for the graph by
42       default, you can override this by specifying start and end.  Remember
43       to escape colons in the time specification!
44
45       If the resolution of the data is higher than the resolution of the
46       graph, the data will be further consolidated. This may result in a
47       graph that spans slightly more time than requested.  Ideally each point
48       in the graph should correspond with one CDP from an RRA.  For instance,
49       if your RRD has an RRA with a resolution of 1800 seconds per CDP, you
50       should create an image with width 400 and time span 400*1800 seconds
51       (use appropriate start and end times, such as "--start
52       end-8days8hours").
53
54       If consolidation needs to be done, the CF of the RRA specified in the
55       DEF itself will be used to reduce the data density. This behaviour can
56       be changed using ":reduce=<CF>".  This optional parameter specifies the
57       CF to use during the data reduction phase.
58
59       Example:
60
61               DEF:ds0=router.rrd:ds0:AVERAGE
62               DEF:ds0weekly=router.rrd:ds0:AVERAGE:step=7200
63               DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=end-1h
64               DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=11\:00:end=start+1h
65

VDEF

67       VDEF:vname=RPN expression
68
69       This command returns a value and/or a time according to the RPN state‐
70       ments used. The resulting vname will, depending on the functions used,
71       have a value and a time component.  When you use this vname in another
72       RPN expression, you are effectively inserting its value just as if you
73       had put a number at that place.  The variable can also be used in the
74       various graph and print elements.
75
76       Example: "VDEF:avg=mydata,AVERAGE"
77
78       Note that currently only agregation functions work in VDEF rpn expres‐
79       sions.  Patches to change this are welcome.
80

CDEF

82       CDEF:vname=RPN expression
83
84       This command creates a new set of data points (in memory only, not in
85       the RRD file) out of one or more other data series. The RPN instruc‐
86       tions are used to evaluate a mathematical function on each data point.
87       The resulting vname can then be used further on in the script, just as
88       if it were generated by a DEF instruction.
89
90       Example: "CDEF:mydatabits=mydata,8,*"
91

SEE ALSO

93       rrdgraph gives an overview of how rrdtool graph works.  rrdgraph_data
94       describes DEF,CDEF and VDEF in detail.  rrdgraph_rpn describes the RPN
95       language used in the ?DEF statements.  rrdgraph_graph page describes
96       all of the graph and print functions.
97
98       Make sure to read rrdgraph_examples for tips&tricks.
99

AUTHOR

101       Program by Tobias Oetiker <tobi@oetiker.ch>
102
103       This manual page by Alex van den Bogaerdt <alex@ergens.op.het.net>
104
105
106
1071.2.27                            2008-02-17                  RRDGRAPH_DATA(1)
Impressum