Full | Compact "); $hostname = $device['hostname']; $hostid = $device['interface_id']; $ifname = $interface['ifDescr']; $ifIndex = $interface['ifIndex']; $speed = humanspeed($interface['ifSpeed']); $ifalias = $interface['name']; if($interface['ifPhysAddress']) { $mac = "$interface[ifPhysAddress]"; } $color = "black"; if ($interface['ifAdminStatus'] == "down") { $status = "Disabled"; } if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "down") { $status = "Enabled / Disconnected"; } if ($interface['ifAdminStatus'] == "up" && $interface['ifOperStatus'] == "up") { $status = "Enabled / Connected"; } $i = 1; $inf = fixifName($ifname); $bg="#ffffff"; $query = mysql_query("SELECT *, (M.bps_in + M.bps_out) as bps FROM `mac_accounting` AS M, `interfaces` AS I, `devices` AS D WHERE M.interface_id = '".$interface['interface_id']."' AND I.interface_id = M.interface_id AND I.device_id = D.device_id ORDER BY bps DESC"); echo("
"); while($acc = mysql_fetch_array($query)) { $addy = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_mac where mac_address = '".$acc['mac']."'")); $name = gethostbyaddr($addy['ipv4_address']); if($name == $addy['ipv4_address']) { unset ($name); } if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; } if(mysql_result(mysql_query("SELECT count(*) FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'"),0)) { $peer_query = mysql_query("SELECT * FROM bgpPeers WHERE device_id = '".$acc['device_id']."' AND bgpPeerIdentifier = '".$addy['ipv4_address']."'"); $peer_info = mysql_fetch_array($peer_query); } else { unset ($peer_info); } if($peer_info) { $asn = "AS".$peer_info['bgpPeerRemoteAs']; $astext = $peer_info['astext']; } else { unset ($as); unset ($astext); unset($asn); } if($_GET['optc'] == "thumbs") { if(!$asn) { $asn = "No Session"; } echo("
".$addy['ipv4_address']." - ".$asn." ".$name." - ".$addy['ipv4_address']." - ".$asn."
\ \ ', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 150);\" onmouseout=\"return nd();\" > ".$name."
"); } else { echo("
"); echo("
".mac_clean_to_readable($acc['mac'])." ".$addy['ipv4_address']." ".$name." ".formatRates($acc['bps_in'])." ".formatRates($acc['bps_out'])."
"); $peer_info['astext']; $graph_type = "mac_acc"; $daily_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=210&height=100"; $daily_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$day&to=$now&width=500&height=150"; $weekly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$week&to=$now&width=210&height=100"; $weekly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$week&to=$now&width=500&height=150"; $monthly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$month&to=$now&width=210&height=100"; $monthly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$month&to=$now&width=500&height=150"; $yearly_traffic = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$year&to=$now&width=210&height=100"; $yearly_url = "graph.php?id=" . $acc['ma_id'] . "&type=$graph_type&from=$year&to=$now&width=500&height=150"; echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); echo("', LEFT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"> "); echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> "); echo("', LEFT".$config['overlib_defaults'].", WIDTH, 350);\" onmouseout=\"return nd();\"> "); echo("
"); } } ?>