[rrd-users] Re: RRDTool Design Considerations

Alex van den Bogaerdt alex at slot.hollandcasino.nl
Sat Dec 1 00:44:47 MET 2001


Jason Frisvold wrote:

> 	Secondly, this needs to be scalable.  So, at points in the
> future, I may need to add ds's to an RRD.  How is this accomplished?  So

Apart from adding DSes once in a while, you're probably also adding
devices.  Chances are that you will be adding (or removing) devices 
much more frequently than DSes.  For this reason I'd put all relevant
information per device in one RRD file, one for each device.

If you'd add information for a new device to an existing RRD file you'd
be adding 20 (or so) DSes each time.  If this happens a lot you'd have
to dump, alter and restore the file each time.

Adding one (or so) DS to each and every file will also be a problem
however this will lock each file for a short amount of time as opposed
to the approach where you lock one file for a long time.

> far, the best I can tell is that I need to use rrdinfo to get all the
> current settings, create a new RRD with these settings and the new ones
> added, dump the old RRD to an XML file, and then write a parser to put
> the old info from the XML into the new RRD.  Is there some easier way to
> do this?  Does anyone currently have code that accomplishes this?

Modifying the .xml file and restoring that to a new .rrd seems to be
faster.  I didn't try this so you have to try for yourself.  Just insert
the appropriate value (most likely NaN) in the right place on almost
every line of the .xml file.  I'd be surprised if a simple action with
sed wouldn't suffice.  A quick try, without checking and without any
guaranties of any sort:

sed 's/<\/row>/<v> NaN <\/v><\/row>/' < old.xml > new.xml

If you don't know sed, this means:
On each line change "</row>" into "<v> NaN </v></row>".
This therefore adds an entry for a DS at the end of the row.

You also need to add an entry for the DS just before the line
"<!-- Round Robin Archives -->"
and you need to insert a line in the cdp_prep section, before
the line that reads "</cdp_prep>".

These two are slightly more difficult so that's left as an
exercise for the reader :)

<hint>
I wouldn't hold my breath however I can't think of any reason why the
rrdtool wouldn't be extended to contain "rrdtool addDS" or so.  The
biggest problem with this kind of modifications is to find a volunteer.
</hint>

> 	And lastly, when using rrdfetch, is there any way to specify
> which ds values to return or will it always return all of them?  Are
> there plans to change this?

For information on the future of rrdtool there is only one authoritative
source.  http://www.ee.ethz.ch/~slist/rrd-developers/msg00639.html

HTH
-- 
   __________________________________________________________________
 / alex at slot.hollandcasino.nl                  alex at ergens.op.het.net \
| work                                                         private |
| My employer is capable of speaking therefore I speak only for myself |
+----------------------------------------------------------------------+
| Technical questions sent directly to me will be nuked. Use the list. | 
+----------------------------------------------------------------------+
| http://faq.mrtg.org/                                                 |
| http://rrdtool.eu.org  --> tutorial                                  |
+----------------------------------------------------------------------+

--
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