[rrd-users] rrdtool xport - getting total bandwidth for a specific date interval
Göran Törnqvist
goran at goran.aleborg.se
Mon Sep 19 18:50:17 MEST 2005
Hello,
I got a bunch of RRA files and I want to get the total bandwidth from them for a specific date interval for accounting purposes.
Im using cacti to generate the graphs so Im not too good at RRDTOOL Im afraid (sorry) and couldnt find a solution to this.
I´ve managed to get data from a rrd-file like this:
rrdtool xport --start now-24h --end now DEF:out=rra/switch_traffic_in_28.rrd:traffic_out:MAX XPORT:out:"out bytes"
.
I get a XML file that looks like this:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xport>
<meta>
<start>1116057600</start>
<step>7200</step>
<end>1118656800</end>
<rows>362</rows>
<columns>1</columns>
<legend>
<entry>out bytes</entry>
</legend>
</meta>
<data>
<row><t>1116057600</t><v>1.3456063333e+04</v></row>
<row><t>1116064800</t><v>1.7400663333e+04</v></row>
<row><t>1116072000</t><v>1.5801985689e+04</v></row>
<row><t>1116079200</t><v>1.4365490467e+04</v></row>
<row><t>1118656800</t><v>NaN</v></row>
</data>
</xport>
I have trouble with interpreting the XML-output, whats <t> and whats <v>, what does 1.3456063333e+04 mean? I can't find any info on how the data should be parsed. I guess I should loop all rows but after that Im stuck, should I add the numbers somehow?
Thanks for your time...and thanks for any help :)
Best Regards
Goran Tornqvist
--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive http://lists.ee.ethz.ch/rrd-users
WebAdmin http://lists.ee.ethz.ch/lsg2.cgi
More information about the rrd-users
mailing list