From RootdevWiki

Jump to: navigation, search

Using RRDTool

How to change the step size in RRD files

To do this you need to dump the data to xml, edit the file, then restore the data to the RRD file.

For instance, if you want to reduct the step size from 120 seconds to 60 seconds and the minimal heartbeat from 240 to 120 seconds this can be achieved for multiple files using the following nifty one-liner:

for i in `find . -name *.rrd`; do echo "Processing $i"; \
rrdtool dump $i > $i.xml;  rm -f $i; \
sed -i 's/<step> 120/<step> 60/; s/120 seconds/60 seconds/; \
s/<minimal_heartbeat>240/<minimal_heartbeat> 120/' $i.xml; \
rrdtool restore $i.xml $i; rm -f $i.xml; done