From 7b13ceef8f20b982f206910e92a1d6415a0c1bfc Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Fri, 29 Apr 2011 16:49:37 +0000 Subject: [PATCH] improve mac accounting (why was it in port? am i mental?) git-svn-id: http://www.observium.org/svn/observer/trunk@2201 61d68cd4-352d-0410-923a-c4978735b2b8 --- .../graphs/macaccounting/auth.inc.php | 26 +++++++++++++++++++ .../graphs/macaccounting/bits.inc.php | 11 +------- .../graphs/macaccounting/pkts.inc.php | 11 +------- html/pages/device/port/macaccounting.inc.php | 4 +-- html/pages/routing/bgp.inc.php | 4 +-- 5 files changed, 31 insertions(+), 25 deletions(-) create mode 100644 html/includes/graphs/macaccounting/auth.inc.php diff --git a/html/includes/graphs/macaccounting/auth.inc.php b/html/includes/graphs/macaccounting/auth.inc.php new file mode 100644 index 0000000000..147f13b088 --- /dev/null +++ b/html/includes/graphs/macaccounting/auth.inc.php @@ -0,0 +1,26 @@ + diff --git a/html/includes/graphs/macaccounting/bits.inc.php b/html/includes/graphs/macaccounting/bits.inc.php index 9afc3a321d..c1388be315 100644 --- a/html/includes/graphs/macaccounting/bits.inc.php +++ b/html/includes/graphs/macaccounting/bits.inc.php @@ -1,17 +1,8 @@ \ No newline at end of file +?> diff --git a/html/includes/graphs/macaccounting/pkts.inc.php b/html/includes/graphs/macaccounting/pkts.inc.php index 6bd849ae1a..8e5fa88702 100644 --- a/html/includes/graphs/macaccounting/pkts.inc.php +++ b/html/includes/graphs/macaccounting/pkts.inc.php @@ -1,14 +1,5 @@ \ No newline at end of file +?> diff --git a/html/pages/device/port/macaccounting.inc.php b/html/pages/device/port/macaccounting.inc.php index b2c1846d2d..5e1e1a3f7b 100644 --- a/html/pages/device/port/macaccounting.inc.php +++ b/html/pages/device/port/macaccounting.inc.php @@ -154,9 +154,9 @@ if ($_GET['optd'] == "top10") if ($_GET['optc']) { - $graph_type = "port_mac_acc_" . $_GET['optc']; + $graph_type = "macaccounting_" . $_GET['optc']; } else { - $graph_type = "port_mac_acc_bits"; + $graph_type = "macaccounting_bits"; } if ($_GET['optd'] == "thumbs") diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index ac23cfb824..aeb1271c1d 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -182,7 +182,7 @@ else { case 'macaccounting_bits': case 'macaccounting_pkts': - $acc = mysql_fetch_assoc(mysql_query("SELECT * FROM `ipv4_mac` AS I, mac_accounting AS M, ports AS P WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address AND P.interface_id = M.interface_id")); + $acc = mysql_fetch_assoc(mysql_query("SELECT * FROM `ipv4_mac` AS I, `mac_accounting` AS M, `ports` AS P, `devices` AS D WHERE I.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND M.mac = I.mac_address AND P.interface_id = M.interface_id AND D.device_id = P.device_id")); $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"; if (is_array($acc) && is_file($database)) { @@ -199,8 +199,6 @@ else $graph_array['height'] = "100"; $graph_array['width'] = "220"; $graph_array['to'] = $now; -# $graph_array['type'] = "bgp_" . $_GET['optc']; -# $graph_array['id'] = $peer['bgpPeer_id']; echo(''); include("includes/print-quadgraphs.inc.php"); echo("");