1RRDGRAPH_EXAMPLES(1)                rrdtool               RRDGRAPH_EXAMPLES(1)
2
3
4

NAME

6       rrdgraph_examples - Examples for rrdtool graph
7

SYNOPSIS

9       rrdtool graph /home/httpd/html/test.png --img-format PNG
10
11       followed by any of the examples below
12

DESCRIPTION

14       For your convenience some of the commands are explained here by using
15       detailed examples. They are not always cut-and-paste ready because com‐
16       ments are intermixed with the examples.
17

EXAMPLES

19       Data with multiple resolutions
20
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\l"
26           LINE1:ds0b#00CCFF:"resolution 1800 seconds per interval\l"
27           LINE1:ds0c#FF00FF:"resolution 7200 seconds per interval\l"
28
29       Nicely formatted legend section
30
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
34           VDEF:ds0avg=ds0,AVERAGE
35           VDEF:ds0min=ds0,MINIMUM
36           VDEF:ds0pct=ds0,95,PERCENT
37           VDEF:ds1max=ds1,MAXIMUM
38           VDEF:ds1avg=ds1,AVERAGE
39           VDEF:ds1min=ds1,MINIMUM
40           VDEF:ds1pct=ds1,95,PERCENT
41
42       Note: consolidation occurs here.
43
44           CDEF:ds0bits=ds0,8,*
45           CDEF:ds1bits=ds1,8,*
46
47       Note: 10 spaces to move text to the right
48
49           COMMENT:"          "
50
51       Note: the column titles have to be as wide as the columns
52
53           COMMENT:"Maximum    "
54           COMMENT:"Average    "
55           COMMENT:"Minimum    "
56
57           COMMENT:"95th percentile\l"
58           AREA:ds0bits#00C000:"Inbound "
59           GPRINT:ds0max:"%6.2lf %Sbps"
60           GPRINT:ds0avg:"%6.2lf %Sbps"
61           GPRINT:ds0min:"%6.2lf %Sbps"
62           GPRINT:ds0pct:"%6.2lf %Sbps\l"
63           LINE1:ds1bits#0000FF:"Outbound"
64           GPRINT:ds1max:"%6.2lf %Sbps"
65           GPRINT:ds1avg:"%6.2lf %Sbps"
66           GPRINT:ds1min:"%6.2lf %Sbps"
67           GPRINT:ds1pct:"%6.2lf %Sbps\l"
68
69       Offsetting a line on the y-axis
70
71       Depending on your needs you can do this in two ways:
72
73       ·   Offset the data, then graph this
74
75               DEF:mydata=my.rrd:ds:AVERAGE
76
77           Note: this will also influence any other command that uses "data"
78
79               CDEF:data=mydata,100,+
80               LINE1:data#FF0000:"Data with offset"
81
82       ·   Graph the original data, with an offset
83
84               DEF:mydata=my.rrd:ds:AVERAGE
85
86           Note: no color in the first line so it is not visible
87
88               LINE1:100
89
90           Note: the second line gets stacked on top of the first one
91
92               LINE1:data#FF0000:"Data with offset":STACK
93
94       Time ranges
95
96           Last four weeks: --start end-4w --end 00:00
97           January 2001:    --start 20010101 --end start+31d
98           January 2001:    --start 20010101 --end 20010201
99           Last hour:       --start end-1h
100           Last 24 hours:   <nothing at all>
101           Yesterday:       --end 00:00
102
103       Viewing the current and previous week together
104
105           --end now --start end-1w
106           DEF:thisweek=router.rrd:ds0:AVERAGE
107           DEF:lastweek=router.rrd:ds0:AVERAGE:end=now-1w:start=end-1w
108
109       Shift the data forward by one week (604800 seconds)
110
111           SHIFT:lastweek:604800
112           [ more of the usual VDEF and CDEF stuff if you like ]
113           AREA:lastweek#0000FF:Last\ week
114           LINE1:thisweek#FF0000:This\ week
115

SEE ALSO

117       rrdgraph gives an overview of how rrdtool graph works.  rrdgraph_data
118       describes DEF,CDEF and VDEF in detail.  rrdgraph_rpn describes the RPN
119       language used in the xDEF statements.  rrdgraph_graph page describes
120       all the graph and print functions.
121
122       Make sure to read rrdgraph_examples for tips&tricks.
123

AUTHOR

125       Program by Tobias Oetiker <tobi@oetiker.ch>
126
127       This manual page by Alex van den Bogaerdt <alex@ergens.op.het.net>
128
129
130
1311.2.27                            2008-02-17              RRDGRAPH_EXAMPLES(1)
Impressum