[prev in list] [next in list] [prev in thread] [next in thread]
List: rrd-users
Subject: [rrd-users] Python script to add RRA's to an RRD.
From: Donovan Baarda <abo () minkirri ! apana ! org ! au>
Date: 2013-04-23 5:16:03
Message-ID: CAKfm1dsyGPTdoRU=T89c5v-GK5dFR=7_V11up3ow8QU1bfJg4A () mail ! gmail ! com
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
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@minkirri.apana.org.au>
[Attachment #5 (text/html)]
<div dir="ltr">G'day,<div><br></div><div>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;</div> <div><br></div><div><a \
href="http://minkirri.apana.org.au/~abo/projects/rrdcollect/rrdtoolx.py">http://minkir \
ri.apana.org.au/~abo/projects/rrdcollect/rrdtoolx.py</a><br></div><div><br></div><div \
style>From the docstring;</div> <div style><br></div><div \
style>"""rrdtool extended \
commands.<br></div><div><div><br></div><div>Adds "summary" and \
"addrra" rrdtool commands.</div><div><br></div><div>The "summary" \
command will output a short summary of the RRD's DSs</div> <div>and \
RRAs.</div><div><br></div><div>The "addrra" command will create a new rrd \
with added RRAs. These RRAs</div><div>will be populated with as much data as can be \
derived by rrdxport from</div><div>the existing RRAs.</div> \
<div><br></div><div>Usage:</div><div> $0 summary <filename></div><div> $0 \
addrra <filename> <outfile> [RRA:CF:cf args] \
...</div><div>"""</div><div><br></div><div style>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.</div> <div \
style><br></div><div style>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. </div><div><br></div>-- <br> Donovan Baarda <<a \
href="mailto:abo@minkirri.apana.org.au">abo@minkirri.apana.org.au</a>> \
</div></div>
_______________________________________________
rrd-users mailing list
rrd-users@lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic