5 WARNING: DO NOT EDIT THE POD FILES. THEY ARE AUTO-GENERATED
9 rrdgraph_examples - Examples for rrdtool graph
13 B<rrdtool graph /home/httpd/html/test.png --img-format PNG \>
15 followed by any of the examples below
19 For your convenience some of the commands are explained here
20 by using detailed examples. They are not always cut-and-paste
21 ready because comments are intermixed with the examples.
25 =head2 Data with multiple resolutions
27 --end now --start end-120000s --width 400
28 DEF:ds0a=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
29 DEF:ds0b=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=1800
30 DEF:ds0c=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=7200
31 LINE1:ds0a#0000FF:"default resolution\n"
32 LINE1:ds0b#00CCFF:"resolution 1800 seconds per interval\n"
33 LINE1:ds0c#FF00FF:"resolution 7200 seconds per interval\n"
35 =head2 Nicely formatted legend section
37 DEF:ds0=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
38 DEF:ds1=/home/rrdtool/data/router1.rrd:ds1:AVERAGE
39 VDEF:ds0max=ds0,MAXIMUM,8,*
40 VDEF:ds0avg=ds0,AVERAGE,8,*
41 VDEF:ds0min=ds0,MINIMUM,8,*
42 VDEF:ds0pct=95,ds0,PERCENTILE,8,*
43 VDEF:ds1max=ds1,MAXIMUM,8,*
44 VDEF:ds1avg=ds1,AVERAGE,8,*
45 VDEF:ds1min=ds1,MINIMUM,8,*
46 VDEF:ds1pct=95,ds1,PERCENTILE,8,*
48 Note: consolidation occurs here.
53 Note: 10 spaces to move text to the right
57 Note: three times size == 11 chars, "###.## xBps"
63 Note: last line contains new-line character
65 COMMENT:"95th percentile\n"
66 AREA:ds0bits#00C000:"Inbound "
67 GPRINT:ds0max:"%6.2lf %Sbps"
68 GPRINT:ds0avg:"%6.2lf %Sbps"
69 GPRINT:ds0min:"%6.2lf %Sbps"
70 GPRINT:ds0pct:"%6.2lf %Sbps\n"
71 LINE1:ds1bits#0000FF:"Outbound"
72 GPRINT:ds1max:"%6.2lf %Sbps"
73 GPRINT:ds1avg:"%6.2lf %Sbps"
74 GPRINT:ds1min:"%6.2lf %Sbps"
75 GPRINT:ds1pct:"%6.2lf %Sbps\n"
77 =head2 Offsetting a line on the y-axis
79 Depending on your needs you can do this in two ways:
85 Offset the data, then graph this
87 DEF:mydata=my.rrd:ds:AVERAGE
89 Note: this will also influence anything that uses "data"
91 CDEF:data=mydata,100,+
92 LINE1:data#FF0000:"Data with offset"
96 Graph the original data, with an offset
98 DEF:mydata=my.rrd:ds:AVERAGE
100 Note: no color in the first line so it is not visible
104 Note: the second line gets stacked on top of the first one
106 LINE1:data#FF0000:"Data with offset":STACK
112 Last four weeks: --start end-4w --end 00:00
113 Januari 2001: --start 200101010000 --end start+31d
114 Januari 2001: --start 200101010000 --end 200102010000
115 Last hour: --start end-1h
116 Last 24 hours: <nothing at all>
117 Yesterday: --end 00:00
119 =head2 Viewing This week and last week together
121 --end now --start end-1w
122 DEF:thisweek=router.rrd:ds0:AVERAGE
123 DEF:lastweek=router.rrd:ds0:AVERAGE:end=now-1w:start=end-1w
125 shift the data forward by one week (604800 seconds)
127 SHIFT:lastweek:604800
128 [ more of the usual VDEF and CDEF stuff if you like ]
129 AREA:lastweek#0000FF:Last\ week
130 LINE1:thisweek#FF0000:This\ week