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
This commit is contained in:
Adam Amstrong
2011-04-29 16:49:37 +00:00
parent 28558969c4
commit 7b13ceef8f
5 changed files with 31 additions and 25 deletions

View File

@@ -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")

View File

@@ -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('<tr bgcolor="'.$bg_colour.'"' . ($bg_image ? ' background="'.$bg_image.'"' : '') . '"><td colspan="9">');
include("includes/print-quadgraphs.inc.php");
echo("</td></tr>");