<?xml version="1.0" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>rrdxport</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link rev="made" href="mailto:root@localhost" /> </head> <body style="background-color: white"> <!-- INDEX BEGIN --> <div name="index"> <p><a name="__index__"></a></p> <!-- <ul> <li><a href="#name">NAME</a></li> <li><a href="#synopsis">SYNOPSIS</a></li> <li><a href="#description">DESCRIPTION</a></li> <li><a href="#output_format">Output format</a></li> <li><a href="#example_1">EXAMPLE 1</a></li> <li><a href="#example_2">EXAMPLE 2</a></li> <li><a href="#author">AUTHOR</a></li> </ul> --> </div> <!-- INDEX END --> <p> </p> <h1><a name="name">NAME</a></h1> <p>rrdxport - Export data in XML format based on data from one or several RRD</p> <p> </p> <hr /> <h1><a name="synopsis">SYNOPSIS</a></h1> <p><strong>rrdtool</strong> <strong>xport</strong> [<strong>-s</strong>|<strong>--start</strong> <em>seconds</em>] [<strong>-e</strong>|<strong>--end</strong> <em>seconds</em>] [<strong>-m</strong>|<strong>--maxrows</strong> <em>rows</em>] [<strong>--step</strong> <em>value</em>] [<strong>DEF:</strong><em>vname</em><strong>=</strong><em>rrd</em><strong>:</strong><em>ds-name</em><strong>:</strong><em>CF</em>] [<strong>CDEF:</strong><em>vname</em><strong>=</strong><em>rpn-expression</em>] [<strong>XPORT</strong><strong>:</strong><em>vname</em>[<strong>:</strong><em>legend</em>]]</p> <p> </p> <hr /> <h1><a name="description">DESCRIPTION</a></h1> <p>The <strong>xport</strong> function's main purpose is to write an XML formatted representation of the data stored in one or several <strong>RRD</strong>s. It can also extract numerical reports.</p> <p>If no <em>XPORT</em> statements are found, there will be no output.</p> <dl> <dt><strong><a name="seconds" class="item"><strong>-s</strong>|<strong>--start</strong> <em>seconds</em> (default end-1day)</a></strong></dt> <dd> <p>The time when the exported range should begin. Time in seconds since epoch (1970-01-01) is required. Negative numbers are relative to the current time. By default one day worth of data will be printed. See also AT-STYLE TIME SPECIFICATION section in the <em>rrdfetch</em> documentation for a detailed explanation on how to specify time.</p> </dd> <dt><strong><strong>-e</strong>|<strong>--end</strong> <em>seconds</em> (default now)</strong></dt> <dd> <p>The time when the exported range should end. Time in seconds since epoch. See also AT-STYLE TIME SPECIFICATION section in the <em>rrdfetch</em> documentation for a detailed explanation of ways to specify time.</p> </dd> <dt><strong><a name="rows" class="item"><strong>-m</strong>|<strong>--maxrows</strong> <em>rows</em> (default 400 rows)</a></strong></dt> <dd> <p>This works like the <strong>-w</strong>|<strong>--width</strong> parameter of <em>rrdgraph</em>. In fact it is exactly the same, but the parameter was renamed to describe its purpose in this module. See <em>rrdgraph</em> documentation for details.</p> </dd> <dt><strong><a name="value" class="item"><strong>--step</strong> <em>value</em> (default automatic)</a></strong></dt> <dd> <p>See <a href="././rrdgraph.html">the rrdgraph manpage</a> documentation.</p> </dd> <dt><strong><a name="enumds" class="item"><strong>--enumds</strong></a></strong></dt> <dd> <p>The generated xml should contain the data values in enumerated tags.</p> <pre> <v0>val</v0><v1>val</v1></pre> </dd> <dt><strong><a name="def_vname_rrd_ds_name_cf" class="item"><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> <dd> <p>See <em>rrdgraph</em> documentation.</p> </dd> <dt><strong><a name="cdef_vname_rpn_expression" class="item"><strong>CDEF:</strong><em>vname</em><strong>=</strong><em>rpn-expression</em></a></strong></dt> <dd> <p>See <em>rrdgraph</em> documentation.</p> </dd> <dt><strong><a name="xport_vname_legend" class="item"><strong>XPORT:</strong><em>vname</em><strong>:</strong><strong>:</strong><em>legend</em></a></strong></dt> <dd> <p>At least one <em>XPORT</em> statement should be present. The values referenced by <em>vname</em> are printed. Optionally add a legend.</p> </dd> </dl> <p> </p> <hr /> <h1><a name="output_format">Output format</a></h1> <p>The output is enclosed in an <strong>xport</strong> element and contains two blocks. The first block is enclosed by a <strong>meta</strong> element and contains some meta data. The second block is enclosed by a <strong>data</strong> element and contains the data rows.</p> <p>Let's assume that the <em>xport</em> command looks like this:</p> <pre> rrdtool xport \ --start now-1h --end now \ DEF:xx=host-inout.lo.rrd:output:AVERAGE \ DEF:yy=host-inout.lo.rrd:input:AVERAGE \ CDEF:aa=xx,yy,+,8,* \ XPORT:xx:"out bytes" \ XPORT:aa:"in and out bits"</pre> <p>The resulting meta data section is (the values will depend on the RRD characteristics):</p> <pre> <meta> <start>1020611700</start> <step>300</step> <end>1020615600</end> <rows>14</rows> <columns>2</columns> <legend> <entry>out bytes</entry> <entry>in and out bits</entry> </legend> </meta></pre> <p>The resulting data section is:</p> <pre> <data> <row><t>1020611700</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020612000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020612300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020612600</t><v>3.4113333333e+00</v><v>5.4581333333e+01</v></row> <row><t>1020612900</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020613200</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020613500</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020613800</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020614100</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020614400</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020614700</t><v>3.7333333333e+00</v><v>5.9733333333e+01</v></row> <row><t>1020615000</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020615300</t><v>3.4000000000e+00</v><v>5.4400000000e+01</v></row> <row><t>1020615600</t><v>NaN</v><v>NaN</v></row> </data></pre> <p> </p> <hr /> <h1><a name="example_1">EXAMPLE 1</a></h1> <pre> rrdtool xport \ DEF:out=if1-inouts.rrd:outoctets:AVERAGE \ XPORT:out:"out bytes"</pre> <p> </p> <hr /> <h1><a name="example_2">EXAMPLE 2</a></h1> <pre> rrdtool xport \ DEF:out1=if1-inouts.rrd:outoctets:AVERAGE \ DEF:out2=if2-inouts.rrd:outoctets:AVERAGE \ CDEF:sum=out1,out2,+ \ XPORT:out1:"if1 out bytes" \ XPORT:out2:"if2 out bytes" \ XPORT:sum:"output sum"</pre> <p> </p> <hr /> <h1><a name="author">AUTHOR</a></h1> <p>Tobias Oetiker <<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>></p> </body> </html>