[rrd-users] global data value change?

Alex van den Bogaerdt alex at ergens.op.het.net
Fri Mar 9 15:40:20 CET 2007


On Fri, Mar 09, 2007 at 11:18:07AM +0100, christian wrote:

> i should change all data values existing in an rrd:
> for reasons of aesthetics, people want to have said values multiplied 
> by some factor (future values will be entered multiplied, already).
> 
> what would be an easy way to accomplish this?

An easy way?  Don't do this!

> rtfm pointers, sample scripts/programs most welcome... ;-)

Look at the cdef tutorial (distributed with rrdtool, or on Tobi's site).
It contains an example on how to do certain things to your data but only
before a certain time.
"Example: better handling of unknown data, by using time"

You can adapt this example so that it doesn't look at unknown data, but
instead it would or would not multiply (depending on the timestamp).


Of course if you are not prepared with the overhead involved, you have
no other option than to alter the data in your database.  This would
probably involve some scripting to be efficient, but basically it would
be the following:

rrdtool dump your.rrd > dumpfile.xml
[using your favorite editor and calculator, modify data]
rrdtool restore dumpfile.xml copy_of_your.rrd
[verify integrety of copy_of_your.rrd]
[rename copy_of_your.rrd to your.rrd, thereby destroying your old rrd file]

HTH
-- 
Alex van den Bogaerdt
http://www.vandenbogaerdt.nl/rrdtool/



More information about the rrd-users mailing list