[rrd-users] Re: Change rrd file

Todd Caine todd_caine at eli.net
Wed Apr 3 02:45:50 MEST 2002

Dave Plonka's FlowScan comes with a Perl script called add_ds.pl written by Selena
Brewington that says it adds data sources to existing RRD files.

You can download the sources for FlowScan at
http://net.doit.wisc.edu/~plonka/FlowScan/.  The script is in the bin directory.

I've never actually tried it out though but it looks like it takes the output of an
rrdtool dump and adds a DS for you then prints the updated XML to STDOUT.  So you
could probably do a:

# rrdtool dump foo.rrd | add_ds.pl [args_go_here] > foo.xml
# rrdtool restore foo.xml foo.rrd

Here's the output of add_ds.pl's -h flag:

add-ds.pl <add'l ds> [default_val] [type] [heartbeat] [rrdmin] [rrdmax] < file.xml
        <add'l ds>      number of additional datasources
        [default_val]   default value to be entered in add'l fields
        [type]  type of datasource (i.e. COUNTER, GAUGE...)
        [heatbeat]      length of time in seconds before RRD thinks your DS is dead
        [rrdmin]        minimum value allowed for each datasource
        [rrdmax]        max value allowed for each datasource

        Options are read in order, so if you want to change the
        default heartbeat, you need to specify the default_val and
        type as well, etc.

        Output goes to STDOUT.

Your miles may vary.


spiegela at birch.net wrote:

>   I'm certainly not an expert, but the only way I've found thus far is to export
> your RRD to XML using the "rrdtool dump" command, edit the XML to read as you
> would like it (probably putting in "unknown" data for your new DS up to this
> point), and then use "rrdtool restore" to get it back to an rrd.
>   If there is a better way, though, I'd love to hear about it also.
>   And to the rrd-hackers out there:  adding DS's on the fly would be awesome!
> Quoting "PER-LIM-Ballester, Luis" <lballester at IMPSAT.COM.PE>:
> > Hi, I have one question
> > I want to add some more DS´s into my database but I don´t want to lose any
> > of my data. How can I do this?
> > Thank you for your help

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://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list