Merge pull request #3800 from murrant/rrd-create-remote

RRD Cleanup: centralize rrd_exists check, utilize data_update() and rrd_name()
This commit is contained in:
Neil Lathwood
2016-08-10 18:44:45 +01:00
committed by GitHub
374 changed files with 2392 additions and 2960 deletions

View File

@@ -256,7 +256,7 @@ foreach (dbFetchRows("SELECT * FROM `bgpPeers` WHERE `device_id` = ? $extra_sql
case 'macaccounting_bits':
case 'macaccounting_pkts':
$acc = dbFetchRow('SELECT * FROM `ipv4_mac` AS I, `mac_accounting` AS M, `ports` AS P, `devices` AS D WHERE I.ipv4_address = ? AND M.mac = I.mac_address AND P.port_id = M.port_id AND D.device_id = P.device_id', array($peer['bgpPeerIdentifier']));
$database = $config['rrd_dir'].'/'.$device['hostname'].'/cip-'.$acc['ifIndex'].'-'.$acc['mac'].'.rrd';
$database = rrd_name($device['hostname'], array('cip', $acc['ifIndex'], $acc['mac']));
if (is_array($acc) && is_file($database)) {
$peer['graph'] = 1;
$graph_array['id'] = $acc['ma_id'];