[mrtg] Re: changing historical data in an RRD

Arnold Nipper arnold at nipper.de
Wed Jul 21 22:56:31 MEST 2004


On 21.07.2004 21:22 Eric Brander wrote:

> Also, I know I can do an RRDTool export and get the data in an XML 
> format, but manipulating that data is my weak point. So I'm looking for 
> help on hacking the data in the RRD.
> 

doing an export an swapping the two positions is really easy. You even
don't have to know what XML is. Simply keep all the lines you don't know
what they mean and swap position in the "data" lines. A data line looks
like:

<!-- 2004-07-21 02:00:00 CEST / 1090368000 --> <row><v> 3.0291166667e+02
</v><v> 1.3062150000e+03 </v></row>

if you would like to do it with an awk-script this should do it for a
rrd with in/out:

# begin script
#
# look for data rows, $9 and $11 are the data values. Just swap, the go
to next line.
/<!--.*row/     {

        s=$9; $9=$11; $11=s; print; next;
}

# If not a data line, just print
{       print   }
#
# end script



Arnold

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list