diff options
author | Renato Botelho <garga@FreeBSD.org> | 2013-05-29 10:45:46 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2013-05-29 10:47:43 -0300 |
commit | fa3b33a57e362654551a16a91a5c6b56971ad4c4 (patch) | |
tree | 173f9d805c9ee0b8367784540735f81f4fb1ca43 /etc/inc/upgrade_config.inc | |
parent | 7147fcde388219f14a4085de1c9b3a6bfdc1acea (diff) | |
download | pfsense-fa3b33a57e362654551a16a91a5c6b56971ad4c4.zip pfsense-fa3b33a57e362654551a16a91a5c6b56971ad4c4.tar.gz |
Fixes #2979
. Change max value for traffic and packets graphs to 20GigE
. Bump config version to 9.6
. Write a config upgrade function to tune current rrd files to the new
max value
Diffstat (limited to 'etc/inc/upgrade_config.inc')
-rw-r--r-- | etc/inc/upgrade_config.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index c17deee..da45129 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -3086,4 +3086,31 @@ function upgrade_094_to_095() { $config['interfaces'][$iface]['track6-prefix-id'] = 0; } +function upgrade_095_to_096() { + global $config, $g; + + $names = array("inpass", "outpass", "inblock", "outblock", + "inpass6", "outpass6", "inblock6", "outblock6"); + $rrddbpath = "/var/db/rrd"; + $rrdtool = "/usr/local/bin/rrdtool"; + + /* Assume 2*10GigE for now */ + $stream = 2500000000; + + /* build a list of traffic and packets databases */ + $databases = return_dir_as_array($rrddbpath, '/-(traffic|packets)\.rrd$/'); + rsort($databases); + foreach($databases as $database) { + if ($g['booting']) + echo "Update RRD database {$database}.\n"; + + $cmd = "{$rrdtool} tune {$rrddbpath}/{$database}"; + foreach ($names as $name) + $cmd .= " -a {$name}:{$stream}"; + mwexec("{$cmd} 2>&1"); + + } + enable_rrd_graphing(); +} + ?> |