Project

General

Profile

« Previous | Next » 

Revision 2bba9aef

Added by Renato Botelho about 12 years ago

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

View differences:

etc/inc/upgrade_config.inc
3086 3086
				$config['interfaces'][$iface]['track6-prefix-id'] = 0;
3087 3087
}
3088 3088

  
3089
function upgrade_095_to_096() {
3090
	global $config, $g;
3091

  
3092
	$names = array("inpass", "outpass", "inblock", "outblock",
3093
		"inpass6", "outpass6", "inblock6", "outblock6");
3094
	$rrddbpath = "/var/db/rrd";
3095
	$rrdtool = "/usr/local/bin/rrdtool";
3096

  
3097
	/* Assume 2*10GigE for now */
3098
	$stream = 2500000000;
3099

  
3100
	/* build a list of traffic and packets databases */
3101
	$databases = return_dir_as_array($rrddbpath, '/-(traffic|packets)\.rrd$/');
3102
	rsort($databases);
3103
	foreach($databases as $database) {
3104
		if ($g['booting'])
3105
			echo "Update RRD database {$database}.\n";
3106

  
3107
		$cmd = "{$rrdtool} tune {$rrddbpath}/{$database}";
3108
		foreach ($names as $name)
3109
			$cmd .= " -a {$name}:{$stream}";
3110
		mwexec("{$cmd} 2>&1");
3111

  
3112
	}
3113
	enable_rrd_graphing();
3114
}
3115

  
3089 3116
?>

Also available in: Unified diff