rrdtool xport - Export data in XML format based on data from one or several RRD
If no XPORT statements are found, there will be no output.
Let's assume that the xport command looks like this:
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"
The resulting meta data section (the values will depend on the RRD characteristics):
<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>
The resulting data section:
<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>
rrdtool xport \ DEF:out=if1-inouts.rrd:outoctets:AVERAGE \ XPORT:out:"out bytes"
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"
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |