Merge pull request #2458 from laf/rrdtune

Fix for crazy traffic values seen in graphs
This commit is contained in:
Daniel Preussker
2015-12-08 16:12:22 +00:00
11 changed files with 168 additions and 38 deletions

View File

@@ -339,6 +339,7 @@ foreach ($ports as $port) {
}
// Update IF-MIB data
$tune_port = false;
foreach ($data_oids as $oid) {
if ($oid == 'ifAlias') {
@@ -358,6 +359,15 @@ foreach ($ports as $port) {
}
}
else if ($port[$oid] != $this_port[$oid]) {
$port_tune = get_dev_attrib($device, 'ifName_tune:'.$port['ifName']);
$device_tune = get_dev_attrib($device,'override_rrdtool_tune');
if ($port_tune == "true" ||
($device_tune == "true" && $port_tune != 'false') ||
($config['rrdtool_tune'] == "true" && $port_tune != 'false' && $device_tune != 'false')) {
if ($oid == 'ifSpeed') {
$tune_port = true;
}
}
$port['update'][$oid] = $this_port[$oid];
log_event($oid.': '.$port[$oid].' -> '.$this_port[$oid], $device, 'interface', $port['port_id']);
if ($debug) {
@@ -501,6 +511,9 @@ foreach ($ports as $port) {
'OUTMULTICASTPKTS' => $this_port['ifOutMulticastPkts'],
);
if ($tune_port === true) {
rrdtool_tune('port',$rrdfile,$this_port['ifSpeed']);
}
rrdtool_update("$rrdfile", $fields);
// End Update IF-MIB
// Update PAgP