3 rrdgraph_examples - Examples for rrdtool graph
7 B<rrdtool graph /home/httpd/html/test.png --img-format PNG \>
9 followed by any of the examples below
13 For your convenience some of the commands are explained here
14 by using detailed examples. They are not always cut-and-paste
15 ready because comments are intermixed with the examples.
19 =head2 Data with multiple resolutions
21 --end now --start end-120000s --width 400
22 DEF:ds0a=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
23 DEF:ds0b=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=1800
24 DEF:ds0c=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=7200
25 LINE1:ds0a#0000FF:"default resolution\n"
26 LINE1:ds0b#00CCFF:"resolution 1800 seconds per interval\n"
27 LINE1:ds0c#FF00FF:"resolution 7200 seconds per interval\n"
29 =head2 Nicely formatted legend section
31 DEF:ds0=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
32 DEF:ds1=/home/rrdtool/data/router1.rrd:ds1:AVERAGE
33 VDEF:ds0max=ds0,MAXIMUM,8,*
34 VDEF:ds0avg=ds0,AVERAGE,8,*
35 VDEF:ds0min=ds0,MINIMUM,8,*
36 VDEF:ds0pct=95,ds0,PERCENTILE,8,*
37 VDEF:ds1max=ds1,MAXIMUM,8,*
38 VDEF:ds1avg=ds1,AVERAGE,8,*
39 VDEF:ds1min=ds1,MINIMUM,8,*
40 VDEF:ds1pct=95,ds1,PERCENTILE,8,*
42 Note: consolidation occurs here.
47 Note: 10 spaces to move text to the right
52 XXX I don't understand the following; Fritz
54 Note: three times size == 11 chars, "###.## xBps"
60 Note: some lines contains the new-line character "\n"
62 COMMENT:"95th percentile\n"
63 AREA:ds0bits#00C000:"Inbound "
64 GPRINT:ds0max:"%6.2lf %Sbps"
65 GPRINT:ds0avg:"%6.2lf %Sbps"
66 GPRINT:ds0min:"%6.2lf %Sbps"
67 GPRINT:ds0pct:"%6.2lf %Sbps\n"
68 LINE1:ds1bits#0000FF:"Outbound"
69 GPRINT:ds1max:"%6.2lf %Sbps"
70 GPRINT:ds1avg:"%6.2lf %Sbps"
71 GPRINT:ds1min:"%6.2lf %Sbps"
72 GPRINT:ds1pct:"%6.2lf %Sbps\n"
74 =head2 Offsetting a line on the y-axis
76 Depending on your needs you can do this in two ways:
82 Offset the data, then graph this
84 DEF:mydata=my.rrd:ds:AVERAGE
86 Note: this will also influence any other command that uses "data"
88 CDEF:data=mydata,100,+
89 LINE1:data#FF0000:"Data with offset"
93 Graph the original data, with an offset
95 DEF:mydata=my.rrd:ds:AVERAGE
97 Note: no color in the first line so it is not visible
101 Note: the second line gets stacked on top of the first one
103 LINE1:data#FF0000:"Data with offset":STACK
109 Last four weeks: --start end-4w --end 00:00
110 January 2001: --start 200101010000 --end start+31d
111 January 2001: --start 200101010000 --end 200102010000
112 Last hour: --start end-1h
113 Last 24 hours: <nothing at all>
114 Yesterday: --end 00:00
116 =head2 Viewing the current and previous week together
118 --end now --start end-1w
119 DEF:thisweek=router.rrd:ds0:AVERAGE
120 DEF:lastweek=router.rrd:ds0:AVERAGE:end=now-1w:start=end-1w
122 Shift the data forward by one week (604800 seconds)
124 SHIFT:lastweek:604800
125 [ more of the usual VDEF and CDEF stuff if you like ]
126 AREA:lastweek#0000FF:Last\ week
127 LINE1:thisweek#FF0000:This\ week
131 L<rrdgraph> gives an overview of how B<rrdtool graph> works.
132 L<rrdgraph_data> describes B<DEF>,B<CDEF> and B<VDEF> in detail.
133 L<rrdgraph_rpn> describes the B<RPN> language used in the B<?DEF> statements.
134 L<rrdgraph_graph> page describes all the graph and print functions.
136 Make sure to read L<rrdgraph_examples> for tipsE<amp>tricks.
140 Program by Tobias Oetiker E<lt>oetiker@ee.ethz.chE<gt>
142 This manual page by Alex van den Bogaerdt E<lt>alex@ergens.op.het.netE<gt>