1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>rrdgraph_examples</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:root@localhost" />
8 </head>
10 <body style="background-color: white">
12 <p><a name="__index__"></a></p>
13 <!-- INDEX BEGIN -->
14 <!--
16 <ul>
18 <li><a href="#name">NAME</a></li>
19 <li><a href="#synopsis">SYNOPSIS</a></li>
20 <li><a href="#description">DESCRIPTION</a></li>
21 <li><a href="#examples">EXAMPLES</a></li>
22 <ul>
24 <li><a href="#data_with_multiple_resolutions">Data with multiple resolutions</a></li>
25 <li><a href="#nicely_formatted_legend_section">Nicely formatted legend section</a></li>
26 <li><a href="#offsetting_a_line_on_the_yaxis">Offsetting a line on the y-axis</a></li>
27 <li><a href="#time_ranges">Time ranges</a></li>
28 <li><a href="#viewing_the_current_and_previous_week_together">Viewing the current and previous week together</a></li>
29 </ul>
31 <li><a href="#see_also">SEE ALSO</a></li>
32 <li><a href="#author">AUTHOR</a></li>
33 </ul>
34 -->
35 <!-- INDEX END -->
37 <p>
38 </p>
39 <h1><a name="name">NAME</a></h1>
40 <p>rrdgraph_examples - Examples for rrdtool graph</p>
41 <p>
42 </p>
43 <hr />
44 <h1><a name="synopsis">SYNOPSIS</a></h1>
45 <p><strong>rrdtool graph /home/httpd/html/test.png --img-format PNG</strong></p>
46 <p>followed by any of the examples below</p>
47 <p>
48 </p>
49 <hr />
50 <h1><a name="description">DESCRIPTION</a></h1>
51 <p>For your convenience some of the commands are explained here
52 by using detailed examples. They are not always cut-and-paste
53 ready because comments are intermixed with the examples.</p>
54 <p>
55 </p>
56 <hr />
57 <h1><a name="examples">EXAMPLES</a></h1>
58 <p>
59 </p>
60 <h2><a name="data_with_multiple_resolutions">Data with multiple resolutions</a></h2>
61 <pre>
62 --end now --start end-120000s --width 400
63 DEF:ds0a=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
64 DEF:ds0b=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=1800
65 DEF:ds0c=/home/rrdtool/data/router1.rrd:ds0:AVERAGE:step=7200
66 LINE1:ds0a#0000FF:"default resolution\l"
67 LINE1:ds0b#00CCFF:"resolution 1800 seconds per interval\l"
68 LINE1:ds0c#FF00FF:"resolution 7200 seconds per interval\l"</pre>
69 <p>
70 </p>
71 <h2><a name="nicely_formatted_legend_section">Nicely formatted legend section</a></h2>
72 <pre>
73 DEF:ds0=/home/rrdtool/data/router1.rrd:ds0:AVERAGE
74 DEF:ds1=/home/rrdtool/data/router1.rrd:ds1:AVERAGE
75 VDEF:ds0max=ds0,MAXIMUM
76 VDEF:ds0avg=ds0,AVERAGE
77 VDEF:ds0min=ds0,MINIMUM
78 VDEF:ds0pct=ds0,95,PERCENT
79 VDEF:ds1max=ds1,MAXIMUM
80 VDEF:ds1avg=ds1,AVERAGE
81 VDEF:ds1min=ds1,MINIMUM
82 VDEF:ds1pct=ds1,95,PERCENT</pre>
83 <p>Note: consolidation occurs here.</p>
84 <pre>
85 CDEF:ds0bits=ds0,8,*
86 CDEF:ds1bits=ds1,8,*</pre>
87 <p>Note: 10 spaces to move text to the right</p>
88 <pre>
89 COMMENT:" "</pre>
90 <p>Note: the column titles have to be as wide as the columns</p>
91 <pre>
92 COMMENT:"Maximum "
93 COMMENT:"Average "
94 COMMENT:"Minimum "</pre>
95 <pre>
96 COMMENT:"95th percentile\l"
97 AREA:ds0bits#00C000:"Inbound "
98 GPRINT:ds0max:"%6.2lf %Sbps"
99 GPRINT:ds0avg:"%6.2lf %Sbps"
100 GPRINT:ds0min:"%6.2lf %Sbps"
101 GPRINT:ds0pct:"%6.2lf %Sbps\l"
102 LINE1:ds1bits#0000FF:"Outbound"
103 GPRINT:ds1max:"%6.2lf %Sbps"
104 GPRINT:ds1avg:"%6.2lf %Sbps"
105 GPRINT:ds1min:"%6.2lf %Sbps"
106 GPRINT:ds1pct:"%6.2lf %Sbps\l"</pre>
107 <p>
108 </p>
109 <h2><a name="offsetting_a_line_on_the_yaxis">Offsetting a line on the y-axis</a></h2>
110 <p>Depending on your needs you can do this in two ways:</p>
111 <ul>
112 <li>
113 <p>Offset the data, then graph this</p>
114 <pre>
115 DEF:mydata=my.rrd:ds:AVERAGE</pre>
116 <p>Note: this will also influence any other command that uses ``data''</p>
117 <pre>
118 CDEF:data=mydata,100,+
119 LINE1:data#FF0000:"Data with offset"</pre>
120 </li>
121 <li>
122 <p>Graph the original data, with an offset</p>
123 <pre>
124 DEF:mydata=my.rrd:ds:AVERAGE</pre>
125 <p>Note: no color in the first line so it is not visible</p>
126 <pre>
127 LINE1:100</pre>
128 <p>Note: the second line gets stacked on top of the first one</p>
129 <pre>
130 LINE1:data#FF0000:"Data with offset":STACK</pre>
131 </li>
132 </ul>
133 <p>
134 </p>
135 <h2><a name="time_ranges">Time ranges</a></h2>
136 <pre>
137 Last four weeks: --start end-4w --end 00:00
138 January 2001: --start 20010101 --end start+31d
139 January 2001: --start 20010101 --end 20010201
140 Last hour: --start end-1h
141 Last 24 hours: <nothing at all>
142 Yesterday: --end 00:00</pre>
143 <p>
144 </p>
145 <h2><a name="viewing_the_current_and_previous_week_together">Viewing the current and previous week together</a></h2>
146 <pre>
147 --end now --start end-1w
148 DEF:thisweek=router.rrd:ds0:AVERAGE
149 DEF:lastweek=router.rrd:ds0:AVERAGE:end=now-1w:start=end-1w</pre>
150 <p>Shift the data forward by one week (604800 seconds)</p>
151 <pre>
152 SHIFT:lastweek:604800
153 [ more of the usual VDEF and CDEF stuff if you like ]
154 AREA:lastweek#0000FF:Last\ week
155 LINE1:thisweek#FF0000:This\ week</pre>
156 <p>
157 </p>
158 <hr />
159 <h1><a name="see_also">SEE ALSO</a></h1>
160 <p><a href="././rrdgraph.html">the rrdgraph manpage</a> gives an overview of how <strong>rrdtool graph</strong> works.
161 <a href="././rrdgraph_data.html">the rrdgraph_data manpage</a> describes <strong>DEF</strong>,<strong>CDEF</strong> and <strong>VDEF</strong> in detail.
162 <a href="././rrdgraph_rpn.html">the rrdgraph_rpn manpage</a> describes the <strong>RPN</strong> language used in the <strong>xDEF</strong> statements.
163 <a href="././rrdgraph_graph.html">the rrdgraph_graph manpage</a> page describes all the graph and print functions.</p>
164 <p>Make sure to read <a href="././rrdgraph_examples.html">the rrdgraph_examples manpage</a> for tips&tricks.</p>
165 <p>
166 </p>
167 <hr />
168 <h1><a name="author">AUTHOR</a></h1>
169 <p>Program by Tobias Oetiker <<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>></p>
170 <p>This manual page by Alex van den Bogaerdt <<a href="mailto:alex@ergens.op.het.net">alex@ergens.op.het.net</a>></p>
172 </body>
174 </html>