[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&#39;day,<div><br></div><div>I&#39;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&#39;m a Python guy so I whipped this up. \
AFAIK it&#39;s the only tool that populates the new RRA&#39;s data from existing \
RRA&#39;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>&quot;&quot;&quot;rrdtool extended \
commands.<br></div><div><div><br></div><div>Adds &quot;summary&quot; and \
&quot;addrra&quot; rrdtool commands.</div><div><br></div><div>The &quot;summary&quot; \
command will output a short summary of the RRD&#39;s DSs</div> <div>and \
RRAs.</div><div><br></div><div>The &quot;addrra&quot; 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 &lt;filename&gt;</div><div>  $0 \
addrra &lt;filename&gt; &lt;outfile&gt; [RRA:CF:cf args] \
...</div><div>&quot;&quot;&quot;</div><div><br></div><div style>It&#39;s a bit rough \
and ready (no decent cmdline checking, error reporting, help etc), but it works. \
I&#39;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&#39;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&#39;s with fancy CF&#39;s not supported \
by rrdtool xport. </div><div><br></div>-- <br> Donovan Baarda &lt;<a \
href="mailto:abo@minkirri.apana.org.au">abo@minkirri.apana.org.au</a>&gt; \
</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