[rrd-users] Python script to add RRA's to an RRD.
Donovan Baarda
abo at minkirri.apana.org.au
Tue Apr 23 07:16:03 CEST 2013
G'day,
I've seen a few posts asking about how to add an RRA to an RRD without many
decent solutions. Apparently the perl rrd library has something to do this,
but I'm a Python guy so I whipped this up. AFAIK it's the only tool that
populates the new RRA's data from existing RRA's using xport;
http://minkirri.apana.org.au/~abo/projects/rrdcollect/rrdtoolx.py
>From the docstring;
"""rrdtool extended commands.
Adds "summary" and "addrra" rrdtool commands.
The "summary" command will output a short summary of the RRD's DSs
and RRAs.
The "addrra" command will create a new rrd with added RRAs. These RRAs
will be populated with as much data as can be derived by rrdxport from
the existing RRAs.
Usage:
$0 summary <filename>
$0 addrra <filename> <outfile> [RRA:CF:cf args] ...
"""
It's a bit rough and ready (no decent cmdline checking, error reporting,
help etc), but it works. I'll probably be polishing this up a bit over the
next couple of days, and maybe add functionality to remove RRAs and
add/remove DS's.
It works by running rrdtool to dump, modify, and restore xml. It will
probably break trying to add RRA's with fancy CF's not supported by rrdtool
xport.
--
Donovan Baarda <abo at minkirri.apana.org.au>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/rrd-users/attachments/20130423/18b10c7b/attachment.htm
More information about the rrd-users
mailing list