summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsmos <seth.mos@dds.nl>2011-10-25 20:24:44 +0200
committersmos <seth.mos@dds.nl>2011-10-25 20:26:53 +0200
commitd7778a7b36ead2a6ae5a2d46568dd142509812a7 (patch)
tree158427bafe344213d263e28e7daa007a16ca008a
parent4d89e4d7818610aba44dceb3644cb2bb720bca30 (diff)
downloadpfsense-d7778a7b36ead2a6ae5a2d46568dd142509812a7.zip
pfsense-d7778a7b36ead2a6ae5a2d46568dd142509812a7.tar.gz
Ok, let's try not to corrupt the RRD files on upgrade. Leave the RRA archives for the 720 minutes average at 1000.
Then run a rrdtool resize command to grow the RRA by 1000 and 2000 for the 60 and 720 average respectively. Attempts to further fix ticket #1758
-rw-r--r--etc/inc/upgrade_config.inc9
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc
index a6af29e..1d51300 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2032,7 +2032,7 @@ function upgrade_054_to_055() {
$rrdcreate .= "RRA:AVERAGE:0.5:1:1000 ";
$rrdcreate .= "RRA:AVERAGE:0.5:5:1000 ";
$rrdcreate .= "RRA:AVERAGE:0.5:60:1000 ";
- $rrdcreate .= "RRA:AVERAGE:0.5:720:3000 ";
+ $rrdcreate .= "RRA:AVERAGE:0.5:720:1000 ";
create_new_rrd("$rrdcreate");
/* create temporary xml from new RRD */
@@ -2055,7 +2055,12 @@ function upgrade_054_to_055() {
$rrdxmlarray = migrate_rrd_format($rrdold, $rrdnew);
file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", dump_xml_config_raw($rrdxmlarray, "rrd"));
- mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1");
+ /* we now have the rrd with the new fields, adjust the size now. */
+ /* RRA 2 is 60 minutes, RRA 3 is 720 minutes */
+ mwexec("/bin/sync");
+ mwexec("$rrdtool resize {$rrddbpath}/{$database} 2 GROW 1000;/bin/mv resize.rrd {$rrddbpath}/{$database} 2>&1");
+ mwexec("/bin/sync");
+ mwexec("$rrdtool resize {$rrddbpath}/{$database} 3 GROW 2000;/bin/mv resize.rrd {$rrddbpath}/{$database}2>&1");
unset($rrdold);
unset($rrdnew);
unset($rrdxmlarray);
OpenPOWER on IntegriCloud