diff --git a/html/includes/graphs/bgp/prefixes.inc.php b/html/includes/graphs/bgp/prefixes.inc.php index 350342502..c6d568da3 100644 --- a/html/includes/graphs/bgp/prefixes.inc.php +++ b/html/includes/graphs/bgp/prefixes.inc.php @@ -4,8 +4,6 @@ include("includes/graphs/common.inc.php"); $scale_min = "0"; -$rrd_filename = $config['rrd_dir'] . "/" . $device['hostname'] . "/". safename("cbgp-" . $data['bgpPeerIdentifier'] . ".".$_GET['afi'].".".$_GET['safi'].".rrd"); - $rra = "AcceptedPrefixes"; $colour_area = "AA66AA"; diff --git a/html/includes/graphs/port/mac_acc_bits.inc.php b/html/includes/graphs/macaccounting/bits.inc.php similarity index 100% rename from html/includes/graphs/port/mac_acc_bits.inc.php rename to html/includes/graphs/macaccounting/bits.inc.php diff --git a/html/includes/graphs/port/mac_acc_pkts.inc.php b/html/includes/graphs/macaccounting/pkts.inc.php similarity index 100% rename from html/includes/graphs/port/mac_acc_pkts.inc.php rename to html/includes/graphs/macaccounting/pkts.inc.php diff --git a/html/pages/device/routing/bgp.inc.php b/html/pages/device/routing/bgp.inc.php index b629069b7..e9a423a03 100644 --- a/html/pages/device/routing/bgp.inc.php +++ b/html/pages/device/routing/bgp.inc.php @@ -105,7 +105,7 @@ while ($peer = mysql_fetch_assoc($peer_query)) $af_query = mysql_query("SELECT * FROM `bgpPeers_cbgp` WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '".$peer['bgpPeerIdentifier']."'"); unset($peer_af); - + unset($sep); while ($afisafi = mysql_fetch_assoc($af_query)) { $afi = $afisafi['afi']; diff --git a/html/pages/routing.inc.php b/html/pages/routing.inc.php index 620a921d7..fec16c52d 100644 --- a/html/pages/routing.inc.php +++ b/html/pages/routing.inc.php @@ -3,44 +3,56 @@ if (!$_GET['opta']) { $_GET['opta'] = "overview"; } if ($_GET['optb'] == "graphs" || $_GET['optc'] == "graphs") { $graphs = "graphs"; } else { $graphs = "nographs"; } -print_optionbar_start('', ''); +$datas[] = 'overview'; - echo('Routing » '); +$vrf_count = @mysql_result(mysql_query("SELECT COUNT(*) FROM `vrfs`"), 0); +if($vrf_count) { $datas[] = 'vrf'; } - if ($_GET['opta'] == "overview") { echo(""); } +$bgp_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `bgpPeers`"), 0); +if ($bgp_count) { $datas[] = 'bgp'; } - echo(" | "); +$cef_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `cef_switching`"), 0); +if ($cef_count) { $datas[] = 'cef'; } - ## Start BGP Menu -- FIXME only show if BGP enabled? - if ($_GET['opta'] == "bgp") { echo(""); } +$ospf_count = mysql_result(mysql_query("SELECT COUNT(*) FROM `ospf_instances`"), 0); +if ($ospf_count) { $datas[] = 'ospf'; } - echo(" | "); +$type_text['overview'] = "Overview"; +$type_text['bgp'] = "BGP"; +$type_text['cef'] = "CEF"; +$type_text['ospf'] = "OSPF"; +$type_text['vrf'] = "VRFs"; - ## Start OSPF Menu -- FIXME only show if BGP enabled? - if ($_GET['opta'] == "ospf") { echo(""); } +print_optionbar_start(); - echo(" | "); +if (!$_GET['opta']) { $_GET['opta'] = "overview"; } - ## Start VRF Menu -- FIXME only show if BGP enabled? - if ($_GET['opta'] == "vrf") { echo(""); } +echo("Routing » "); +unset($sep); +foreach ($datas as $type) +{ + echo($sep); + if ($_GET['opta'] == $type) + { + echo('"); } + $sep = " | "; +} + +print_optionbar_end(); switch ($_GET['opta']) { case 'overview': case 'bgp': case 'vrf': + case 'cef': + case 'ospf': include('pages/routing/'.$_GET['opta'].'.inc.php'); break; default: diff --git a/html/pages/routing/bgp.inc.php b/html/pages/routing/bgp.inc.php index 71a1b6058..ac23cfb82 100644 --- a/html/pages/routing/bgp.inc.php +++ b/html/pages/routing/bgp.inc.php @@ -11,6 +11,8 @@ else echo('BGP » '); + if(!$_GET['optb']) { $_GET['optb'] = "all"; } + if ($_GET['opta'] == "bgp" && $_GET['optb'] == "all") { echo(""); } @@ -34,42 +36,52 @@ else echo(''); ## End BGP Menu - if(!isset($graphs)) { $graphs == "nographs"; } - echo('
| Local address | Peer address | Type | Remote AS | State | Uptime | |||||
|---|---|---|---|---|---|---|---|---|---|---|
| Local address | Peer address | Type | Family | Remote AS | State | Uptime / Updates | ||||
| " . $localaddresslink . " ".generate_device_link($peer, shorthost($peer['hostname']), 'routing/bgp/')." |
- -> | +-> | " . $peeraddresslink . " | -$peer_type | +$peer_type | +".$peer['afi']." | AS" . $peer['bgpPeerRemoteAs'] . " " . $peer['astext'] . " |
" . $peer['bgpPeerAdminStatus'] . " " . $peer['bgpPeerState'] . " |
" .formatUptime($peer['bgpPeerFsmEstablishedTime']). " @@ -134,19 +163,47 @@ else " . format_si($peer['bgpPeerOutUpdates']) . " | |
| '); + switch ($_GET['optc']) + { + 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")); + $database = $config['rrd_dir'] . "/" . $device['hostname'] . "/cip-" . $acc['ifIndex'] . "-" . $acc['mac'] . ".rrd"; + if (is_array($acc) && is_file($database)) + { + $peer['graph'] = 1; + $graph_array['id'] = $acc['ma_id']; + $graph_array['type'] = $_GET['optc']; + } + } - include("includes/print-quadgraphs.inc.php"); + if ($_GET['optc'] == 'updates') { $peer['graph'] = 1; } - echo(" | ||||||||||
| '); + include("includes/print-quadgraphs.inc.php"); + echo(" | ||||||||||