Edited Makefile.am and the rrdgraph_*.src files. By mistake the
[rrdtool.git] / doc / rrdgraph.pod
1 =head1 NAME
2
3 =cut
4
5 WARNING: DO NOT EDIT THE POD FILES. THEY ARE AUTO-GENERATED
6
7 =pod
8
9 rrdtool graph - Round Robin Database tool grapher functions
10
11 WARNING: This is for version 1.1.x which is B<I<BETA>> software.
12 The software may contain serious bugs. Some of the items
13 described in here may not yet exist (although this should
14 be mentioned) or still be in the alpha stage.  As with every
15 other RRDtool release: use at your own risk.  In contrast with
16 the stable version of RRDtool, this release may contain bugs
17 known to the authors.  It is highly recommended that you subscribe
18 to the mailing list.
19
20 =head1 SYNOPSYS
21
22 B<rrdtool graph> I<filename>
23 [E<lt>B<L<option|rrdgraph/OPTIONS>>E<gt> ...]
24 E<lt>B<L<data definition|rrdgraph_data/DEF>>E<gt>
25 [E<lt>B<L<data definition|rrdgraph_data/DEF>>E<gt> ...]
26 [E<lt>B<L<data calculation|rrdgraph_data/CDEF>>E<gt> ...]
27 [E<lt>B<L<variable definition|rrdgraph_data/VDEF>>E<gt> ...]
28 [E<lt>B<L<graph element|rrdgraph_graph/GRAPH>>E<gt> ...]
29 [E<lt>B<L<print element|rrdgraph_graph/PRINT>>E<gt> ...]
30
31 =head1 DESCRIPTION
32
33 The B<graph> function of B<RRDtool> is used to represent the
34 data from an B<RRD> to a human viewer.  Its main purpose is to
35 create a nice graphical representation but it can also generate
36 a numerical report.
37
38 =head1 OVERVIEW
39
40 B<rrdtool graph> needs data to work with, use one or more
41 B<L<data definition|rrdgraph_data/DEF>> statements to collect this
42 data.  You are not limited to one database, it's perfectly legal to
43 collect data from two or more databases (one per statement though).
44
45 If you want to display averages, maxima, percentiles etcetera
46 it is best to collect them now using the
47 B<L<variable definition|rrdgraph_data/VDEF>> statement.  At this
48 stage, this command works at the unprocessed data from the B<RRD>.
49 I<(Note: this is not yet true; it works on consolidated information
50 right now)>
51
52 The data fetched from the B<RRA> is then B<consolidated> so that
53 there is exactly one datapoint per pixel in the graph. If you do
54 not take care yourself, B<RRDtool> will expand the range slightly
55 if necessary (in that case the first pixel may very well become
56 unknown!).
57
58 Sometimes data is not exactly as you would like to display it. For
59 instance, you might be collecting B<bytes> per second but want to
60 display B<bits> per second. This is where the
61 B<L<data calculation|rrdgraph_data/CDEF>> command is designed for.
62 After B<consolidating> the data, a copy is made and this copy is
63 modified using a rather flexible B<L<RPN|rrdgraph_rpn/>> command
64 set.  If you use B<L<variable definition|rrdgraph_data/VDEF>>
65 statements after this, they work on the consolidated data and may
66 return other values for maximum, minimum etcetera!
67
68 When you are done fetching and processing the data, it is time to
69 graph it (or print it).  This ends the B<rrdtool graph> sequence.
70
71 =head1 OPTIONS
72
73 It is expected that most options will move to the graph definition
74 statements (after all, most of them do define graph elements...).
75
76 =over 4
77
78 =item filename
79
80 The name and path of the graph to generate. It is recommended to
81 end this in C<.png> or C<.gif> but B<rrdtool> does not enforce this.
82
83 I<filename> can be 'C<->' to send the image to C<stdout>. In
84 that case, no other output is generated.  
85
86 Z<>
87
88 =item Time range
89
90 B<[-s|--start E<lt>timeE<gt>]>
91 B<[-e|--end E<lt>timeE<gt>]>
92 B<[--step E<lt>secondsE<gt>]>
93
94 The start and end of what you would like to display, and which
95 B<RRA> the data should come from.  Defaults are: 1 day ago until
96 now, with the best possible resolution. B<Start> and B<end> can 
97 be specified in several formats, see
98 L<AT-STYLE TIME SPECIFICATION|rrdfetch/> and L<rrdgraph_examples>.
99 By default, B<rrdtool graph> calculates the width of one pixel in
100 the time domain and tries to get data from an B<RRA> with that
101 resolution.  With the B<step> option you can alter this behaviour.
102 If you want B<rrdtool graph> to get data at a one-hour resolution
103 from the B<RRD>, set B<step> to 3600.  Note: a step smaller than
104 one pixel will silently be ignored.
105
106 Z<>
107
108 =item Labels
109
110 B<[-t|--title E<lt>stringE<gt>]>
111 B<[-v|--vertical-label E<lt>stringE<gt>]>
112
113 A horizontal string at the top of the graph and/or a vertically
114 placed string at the left hand side of the graph. I<New: (not
115 yet implemented)> The string can contain formatter options that
116 are used to include variables (from B<VDEF>s) and newlines.
117
118 Z<>
119
120 =item Size
121
122 B<[-w|--width E<lt>pixelsE<gt>]>
123 B<[-h|--heigth E<lt>pixelsE<gt>]>
124
125 The width and height of the B<canvas> (the part of the graph with
126 the actual lines and such). Defaults are 400 pixels by 100 pixels.
127
128 Z<>
129
130 =item Limits
131
132 I<Old behaviour, until the new options are implemented>
133 B<[-u|--upper-limit E<lt>valueE<gt>]>
134 B<[-l|--lower-limit E<lt>valueE<gt>]>
135 B<[-r|--rigid]>
136
137 By default the graph will be autoscaling so that it displays the
138 portion of the y-axis that is actually used. You can change this
139 behaviour by setting the limits.  The displayed y-axis will show
140 at least from B<lower-limit> to B<upper-limit>.  Autoscaling will
141 still permit those boundaries to be stretched unless the B<rigid>
142 option is set.
143
144 I<New behaviour, after the new options are implemented>
145 B<[--maximum-upper-limit E<lt>valueE<gt>]>
146 B<[--minimum-upper-limit E<lt>valueE<gt>]>
147 B<[--maximum-lower-limit E<lt>valueE<gt>]>
148 B<[--minimum-lower-limit E<lt>valueE<gt>]>
149
150 By default the graph will be autoscaling so that it displays the
151 portion of the y-axis that is actually used. You can change this
152 behaviour by setting the limits.  The displayed y-axis will show
153 at most B<maximum-upper-limit> and at least B<minimum-upper-limit>
154 at the top, and similarily at least B<maximum-lower-limit> and
155 at most B<minimum-lower-limit> at the bottom.  The default is to
156 display at most B<infinity> (so: no limit) and at least
157 B<negative infinity> (no minimal value) at the top. The bottom of
158 the graph has similar defaults. Note that the minimum lower limit
159 is the lowest one so you should compare this with maximum upper
160 limit when you try to figure out what you should set.
161
162 To make sure the graph shows the range of I<-1000> to I<2000>,
163 optionally expanding to no more than I<-3000> to I<4000>,
164 set the following options:
165
166 --maximum-upper-limit 4000 --minimum-upper-limit 2000
167 --maximum-lower-limit -1000 --minimum-lower-limit -3000
168
169 To mimic the old B<rigid> option, you can do:
170
171 --maximum-upper-limit 4000 --minimum-upper-limit 4000
172 --maximum-lower-limit -3000 --minimum-lower-limit -3000
173
174 B<[--alt-autoscale]>
175
176 Sometimes the default algorithm for selecting the y-axis scale is not
177 performing very well.  Normally the scale is selected from a predefined
178 set of ranges and this fails miserably when you need to graph something
179 like C<260 + 0.001 * sin(x)>. This option calculates the minimum and
180 maximum y-axis from the actual minimum and maximum values. Our example
181 would display slightly less than C<260-0.001> to slightly more than
182 C<260+0.001> (Contributed by Sasha Mikheev).
183
184 B<[--alt-autoscale-max]>
185
186 Where C<--alt-autoscale> will modify both the absolute maximum AND minimum
187 values, this option will only affect the maximum value. The minimum
188 value, if not defined on the command line, will be 0. This option can
189 be useful when graphing router traffic when the WAN line uses compression,
190 and thus the throughput may be higher than the WAN line speed.
191
192 Z<>
193
194 =item Grid
195
196 =over 4
197
198 =item X-Axis
199
200 B<[-x|--x-grid E<lt>I<GTMC<:>GSTC<:>MTMC<:>MSTC<:>LTMC<:>LSTC<:>LPRC<:>LFM>E<gt>|C<none>]>
201
202 The x-axis label is quite complex to configure, if you don't have
203 very special needs it is probably best to rely on the autoconfiguration
204 to get this right.  You can specify the string C<none> to skip the grid
205 and labels altogether.
206
207 The grid is defined by specifying a certain amount of time in the I<?TM>
208 positions. You can choose from C<SECOND>, C<MINUTE>, C<HOUR>, C<DAY>,
209 C<WEEK>, C<MONTH> or C<YEAR>. Then you define how many of these should
210 pass between each line or label.  This pair (I<?TM:?ST>) needs to be
211 specified for the base grid (I<G??>), the major grid (I<M??>) and the
212 labels (I<L??>). For the labels you also need to define a precision
213 in I<LPR> and a I<strftime> format string in I<LFM>.  I<LPR> defines
214 where each label will be placed. If it is zero, the label will be
215 placed right under the corresponding line (useful for hours, dates
216 etcetera).  If you specify a number of seconds here the label is
217 centered in this interval (useful for monday, januari etcetera).
218
219 Example: C<--x-grid MINUTE:10:HOUR:1:HOUR:4:0:%X>
220
221 This places grid lines every 10 minutes, major grid lines every hour
222 and labels every 4 hours. The labels are placed under the major grid
223 lines as they specify exactly that time.
224
225 Example: C<--x-grid HOUR:8:DAY:1:DAY:1:0:%A>
226
227 This places grid lines every 8 hours, major grid lines and labels
228 each day. The labels are placed exactly between two major grid lines
229 as they specify the complete day and not just midnight.
230
231 Z<>
232
233 =item Y-Axis
234
235 B<[-y|--y-grid I<E<lt>grid stepE<gt>:E<lt>label factorE<gt>>|C<none>]>
236
237 Y-axis grid lines appear at each I<grid step> interval.  Labels are
238 placed every I<label factor> lines.  You can specify C<-y none> to
239 skip the grid and labels altogether.  The default for this option is
240 to automatically select sensible values.
241
242 B<[--alt-y-grid]>
243
244 Place Y grid dynamically based on graph Y range. Algorithm ensures
245 that you always have grid, that there are enough but not too many
246 grid lines and the grid is metric. That is grid lines are placed
247 every 1, 2, 5 or 10 units.  (contributed by Sasha Mikheev)
248
249 B<[-o|--logarithmic]>
250
251 Logarithmic y-axis scaling.
252
253 B<[--units-exponent E<lt>valueE<gt>]>
254
255 This sets the 10**exponent scaling of the y-axis values.  Normally
256 values will be scaled to the appropriate units (k, M, etc.).  However
257 you may wish to display units always in k (Kilo, 10e3) even if the data
258 is in the M (Mega, 10e6) range for instance.  Value should be an
259 integer which is a multiple of 3 between -18 and 18 inclusive.  It is
260 the exponent on the units you which to use.  For example, use 3 to
261 display the y-axis values in k (Kilo, 10e3, thousands), use -6 to
262 display the y-axis values in u (Micro, 10e-6, millionths).  Use a value
263 of 0 to prevent any scaling of the y-axis values.
264
265 Z<>
266
267 =back
268
269 Z<>
270
271 =item Miscellaneous
272
273 B<[-z|--lazy]>
274
275 Only generate the graph, if the current graph is out of date or not
276 existent.
277
278 B<[-f|--imginfo E<lt>printfstrE<gt>]>
279
280 After the image has been created, the graph function uses printf
281 together with this format string to create output similar to the PRINT
282 function, only that the printf is supplied with the parameters
283 I<filename>, I<xsize> and I<ysize>. In order to generate an B<IMG> tag
284 suitable for including the graph into a web page, the command line
285 would look like this:
286
287     --imginfo '<IMG SRC="/img/%s" WIDTH="%lu" HEIGHT="%lu" ALT="Demo">'
288
289 B<[-c|--color I<COLORTAG#rrggbb>]>
290
291 Override the default colors for the standard elements of the graph.
292 The I<COLORTAG> is one of C<BACK> ground, C<CANVAS>, C<SHADEA> for the
293 left and top border, C<SHADEB> for the right and bottom border, C<GRID>,
294 C<MGRID> for the major grid, C<FONT>, C<FRAME> and axis, C<ARROW>.
295 Each color is composed out of three hexadecimal numbers specifying
296 its color component (00 is off, FF is maximum) of red, green and blue.
297 You may set this option several times to alter multiple defaults.
298
299 A green arrow is made by: C<--color ARROW:00FF00>
300
301 B<[-a|--imgformat C<GIF>|C<PNG>]>
302 B<[-i|--interlaced]>
303
304 The default is to generate a non-interlaced GIF image. It is recommended
305 to generate PNG graphics as they take up to 40% less disk space and
306 20-30% less time to generate.
307
308 B<[-g|--no-legend]>
309
310 Suppress generation of legend; only render the graph.
311
312 B<[-b|--base E<lt>valueE<gt>]>
313
314 If you are graphing memory (and NOT network traffic) this switch
315 should be set to 1024 so that one Kb is 1024 byte. For traffic
316 measurement, 1 kb/s is 1000 b/s.
317
318 Z<>
319
320 =item Data and variables
321
322 B<DEF:>I<E<lt>vnameE<gt>>=I<E<lt>rrdfileE<gt>>:I<E<lt>ds-nameE<gt>>:I<E<lt>CFE<gt>>[:[I<E<lt>time rangeE<gt>>][:I<E<lt>step timeE<gt>>]]
323
324 B<CDEF:>I<E<lt>vnameE<gt>>=I<E<lt>RPN expressionE<gt>>
325
326 B<VDEF:>I<E<lt>vnameE<gt>>=I<E<lt>RPN expressionE<gt>>
327
328 You need at least one B<DEF> statement to generate anything. The
329 other statements are useful but optional.
330 See L<rrdgraph_data> and L<rrdgraph_rpn> for exact format.
331
332 Z<>
333
334 =item Graph and print elements
335
336 You need at least one graph element to generate an image and/or
337 at least one print statement to generate a report.
338 See L<rrdgraph_graph> for exact format.
339
340 =back
341
342 =head1 SEE ALSO
343
344 L<rrdgraph> gives an overview of how B<rrdtool graph> works.
345 L<rrdgraph_data> describes B<DEF>,B<CDEF> and B<VDEF> in detail,
346 L<rrdgraph_rpn> describes the B<RPN> language used in the B<?DEF> statements,
347 L<rrdgraph_graph> page describes all of the graph and print functions.
348
349 Make sure to read L<rrdgraph_examples> for tipsE<amp>tricks.
350
351 =head1 AUTHOR
352
353 Program by Tobias Oetiker E<lt>oetiker@ee.ethz.chE<gt>
354
355 This manual page by Alex van den Bogaerdt E<lt>alex@ergens.op.het.netE<gt>