It is possible to increase the retention of your existing RRD data, without data loss, subject to some caveats.
You can accomplish this in a few ways:
- Add additional rows to existing RRAs
- Add new RRAs
I’ve successfully taken the first approach.
The basic procedure:
- Update all of the RRD configuration in all of OpenNMS’s xml files.
- Restart OpenNMS.
- Tune the existing RRD files to increase their retention going forwards.
The final step can be done with a command like this:
find /var/opennms/rrd -name '*.rrd' -print0 | while read -d $'\0' f ; do sudo rrdtool tune "$f" 'RRA#0:=8928' 'RRA#2:=1830' 'RRA#3:=1830' 'RRA#4:=1830' ; done
That increases things to:
- keep 5 minute averages for 1 month
- keep daily average, min, max for 5 years
You’ll want to update all the instances of RRD configuration to match, e.g.:
<rrd step="300"> <rra>RRA:AVERAGE:0.5:1:2016</rra> <rra>RRA:AVERAGE:0.5:12:1488</rra> <rra>RRA:AVERAGE:0.5:288:1830</rra> <rra>RRA:MAX:0.5:288:1830</rra> <rra>RRA:MIN:0.5:288:1830</rra> </rrd>
More information is available in the rrdtune documentation.
Note: the above is only applicable to those using
org.opennms.rrd.strategyClass=org.opennms.netmgt.rrd.rrdtool.MultithreadedJniRrdStrategy (RRDtool); if you are using JRobin (
org.opennms.rrd.strategyClass=org.opennms.netmgt.rrd.jrobin.JRobinRrdStrategy), then this will not work.
If you are using Newts, then the RRA configuration is not applicable. You can adjust the
org.opennms.newts.config.ttl property to increase the overall TTL for your data.