Child pages
  • Trim rrd graphs (remove peaks)
Skip to end of metadata
Go to start of metadata
First, be a good sysadmin and take a backup of the rrd-file before you begin.
The RRD files and XML files containing the datasource descriptions and other variables and values the PNP templating engine works with are found under the following path:  

To find out the datasources names and numbers to work with, you can check the XML file:

# cat <graph name>.xml

The two things to look for is the <DS> and <LABEL> tags. Find out what label you want to trim and use the DS-id in the rrdtool tune command.


Once you know what you want to modify and what the maximum value that the RRD file should accept as a measurement value should be, you can proceed with the following steps:

  • "tune" the RRD file to not accept values over X on datasource Y (this is a permanent change on the RRD file which means that once this limit is set, it also applies to all values that will be inserted to the rrd file in future)
  • "dump" the content of the RRD file into a XML file (reson: setting the limit in RRD only applies to newly inserted values, not to already existing ones)
  • "restore" the XML to RRD, so that the max limit takes effect and the values contained in the XML which are over the max limit are omitted (in fact, "NaN" data entries are generated for these)
These are the commands you will need:
# rrtool tune <path to rrd-file> -a <DS>:<MAX VALUE>
# rrdtool dump <rrd-file> > fix.xml
# rm <rrd-file>
# rrdtool restore fix.xml <rrd-file> -r


Script to automate these steps:

Especially for bandwidth checks where "peaks" is a phenomenon that is seen in many installations, this is a very easy script to make the above steps a bit easier:

  • No labels