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>rrdxport</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="#output_format">Output format</a></li>
22 <li><a href="#example_1">EXAMPLE 1</a></li>
23 <li><a href="#example_2">EXAMPLE 2</a></li>
24 <li><a href="#author">AUTHOR</a></li>
25 </ul>
26 -->
27 <!-- INDEX END -->
29 <p>
30 </p>
31 <h1><a name="name">NAME</a></h1>
32 <p>rrdxport - Export data in XML format based on data from one or several RRD</p>
33 <p>
34 </p>
35 <hr />
36 <h1><a name="synopsis">SYNOPSIS</a></h1>
37 <p><strong>rrdtool</strong> <strong>xport</strong>
38 [<strong>-s</strong>|<strong>--start</strong> <em>seconds</em>]
39 [<strong>-e</strong>|<strong>--end</strong> <em>seconds</em>]
40 [<strong>-m</strong>|<strong>--maxrows</strong> <em>rows</em>]
41 [<strong>--step</strong> <em>value</em>]
42 [<strong>DEF:</strong><em>vname</em><strong>=</strong><em>rrd</em><strong>:</strong><em>ds-name</em><strong>:</strong><em>CF</em>]
43 [<strong>CDEF:</strong><em>vname</em><strong>=</strong><em>rpn-expression</em>]
44 [<strong>XPORT</strong><strong>:</strong><em>vname</em>[<strong>:</strong><em>legend</em>]]</p>
45 <p>
46 </p>
47 <hr />
48 <h1><a name="description">DESCRIPTION</a></h1>
49 <p>The <strong>xport</strong> function's main purpose is to write an XML formatted
50 representation of the data stored in one or several <strong>RRD</strong>s. It
51 can also extract numerical reports.</p>
52 <p>If no <em>XPORT</em> statements are found, there will be no output.</p>
53 <dl>
54 <dt><strong><a name="item_seconds"><strong>-s</strong>|<strong>--start</strong> <em>seconds</em> (default end-1day)</a></strong></dt>
56 <dd>
57 <p>The time when the exported range should begin. Time in seconds since
58 epoch (1970-01-01) is required. Negative numbers are relative to the
59 current time. By default one day worth of data will be printed.
60 See also AT-STYLE TIME SPECIFICATION section in the <em>rrdfetch</em>
61 documentation for a detailed explanation on how to specify time.</p>
62 </dd>
63 <dt><strong><strong>-e</strong>|<strong>--end</strong> <em>seconds</em> (default now)</strong></dt>
65 <dd>
66 <p>The time when the exported range should end. Time in seconds since epoch.
67 See also AT-STYLE TIME SPECIFICATION section in the <em>rrdfetch</em>
68 documentation for a detailed explanation of ways to specify time.</p>
69 </dd>
70 <dt><strong><a name="item_rows"><strong>-m</strong>|<strong>--maxrows</strong> <em>rows</em> (default 400 rows)</a></strong></dt>
72 <dd>
73 <p>This works like the <strong>-w</strong>|<strong>--width</strong> parameter of <em>rrdgraph</em>.
74 In fact it is exactly the same, but the parameter was renamed to
75 describe its purpose in this module. See <em>rrdgraph</em> documentation
76 for details.</p>
77 </dd>
78 <dt><strong><a name="item_value"><strong>--step</strong> <em>value</em> (default automatic)</a></strong></dt>
80 <dd>
81 <p>See <a href="././rrdgraph.html">the rrdgraph manpage</a> documentation.</p>
82 </dd>
83 <dt><strong><a name="item__2d_2denumds"><strong>--enumds</strong></a></strong></dt>
85 <dd>
86 <p>The generated xml should contain the data values in enumerated tags.</p>
87 <pre>
88 <v0>val</v0><v1>val</v1></pre>
89 </dd>
90 <dt><strong><a name="item_def_3avname_3drrd_3ads_2dname_3acf"><strong>DEF:</strong><em>vname</em><strong>=</strong><em>rrd</em><strong>:</strong><em>ds-name</em><strong>:</strong><em>CF</em></a></strong></dt>
92 <dd>
93 <p>See <em>rrdgraph</em> documentation.</p>
94 </dd>
95 <dt><strong><a name="item_cdef_3avname_3drpn_2dexpression"><strong>CDEF:</strong><em>vname</em><strong>=</strong><em>rpn-expression</em></a></strong></dt>
97 <dd>
98 <p>See <em>rrdgraph</em> documentation.</p>
99 </dd>
100 <dt><strong><a name="item_xport_3avname_3a_3alegend"><strong>XPORT:</strong><em>vname</em><strong>:</strong><strong>:</strong><em>legend</em></a></strong></dt>
102 <dd>
103 <p>At least one <em>XPORT</em> statement should be present. The values
104 referenced by <em>vname</em> are printed. Optionally add a legend.</p>
105 </dd>
106 </dl>
107 <p>
108 </p>
109 <hr />
110 <h1><a name="output_format">Output format</a></h1>
111 <p>The output is enclosed in an <strong>xport</strong> element and contains two
112 blocks. The first block is enclosed by a <strong>meta</strong> element and
113 contains some meta data. The second block is enclosed by a
114 <strong>data</strong> element and contains the data rows.</p>
115 <p>Let's assume that the <em>xport</em> command looks like this:</p>
116 <pre>
117 rrdtool xport \
118 --start now-1h --end now \
119 DEF:xx=host-inout.lo.rrd:output:AVERAGE \
120 DEF:yy=host-inout.lo.rrd:input:AVERAGE \
121 CDEF:aa=xx,yy,+,8,* \
122 XPORT:xx:"out bytes" \
123 XPORT:aa:"in and out bits"</pre>
124 <p>The resulting meta data section is (the values will depend on the
125 RRD characteristics):</p>
126 <pre>
127 <meta>
128 <start>1020611700</start>
129 <step>300</step>
130 <end>1020615600</end>
131 <rows>14</rows>
132 <columns>2</columns>
133 <legend>
134 <entry>out bytes</entry>
135 <entry>in and out bits</entry>
136 </legend>
137 </meta></pre>
138 <p>The resulting data section is:</p>
139 <pre>
140 <data>
141 <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
142 <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
143 <row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
144 <row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row>
145 <row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
146 <row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
147 <row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
148 <row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
149 <row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
150 <row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
151 <row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row>
152 <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
153 <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row>
154 <row><t>1020615600</t><v>NaN</v><v>NaN</v></row>
155 </data></pre>
156 <p>
157 </p>
158 <hr />
159 <h1><a name="example_1">EXAMPLE 1</a></h1>
160 <pre>
161 rrdtool xport \
162 DEF:out=if1-inouts.rrd:outoctets:AVERAGE \
163 XPORT:out:"out bytes"</pre>
164 <p>
165 </p>
166 <hr />
167 <h1><a name="example_2">EXAMPLE 2</a></h1>
168 <pre>
169 rrdtool xport \
170 DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \
171 DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \
172 CDEF:sum=out1,out2,+ \
173 XPORT:out1:"if1 out bytes" \
174 XPORT:out2:"if2 out bytes" \
175 XPORT:sum:"output sum"</pre>
176 <p>
177 </p>
178 <hr />
179 <h1><a name="author">AUTHOR</a></h1>
180 <p>Tobias Oetiker <<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>></p>
182 </body>
184 </html>