summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@dds.nl>2011-10-25 21:49:21 +0200
committerSeth Mos <seth.mos@dds.nl>2011-10-25 21:49:21 +0200
commiteb346e0b7e29ea2139798a2a4a7affa90cfabd3e (patch)
treeaf1a30b0c0f2365da8f4b53ef7b8df9890ff90f2 /etc
parent9f27de6d2f1a4d36190797db78bf1394e0ea0dcd (diff)
downloadpfsense-eb346e0b7e29ea2139798a2a4a7affa90cfabd3e.zip
pfsense-eb346e0b7e29ea2139798a2a4a7affa90cfabd3e.tar.gz
Ok, let's try not to corrupt the RRD files on upgrade. Leave the RRA arc
hives 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
Diffstat (limited to 'etc')
-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 efe8ae9..f5b1a17 100644
--- a/etc/inc/upgrade_config.inc
+++ b/etc/inc/upgrade_config.inc
@@ -2031,7 +2031,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 */
@@ -2056,7 +2056,12 @@ function upgrade_054_to_055() {
$rrdxml = dump_xml_config_raw($rrdxmlarray, "rrd");
file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", $rrdxml);
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