fixed format
[rrdtool.git] / doc / rrdgraph_data.src
1 =head1 NAME
2
3 =cut
4
5 WARNING: DO NOT EDIT THE POD FILES. THEY ARE AUTO-GENERATED
6
7 =pod
8
9 rrdgraph_data - preparing data for graphing in rrdtool graph
10
11 =head1 SYNOPSIS
12
13 B<DEF:>I<E<lt>vnameE<gt>>=I<E<lt>rrdfileE<gt>>:I<E<lt>ds-nameE<gt>>:I<E<lt>CFE<gt>>[:step=I<E<lt>stepE<gt>>][:start=I<E<lt>timeE<gt>>][:end=I<E<lt>timeE<gt>>][:reduce=I<E<lt>B<CF>E<gt>>]
14
15 B<VDEF>:I<vname>=I<RPN expression>
16
17 B<CDEF>:I<vname>=I<RPN expression>
18
19 =head1 DESCRIPTION
20
21 These three instructions collect the data out of the B<RRD> files,
22 optionally altering it (think of a bytes to bits conversion) and
23 if desired you can define variables containing useful information
24 such as maximum, minimum etcetera. Two of the instructions use
25 a language called B<RPN> which is described in its own manual page.
26
27 =head1 DEF
28
29 B<DEF:>I<E<lt>vnameE<gt>>=I<E<lt>rrdfileE<gt>>:I<E<lt>ds-nameE<gt>>:I<E<lt>CFE<gt>>[:step=I<E<lt>stepE<gt>>][:start=I<E<lt>timeE<gt>>][:end=I<E<lt>timeE<gt>>][:reduce=I<E<lt>B<CF>E<gt>>]
30
31 This command fetches data from an B<RRD> file.  The virtual name
32 I<vname> can then be used throughout the rest of the script. By
33 default, an B<RRA> which contains the correct consolidated data
34 at an appropriate resolution will be chosen.  The resolution can
35 be overridden with the L<--step|rrdgraph/item_Time> option. 
36 The resolution can again be overridden by specifying the B<step size>.
37 The time span of this data is the same as for the graph by default,
38 you can override this by specifying B<start and end>.  Remember to
39 escape colons in the time specification!
40
41 If the resolution of the data is higher than the resolution of off
42 graph, the data will be further consolidated.  This may result in
43 a graph that spans slightly more time than requested.
44 Ideally each point in the graph should correspond with one B<CDP>
45 from an B<RRA>.  For instance, if your B<RRD> has an B<RRA> with
46 a resolution of 1800 seconds per B<CDP>, you should create an
47 image with width 400 and time span 400*1800 seconds (use appropriate
48 start and end times, such as C<--start end-8days8hours>).
49
50 If consolidation needs to be done, the B<CF> of the B<RRA> specified in the
51 B<DEF> itself will be used to reduce the data density.  This behaviour can
52 be changed using C<:reduce=I<E<lt>B<CF>E<gt>>>.  This optional parameter
53 specifies the B<CF> to use during the data reduction phase.
54
55 Example:
56
57         DEF:ds0=router.rrd:ds0:AVERAGE
58         DEF:ds0weekly=router.rrd:ds0:AVERAGE:step=7200
59         DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=end-1h
60         DEF:ds0weekly=router.rrd:ds0:AVERAGE:start=11\:00:end=start+1h
61
62 =head1 VDEF
63
64 B<VDEF>:I<vname>=I<RPN expression>
65
66 This command returns a value and/or a time according to the B<RPN>
67 statements used. The resulting I<vname> will, depending on the
68 functions used, have a value and a time component.  When you use
69 this I<vname> in another B<RPN> expression, you are effectively
70 inserting its value just as if you had put a number at that place.
71 The variable can also be used in the various graph and print
72 elements.
73
74 Example: C<VDEF:avg=mydata,AVERAGE>
75
76 =head1 CDEF
77
78 B<CDEF>:I<vname>=I<RPN expression>
79
80 This command creates a new set of data points (in memory only, not
81 in the B<RRD> file) out of one or more other data series. The B<RPN>
82 instructions are used to evaluate a mathematical function on each
83 data point. The resulting I<vname> can then be used further on in
84 the script, just as if it were generated by a B<DEF> instruction.
85
86 Example: C<CDEF:mydatabits=mydata,8,*>
87
88 =include see_also