initial commit; version 22.5.12042
This commit is contained in:
197
html/pages/device/routing/bgp.inc.php
Normal file
197
html/pages/device/routing/bgp.inc.php
Normal file
@ -0,0 +1,197 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium Network Management and Monitoring System
|
||||
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage webui
|
||||
* @author Adam Armstrong <adama@observium.org>
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
?>
|
||||
|
||||
<table class="table table-hover table-striped vertical-align">
|
||||
<tbody>
|
||||
<tr class="up">
|
||||
<td class="state-marker"></td>
|
||||
<td style="padding: 10px 14px;"><span style="font-size: 20px; color: #193d7f;">BGP AS<?php echo($device['human_local_as']); ?></span>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<?php
|
||||
|
||||
$sessions = array();
|
||||
foreach (dbFetchRows('SELECT `bgpPeer_id`,`local_as`,`bgpPeerState`,`bgpPeerAdminStatus`,`bgpPeerRemoteAs` FROM `bgpPeers` WHERE `device_id` = ?;', array($device['device_id'])) as $bgp)
|
||||
{
|
||||
$sessions['count']++;
|
||||
if ($bgp['bgpPeerAdminStatus'] === 'start' || $bgp['bgpPeerAdminStatus'] === 'running')
|
||||
{
|
||||
$sessions['enabled']++;
|
||||
if ($bgp['bgpPeerState'] !== 'established')
|
||||
{
|
||||
$sessions['alerts']++;
|
||||
} else {
|
||||
$sessions['connected']++;
|
||||
}
|
||||
} else {
|
||||
$sessions['shutdown']++;
|
||||
}
|
||||
if ($bgp['bgpPeerRemoteAs'] == $bgp['local_as'])
|
||||
{
|
||||
$sessions['internal']++;
|
||||
} else {
|
||||
$sessions['external']++;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
|
||||
<td style="text-align: right;">
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Total Sessions</strong></div>
|
||||
<div class="btn btn-sm btn-default"> <?php echo $sessions['count']+0; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Errored Sessions</strong></div>
|
||||
<div class="btn btn-sm btn-danger"> <?php echo $sessions['alerts']+0; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>iBGP</strong></div>
|
||||
<div class="btn btn-sm btn-info"> <?php echo $sessions['internal']+0; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>eBGP</strong></div>
|
||||
<div class="btn btn-sm btn-primary"> <?php echo $sessions['external']+0; ?></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
if (!isset($vars['view'])) { $vars['view'] = 'details'; }
|
||||
|
||||
unset($navbar);
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'bgp');
|
||||
|
||||
$types = array('all' => 'All',
|
||||
'internal' => 'iBGP',
|
||||
'external' => 'eBGP');
|
||||
|
||||
foreach ($types as $option => $text)
|
||||
{
|
||||
$navbar['options'][$option]['text'] = $text;
|
||||
if ($vars['type'] == $option || (empty($vars['type']) && $option == 'all'))
|
||||
{
|
||||
$navbar['options'][$option]['class'] .= " active";
|
||||
$bgp_options = array('type' => NULL);
|
||||
} else {
|
||||
$bgp_options = array('type' => $option);
|
||||
}
|
||||
if ($vars['adminstatus']) { $bgp_options['adminstatus'] = $vars['adminstatus']; }
|
||||
elseif ($vars['state']) { $bgp_options['state'] = $vars['state']; }
|
||||
$navbar['options'][$option]['url'] = generate_url($link_array, $bgp_options);
|
||||
}
|
||||
|
||||
$statuses = array('stop' => 'Shutdown',
|
||||
'start' => 'Enabled',
|
||||
'down' => 'Down');
|
||||
foreach ($statuses as $option => $text)
|
||||
{
|
||||
$status = ($option == 'down') ? 'state' : 'adminstatus';
|
||||
$navbar['options'][$option]['text'] = $text;
|
||||
if ($vars[$status] == $option)
|
||||
{
|
||||
$navbar['options'][$option]['class'] .= " active";
|
||||
$bgp_options = array($status => NULL);
|
||||
} else {
|
||||
$bgp_options = array($status => $option);
|
||||
}
|
||||
if ($vars['type']) { $bgp_options['type'] = $vars['type']; }
|
||||
$navbar['options'][$option]['url'] = generate_url($link_array, $bgp_options);
|
||||
}
|
||||
|
||||
$navbar['options_right']['details']['text'] = 'No Graphs';
|
||||
if ($vars['view'] === 'details') { $navbar['options_right']['details']['class'] .= ' active'; }
|
||||
$navbar['options_right']['details']['url'] = generate_url($vars, array('view' => 'details', 'graph' => 'NULL'));
|
||||
|
||||
$navbar['options_right']['updates']['text'] = 'Updates';
|
||||
if ($vars['graph'] === 'updates') { $navbar['options_right']['updates']['class'] .= ' active'; }
|
||||
$navbar['options_right']['updates']['url'] = generate_url($vars, array('view' => 'graphs', 'graph' => 'updates'));
|
||||
|
||||
/*
|
||||
$bgp_graphs = array();
|
||||
foreach ($device['graphs'] as $entry)
|
||||
{
|
||||
if (preg_match('/^bgp_(?<subtype>prefixes)_(?<afi>ipv[46])(?<safi>[a-z]+)/', $entry['graph'], $matches))
|
||||
{
|
||||
if (!isset($bgp_graphs[$matches['safi']]))
|
||||
{
|
||||
$bgp_graphs[$matches['safi']] = array('text' => nicecase($matches['safi']));
|
||||
}
|
||||
$bgp_graphs[$matches['safi']]['types'][$matches['subtype'].'_'.$matches['afi'].$matches['safi']] = nicecase($matches['afi']) . ' ' . nicecase($matches['safi']) . ' ' . nicecase($matches['subtype']);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$bgp_graphs = [
|
||||
'unicast' => array('text' => 'Unicast'),
|
||||
'multicast' => array('text' => 'Multicast'),
|
||||
'mac' => array('text' => 'MAC Accounting')
|
||||
];
|
||||
$bgp_graphs['unicast']['types'] = [
|
||||
'prefixes_ipv4unicast' => 'IPv4 Ucast Prefixes',
|
||||
'prefixes_ipv6unicast' => 'IPv6 Ucast Prefixes',
|
||||
'prefixes_ipv4vpn' => 'VPNv4 Prefixes'
|
||||
];
|
||||
$bgp_graphs['multicast']['types'] = [
|
||||
'prefixes_ipv4multicast' => 'IPv4 Mcast Prefixes',
|
||||
'prefixes_ipv6multicast' => 'IPv6 Mcast Prefixes'
|
||||
];
|
||||
$bgp_graphs['mac']['types'] = [
|
||||
'macaccounting_bits' => 'MAC Bits',
|
||||
'macaccounting_pkts' => 'MAC Pkts'
|
||||
];
|
||||
foreach ($bgp_graphs as $bgp_graph => $bgp_options)
|
||||
{
|
||||
$navbar['options_right'][$bgp_graph]['text'] = $bgp_options['text'];
|
||||
foreach ($bgp_options['types'] as $option => $text)
|
||||
{
|
||||
if ($vars['graph'] == $option)
|
||||
{
|
||||
$navbar['options_right'][$bgp_graph]['class'] .= ' active';
|
||||
$navbar['options_right'][$bgp_graph]['suboptions'][$option]['class'] = 'active';
|
||||
}
|
||||
$navbar['options_right'][$bgp_graph]['suboptions'][$option]['text'] = $text;
|
||||
$navbar['options_right'][$bgp_graph]['suboptions'][$option]['url'] = generate_url($vars, array('view' => 'graphs', 'graph' => $option));
|
||||
}
|
||||
}
|
||||
|
||||
$navbar['class'] = "navbar-narrow";
|
||||
$navbar['brand'] = "BGP";
|
||||
print_navbar($navbar);
|
||||
|
||||
// Pagination
|
||||
$vars['pagination'] = TRUE;
|
||||
|
||||
//r($cache['bgp']);
|
||||
print_bgp_peer_table($vars);
|
||||
|
||||
// EOF
|
121
html/pages/device/routing/cef.inc.php
Normal file
121
html/pages/device/routing/cef.inc.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium Network Management and Monitoring System
|
||||
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage webui
|
||||
* @author Adam Armstrong <adama@observium.org>
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'cef');
|
||||
|
||||
$navbar = array('brand' => "CEF", 'class' => "navbar-narrow");
|
||||
|
||||
$navbar['options']['basic']['text'] = 'Basic';
|
||||
// $navbar['options']['details']['text'] = 'Details';
|
||||
$navbar['options']['graphs'] = array('text' => 'Graphs', 'class' => 'pull-right', 'icon' => $config['icon']['graphs']);
|
||||
|
||||
foreach ($navbar['options'] as $option => $array)
|
||||
{
|
||||
if ($vars['view'] == $option) { $navbar['options'][$option]['class'] .= " active"; }
|
||||
$navbar['options'][$option]['url'] = generate_url($link_array,array('view' => $option));
|
||||
}
|
||||
|
||||
print_navbar($navbar);
|
||||
unset($navbar);
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
?>
|
||||
<table class="table table-condensed table-striped">
|
||||
<thead>
|
||||
<tr><th><a title="Physical hardware entity">Entity</a></th>
|
||||
<th><a title="Address Family">AFI</a></th>
|
||||
<th><a title="CEF Switching Path">Path</a></th>
|
||||
<th><a title="Number of packets dropped.">Drop</a></th>
|
||||
<th><a title="Number of packets that could not be switched in the normal path and were punted to the next-fastest switching vector.">Punt</a></th>
|
||||
<th><a title="Number of packets that could not be switched in the normal path and were punted to the host.<br />For switch paths other than a centralized turbo switch path, punt and punt2host function the same way. With punt2host from a centralized turbo switch path (PAS and RSP), punt will punt the packet to LES, but punt2host will bypass LES and punt directly to process switching.">Punt2Host</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<?php
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `cef_switching` WHERE `device_id` = ? ORDER BY `entPhysicalIndex`, `afi`, `cef_index`", array($device['device_id'])) as $cef)
|
||||
{
|
||||
|
||||
$entity = dbFetchRow("SELECT * FROM `entPhysical` WHERE device_id = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $cef['entPhysicalIndex']));
|
||||
|
||||
$interval = $cef['updated'] - $cef['updated_prev'];
|
||||
|
||||
if (!$entity['entPhysicalModelName'] && $entity['entPhysicalContainedIn'])
|
||||
{
|
||||
$parent_entity = dbFetchRow("SELECT * FROM `entPhysical` WHERE device_id = ? AND `entPhysicalIndex` = ?", array($device['device_id'], $entity['entPhysicalContainedIn']));
|
||||
$entity_name = $entity['entPhysicalName'] . " (" . $parent_entity['entPhysicalModelName'] .")";
|
||||
} else {
|
||||
$entity_name = $entity['entPhysicalName'] . " (" . $entity['entPhysicalModelName'] .")";
|
||||
}
|
||||
|
||||
echo('<tr bgcolor="'.$bg_colour.'"><td class="entity">'.$entity_name.'</td>
|
||||
<td>');
|
||||
if ($cef['afi'] == "ipv4") { echo '<span class="label label-success">IPv4</span>'; } elseif($cef['afi'] == "ipv6") { echo '<span class="label label-info">IPv6</span>'; } else { echo $cef['afi']; }
|
||||
|
||||
echo("</td>
|
||||
<td>");
|
||||
|
||||
switch ($cef['cef_path']) {
|
||||
case "RP RIB":
|
||||
echo '<a title="Process switching with CEF assistance."><span class="label label-error">RP RIB</span></a>';
|
||||
break;
|
||||
case "RP LES":
|
||||
echo '<a title="Low-end switching. Centralized CEF switch path."><span class="label label-success">RP LES</span></a>';
|
||||
break;
|
||||
case "RP PAS":
|
||||
echo '<a title="CEF turbo switch path."><span class="label label-info">RP PAS</span></a>';
|
||||
break;
|
||||
default:
|
||||
echo '<span class="label">'.$cef['cef_path'].'</span>';
|
||||
}
|
||||
|
||||
echo("</td>");
|
||||
echo("<td>".format_si($cef['drop']));
|
||||
if ($cef['drop'] > $cef['drop_prev']) { echo(" <span style='color:red;'>(".round(($cef['drop']-$cef['drop_prev'])/$interval,2)."/sec)</span>"); }
|
||||
echo("</td>");
|
||||
echo("<td>".format_si($cef['punt']));
|
||||
if ($cef['punt'] > $cef['punt_prev']) { echo(" <span style='color:red;'>(".round(($cef['punt']-$cef['punt_prev'])/$interval,2)."/sec)</span>"); }
|
||||
echo("</td>");
|
||||
echo("<td>".format_si($cef['punt2host']));
|
||||
if ($cef['punt2host'] > $cef['punt2host_prev']) { echo(" <span style='color:red;'>(".round(($cef['punt2host']-$cef['punt2host_prev'])/$interval,2)."/sec)</span>"); }
|
||||
echo("</td>");
|
||||
|
||||
echo("</tr>
|
||||
");
|
||||
|
||||
if ($vars['view'] == "graphs")
|
||||
{
|
||||
$graph_array['height'] = "100";
|
||||
$graph_array['width'] = "215";
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $cef['cef_switching_id'];
|
||||
$graph_array['type'] = "cefswitching_graph";
|
||||
|
||||
echo("<tr bgcolor='$bg_colour'><td colspan=6>");
|
||||
|
||||
print_graph_row($graph_array);
|
||||
|
||||
echo("</td></tr>");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo("</table>");
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
// EOF
|
123
html/pages/device/routing/eigrp.inc.php
Normal file
123
html/pages/device/routing/eigrp.inc.php
Normal file
@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium Network Management and Monitoring System
|
||||
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage webui
|
||||
* @author Adam Armstrong <adama@observium.org>
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$navbar = array();
|
||||
$navbar['brand'] = "EIGRP";
|
||||
$navbar['class'] = "navbar-narrow";
|
||||
|
||||
if (!$vars['view']) { $vars['view'] = "ports"; }
|
||||
|
||||
foreach (array("vpn", "asn", "ports", "peers") as $type)
|
||||
{
|
||||
$navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'routing', 'proto' => 'eigrp', 'view' => $type ));
|
||||
$navbar['options'][$type]['text'] = nicecase($type);
|
||||
if ($vars['view'] == $type) { $navbar['options'][$type]['class'] = "active"; }
|
||||
}
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `eigrp_vpns` WHERE `device_id` = ?", array($device['device_id'])) as $entry)
|
||||
{
|
||||
|
||||
if(!isset($vars['vpn']))
|
||||
{
|
||||
$vars['vpn'] = $entry['eigrp_vpn'];
|
||||
}
|
||||
|
||||
if($vars['vpn'] == $entry['eigrp_vpn']) { $navbar['options']['vpn']['text'] .= " (" . $entry['eigrp_vpn_name'].")"; }
|
||||
$navbar['options']['vpn']['suboptions'][$entry['eigrp_vpn_name']]['text'] = $entry['eigrp_vpn_name'];
|
||||
$navbar['options']['vpn']['suboptions'][$entry['eigrp_vpn_name']]['url'] = generate_url($vars, array('vpn' => $entry['eigrp_vpn'],'asn' => NULL));
|
||||
|
||||
}
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `eigrp_ases` WHERE `device_id` = ? AND `eigrp_vpn` = ?", array($device['device_id'], $vars['vpn'])) as $entry)
|
||||
{
|
||||
|
||||
if(!isset($vars['asn']))
|
||||
{
|
||||
$vars['asn'] = $entry['eigrp_as'];
|
||||
}
|
||||
|
||||
if($vars['asn'] == $entry['eigrp_as']) { $navbar['options']['asn']['text'] .= " (" . $entry['eigrp_as'].")"; }
|
||||
$navbar['options']['asn']['suboptions'][$entry['eigrp_as']]['text'] = "AS".$entry['eigrp_as'];
|
||||
$navbar['options']['asn']['suboptions'][$entry['eigrp_as']]['url'] = generate_url($vars, array('asn' => $entry['eigrp_as']));
|
||||
|
||||
}
|
||||
|
||||
$navbar['options_right']['graphs'] = array( 'text' => "Graphs",
|
||||
'icon' => $config['icon']['graphs'],
|
||||
'url' => generate_url($vars, array('graphs' => ($vars['graphs'] == 'yes' ? NULL : 'yes'))),
|
||||
'class' => ($vars['graphs'] == 'yes' ? 'active' : NULL));
|
||||
|
||||
print_navbar($navbar);
|
||||
unset($navbar);
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `eigrp_ases` LEFT JOIN `eigrp_vpns` USING (`device_id`, `eigrp_vpn`) WHERE `device_id` =? AND `eigrp_vpn` = ? AND `eigrp_as` = ? ", array($device['device_id'], $vars['vpn'], $vars['asn'])) as $as)
|
||||
{
|
||||
|
||||
$port_count = dbFetchCell("SELECT COUNT(*) FROM `eigrp_ports` WHERE device_id = ? AND `eigrp_vpn` = ? AND `eigrp_as` = ?", array($as['device_id'], $as['eigrp_vpn'], $as['eigrp_as']));
|
||||
$peer_count = dbFetchCell("SELECT COUNT(*) FROM `eigrp_peers` WHERE device_id = ? AND `eigrp_vpn` = ? AND `eigrp_as` = ?", array($as['device_id'], $as['eigrp_vpn'], $as['eigrp_as']));
|
||||
|
||||
?>
|
||||
|
||||
<table class="table table-hover table-striped vertical-align">
|
||||
<tbody>
|
||||
<tr class="up">
|
||||
<td class="state-marker"></td>
|
||||
<td style="padding: 10px 14px; width: 500px"><span style="font-size: 20px; color: #193d7f;">VPN <?php echo $as['eigrp_vpn_name']; ?> / AS<?php echo($as['eigrp_as']); ?></span></td>
|
||||
<td>
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Router ID</strong></div>
|
||||
<div class="btn btn-sm btn-default"> <?php echo $as['cEigrpAsRouterId']; ?></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td style="text-align: right;">
|
||||
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Ports</strong></div>
|
||||
<div class="btn btn-sm btn-danger"> <?php echo $port_count; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Neighbours</strong></div>
|
||||
<div class="btn btn-sm btn-info"> <?php echo $as['cEigrpNbrCount']; ?></div>
|
||||
</div>
|
||||
|
||||
<div class="btn-group" style="margin: 5px;">
|
||||
<div class="btn btn-sm btn-default"><strong>Routes</strong></div>
|
||||
<div class="btn btn-sm btn-primary"> <?php echo $as['cEigrpTopoRoutes']; ?></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
switch($vars['view'])
|
||||
{
|
||||
case "ports":
|
||||
case "peers":
|
||||
include("eigrp/".$vars['view'].".inc.php");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// EOF
|
78
html/pages/device/routing/eigrp/peers.inc.php
Normal file
78
html/pages/device/routing/eigrp/peers.inc.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Ports
|
||||
// Print table of EIGRP interfaces from eigrp_ports.
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
echo '<table class="table table-hover table-striped-two table-condensed ">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th class="state-marker"></th><th></th><th>Local Port</th><th>Peer Device</th><th>Peer Port</th><th>Uptime</th><th>SRTT</th><th>RTO</th><th>Version</th></th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `eigrp_peers` WHERE `device_id` = ? AND `eigrp_vpn` = ? AND `eigrp_as` = ?", array($device['device_id'], $vars['vpn'], $vars['asn'])) AS $peer)
|
||||
{
|
||||
|
||||
//print_vars($peer);
|
||||
|
||||
$peer['local_port'] = get_port_by_ifIndex($device['device_id'], $peer['peer_ifindex']);
|
||||
|
||||
$ip = dbFetchRow("SELECT * FROM `ipv4_addresses` WHERE `ipv4_address` = ?", array($peer['peer_addr']));
|
||||
if(is_array($ip))
|
||||
{
|
||||
$peer['port'] = get_port_by_id_cache($ip['port_id']);
|
||||
|
||||
$peer['device'] = device_by_id_cache($peer['port']['device_id']);
|
||||
}
|
||||
|
||||
echo '<tr class="'.$port['row_class'].'" onclick="openLink(\'' . generate_port_url($port) . '/\')" style="cursor: pointer;">';
|
||||
|
||||
echo '
|
||||
<td class="state-marker"></td>
|
||||
<td style="width: 1px;"></td>
|
||||
<td><span class="entity-title">'.(is_array($peer['local_port']) ? generate_port_link($peer['local_port']) : 'Unknown').'</span><br />'.$peer['local_port']['ifAlias'].'</td>
|
||||
<td>'.$peer['peer_addr'].'<br /><span class="entity-title">'.(is_array($peer['device']) ? generate_device_link($peer['device']) : '').'</span></td>
|
||||
<td><span class="entity-title">'.(is_array($peer['port']) ? generate_port_link($peer['port']) : '').'</span><br />
|
||||
'.$peer['port']['ifAlias'].'</td>
|
||||
<td>'.format_uptime($peer['peer_uptime']).'</td>
|
||||
<td>'.$peer['peer_srtt'].'ms</td>
|
||||
<td>'.$peer['peer_rto'].'ms</td>
|
||||
<td>'.$peer['peer_version'].'</td>
|
||||
';
|
||||
|
||||
echo '</tr>';
|
||||
|
||||
if (get_var_true($vars['graphs'])) {
|
||||
echo '<tr>
|
||||
<td class="state-marker"></td>
|
||||
<td colspan=8>';
|
||||
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $peer['eigrp_peer_id'];
|
||||
$graph_array['type'] = 'eigrppeer_graph';
|
||||
|
||||
print_graph_row($graph_array);
|
||||
|
||||
echo('</td></tr>');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
// EOF
|
||||
|
62
html/pages/device/routing/eigrp/ports.inc.php
Normal file
62
html/pages/device/routing/eigrp/ports.inc.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
// Ports
|
||||
// Print table of EIGRP interfaces from eigrp_ports.
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
echo '<table class="table table-hover table-striped-two table-condensed ">';
|
||||
echo '<thead>';
|
||||
echo '<tr><th class="state-marker"></th><th></th><th>Port</th><th>AS</th><th>Peers</th><th>Mean SRTT</th><th>Auth</th></tr>';
|
||||
echo '</thead>';
|
||||
echo '<tbody>';
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `eigrp_ports` WHERE `device_id` = ? AND `eigrp_vpn` = ? AND `eigrp_as` = ?", array($device['device_id'], $vars['vpn'], $vars['asn'])) AS $eigrp_port)
|
||||
{
|
||||
|
||||
$port = get_port_by_id($eigrp_port['port_id']);
|
||||
echo '<tr class="' . $port['row_class'] . '" onclick="openLink(\'' . generate_port_url($port) . '/\')" style="cursor: pointer;">
|
||||
|
||||
<td class="state-marker"></td>
|
||||
<td style="width: 1px;"></td>
|
||||
<td><span class="entity-title">' . generate_port_link($port) . '</span><br />
|
||||
' . $port['ifAlias'] . '</td>
|
||||
<td>' . $eigrp_port['eigrp_as'] . '</td>
|
||||
<td>' . $eigrp_port['eigrp_peer_count'] . '</td>
|
||||
<td>' . $eigrp_port['eigrp_MeanSrtt'] . '</td>
|
||||
<td>' . $eigrp_port['eigrp_authmode'] . '</td>
|
||||
</tr>';
|
||||
|
||||
if (get_var_true($vars['graphs'])) {
|
||||
echo '
|
||||
<tr>
|
||||
<td class="state-marker"></td>
|
||||
<td colspan=6>';
|
||||
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
$graph_array['id'] = $eigrp_port['eigrp_port_id'];
|
||||
$graph_array['type'] = 'eigrpport_packets';
|
||||
|
||||
print_graph_row($graph_array);
|
||||
|
||||
echo '</td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</tbody>';
|
||||
echo '</table>';
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
// EOF
|
||||
|
157
html/pages/device/routing/ipsec_tunnels.inc.php
Normal file
157
html/pages/device/routing/ipsec_tunnels.inc.php
Normal file
@ -0,0 +1,157 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
if (!isset($vars['view'])) { $vars['view'] = 'details'; }
|
||||
unset($navbar);
|
||||
|
||||
$link_array = array('page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'ipsec_tunnels');
|
||||
|
||||
$navbar['options_right']['details']['text'] = 'No Graphs';
|
||||
if ($vars['view'] == 'details') { $navbar['options_right']['details']['class'] .= ' active'; }
|
||||
$navbar['options_right']['details']['url'] = generate_url($vars, array('view' => 'details', 'graph' => 'NULL'));
|
||||
|
||||
$navbar['options_right']['bits']['text'] = 'Bits';
|
||||
if ($vars['graph'] == 'bits') { $navbar['options_right']['bits']['class'] .= ' active'; }
|
||||
$navbar['options_right']['bits']['url'] = generate_url($vars, array('view' => 'graphs', 'graph' => 'bits'));
|
||||
|
||||
$navbar['options_right']['pkts']['text'] = 'Packets';
|
||||
if ($vars['graph'] == 'pkts') { $navbar['options_right']['pkts']['class'] .= ' active'; }
|
||||
$navbar['options_right']['pkts']['url'] = generate_url($vars, array('view' => 'graphs', 'graph' => 'pkts'));
|
||||
|
||||
$navbar['class'] = 'navbar-narrow';
|
||||
$navbar['brand'] = 'IPSec Tunnels';
|
||||
print_navbar($navbar);
|
||||
|
||||
switch ($vars['view'])
|
||||
{
|
||||
case 'bits':
|
||||
case 'pkts':
|
||||
$table_class = 'table-striped-two';
|
||||
break;
|
||||
default:
|
||||
$table_class = 'table-striped';
|
||||
}
|
||||
|
||||
echo generate_box_open();
|
||||
echo '<table class="table table-hover '.$table_class.' table-condensed ">';
|
||||
|
||||
// <thead><tr><th class="state-marker"></th><th>Local address</th><th></th><th>Peer address</th><th>Tunnel name</th><th>State</th></tr></thead>');
|
||||
|
||||
|
||||
$cols = array(
|
||||
array(NULL, 'class="state-marker"'),
|
||||
'local_addr' => array('Local Address', 'style="width: 10%;"'),
|
||||
array('', 'style="width: 30px;"'),
|
||||
'peer_addr' => array('Peer Address', 'style="width: 10%;"'),
|
||||
'tun_name' => array('Tunnel Name'),
|
||||
'tun_end' => array('End points', 'style="width: 20%;"'),
|
||||
'tun_lifetime' => array('Lifetime', 'style="width: 100px;"'),
|
||||
'ike_alive' => array('IKE Alive', 'style="width: 60px;"'),
|
||||
'ike_lifetime' => array('IKE Lifetime', 'style="width: 100px;"'),
|
||||
'added' => array('Added', 'style="width: 120px;"'),
|
||||
);
|
||||
|
||||
echo get_table_header($cols, $vars);
|
||||
|
||||
$where = 'WHERE 1';
|
||||
$order = '';
|
||||
if ($vars['deleted'] != 1)
|
||||
{
|
||||
$where .= ' AND `tunnel_deleted` = 0';
|
||||
} else {
|
||||
$order .= '`tunnel_deleted`,';
|
||||
}
|
||||
$where .= ' AND `device_id` = ? AND `peer_addr` != ?';
|
||||
$query = "SELECT * FROM `ipsec_tunnels` $where ORDER BY $order `tunnel_added` DESC, `peer_addr`";
|
||||
|
||||
foreach (dbFetchRows($query, array($device['device_id'], '')) as $tunnel)
|
||||
{
|
||||
|
||||
if ($tunnel['tunnel_status'] == 'active')
|
||||
{
|
||||
$tunnel['label_class'] = 'label-success';
|
||||
if ($tunnel['tunnel_ike_alive'] != 'true')
|
||||
{
|
||||
$tunnel['row_class'] = 'warning';
|
||||
} else {
|
||||
$tunnel['row_class'] = '';
|
||||
}
|
||||
} else {
|
||||
$tunnel['label_class'] = 'label-error';
|
||||
$tunnel['row_class'] = 'error';
|
||||
}
|
||||
if ($tunnel['tunnel_ike_alive'] == 'true')
|
||||
{
|
||||
$tunnel['ike_label_class'] = 'label-success';
|
||||
} else {
|
||||
$tunnel['ike_label_class'] = 'label-error';
|
||||
}
|
||||
if ($tunnel['deleted'])
|
||||
{
|
||||
$tunnel['row_class'] = 'disabled';
|
||||
}
|
||||
|
||||
// FIXME - Solves leading zeros in IPs - This should maybe be in ipsec polling instead
|
||||
//$local_addr = preg_replace('/\b0+\B/','',$tunnel['local_addr']);
|
||||
//$peer_addr = preg_replace('/\b0+\B/','',$tunnel['peer_addr']);
|
||||
$tunnel_endpoint = array();
|
||||
foreach (json_decode($tunnel['tunnel_endpoint'], TRUE) as $entry)
|
||||
{
|
||||
$tunnel_endpoint[] = 'Local: ' . generate_popup_link('ip', $entry['local']) .
|
||||
', Remote: ' . generate_popup_link('ip', $entry['remote']);
|
||||
}
|
||||
$tunnel_endpoint = implode('<br />', $tunnel_endpoint);
|
||||
|
||||
$timediff = $GLOBALS['config']['time']['now'] - $tunnel['tunnel_added'];
|
||||
echo('<tr class="'.$tunnel['row_class'].'">
|
||||
<td class="state-marker"></td>
|
||||
<td>' . generate_popup_link('ip', $tunnel['local_addr']) . '</td>
|
||||
<td><b>»</b></td>
|
||||
<td>' . generate_popup_link('ip', $tunnel['peer_addr']) . '</td>
|
||||
<td>' . $tunnel['tunnel_name'] . '</td>
|
||||
<td><span class="text-nowrap">' . $tunnel_endpoint . '</span></td>
|
||||
<td><span>' . generate_tooltip_link(NULL, format_uptime($tunnel['tunnel_lifetime'], 'short-3'), $tunnel['tunnel_lifetime'] . ' sec') . '</span></td>
|
||||
<td><span class="label '.$tunnel['ike_label_class'].'">' . $tunnel['tunnel_ike_alive'] . '</span></td>
|
||||
<td><span>' . generate_tooltip_link(NULL, format_uptime($tunnel['tunnel_ike_lifetime'], 'short-3'), $tunnel['tunnel_ike_lifetime'] . ' sec') . '</span></td>
|
||||
<td><span>' . generate_tooltip_link(NULL, format_uptime($timediff, "short-3"). ' ago', format_unixtime($tunnel['tunnel_added'])) . '</span></td>
|
||||
</tr>');
|
||||
|
||||
switch ($vars['graph'])
|
||||
{
|
||||
case 'bits':
|
||||
case 'pkts':
|
||||
$graph_array['type'] = 'ipsectunnel_' . $vars['graph'];
|
||||
$graph_array['id'] = $tunnel['tunnel_id'];
|
||||
}
|
||||
|
||||
if ($vars['graph'] == 'bits' || $vars['graph'] == 'pkts') { $tunnel['graph'] = 1; }
|
||||
|
||||
if ($tunnel['graph'])
|
||||
{
|
||||
$graph_array['to'] = $config['time']['now'];
|
||||
|
||||
echo('<tr class="'.$tunnel['row_class'].'">');
|
||||
echo('<td colspan="10">');
|
||||
|
||||
print_graph_row($graph_array);
|
||||
|
||||
echo('</td></tr>');
|
||||
}
|
||||
}
|
||||
|
||||
echo('</table>');
|
||||
echo generate_box_close();
|
||||
|
||||
// EOF
|
181
html/pages/device/routing/ospf.inc.php
Normal file
181
html/pages/device/routing/ospf.inc.php
Normal file
@ -0,0 +1,181 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Observium Network Management and Monitoring System
|
||||
* Copyright (C) 2006-2015, Adam Armstrong - http://www.observium.org
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage webui
|
||||
* @author Adam Armstrong <adama@observium.org>
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
register_html_title("OSPF");
|
||||
|
||||
$navbar = array();
|
||||
$navbar['brand'] = "OSPF";
|
||||
$navbar['class'] = "navbar-narrow";
|
||||
|
||||
$ospf_instances = dbFetchRows("SELECT * FROM `ospf_instances` WHERE `device_id` = ?", array($device['device_id']));
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
echo '<table class="table table-hover table-striped table-condensed">';
|
||||
|
||||
// Loop Instances (There can only ever really be once instance at the moment, thanks to douchebags who decided we should use undiscoverable context names instead of just making tables.)
|
||||
|
||||
foreach ($ospf_instances as $instance)
|
||||
{
|
||||
|
||||
$area_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = ?", array($device['device_id']));
|
||||
$port_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = ?", array($device['device_id']));
|
||||
$port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = ?", array($device['device_id']));
|
||||
$nbr_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = ?", array($device['device_id']));
|
||||
|
||||
$query = "SELECT * FROM `ipv4_addresses` WHERE `ipv4_address` = ? AND `device_id` = ?";
|
||||
//$query .= "(A.ipv4_address = ? AND I.port_id = A.port_id)";
|
||||
//$query .= " AND I.device_id = ?";
|
||||
$ipv4_host = dbFetchRow($query, array($peer['bgpPeerIdentifier'], $device['device_id']));
|
||||
|
||||
if ($instance['ospfAdminStat'] == "enabled") { $enabled = '<span class="green">enabled</span>';
|
||||
$row_class = 'up'; } else { $enabled = '<span class="grey">disabled</span>';
|
||||
$row_class = "disabled"; }
|
||||
if ($instance['ospfAreaBdrRtrStatus'] == "true") { $abr = '<span class="green">yes</span>'; } else { $abr = '<span class="grey">no</span>'; }
|
||||
if ($instance['ospfASBdrRtrStatus'] == "true") { $asbr = '<span class="green">yes</span>'; } else { $asbr = '<span class="grey">no</span>'; }
|
||||
|
||||
echo('<thead><tr><th class="state-marker"></th><th>Router Id</th><th>Status</th><th>ABR</th><th>ASBR</th><th>Areas</th><th>Ports</th><th>Neighbours</th></tr></thead>');
|
||||
echo('<tr class="'.$row_class.'">');
|
||||
echo(' <td class="state-marker"></td>');
|
||||
echo(' <td class="entity-title">'.$instance['ospfRouterId'] . '</td>');
|
||||
echo(' <td>' . $enabled . '</td>');
|
||||
echo(' <td>' . $abr . '</td>');
|
||||
echo(' <td>' . $asbr . '</td>');
|
||||
echo(' <td>' . $area_count . '</td>');
|
||||
echo(' <td>' . $port_count . '('.$port_count_enabled.')</td>');
|
||||
echo(' <td>' . $nbr_count . '</td>');
|
||||
echo('</tr>');
|
||||
|
||||
echo '</table>';
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
|
||||
/// Global Areas Table
|
||||
/// FIXME -- humanize_ospf_area()
|
||||
|
||||
echo generate_box_open(array('title' => 'Areas'));
|
||||
|
||||
|
||||
echo('<table class="table table-hover table-striped">');
|
||||
echo('<thead><tr><th class="state-marker"></th><th>Area Id</th><th>Status</th><th>Auth Type</th><th>AS External</th><th>Area LSAs</th><th>Area Summary</th><th>Ports</th></tr></thead>');
|
||||
|
||||
/// Loop Areas
|
||||
foreach (dbFetchRows("SELECT * FROM `ospf_areas` WHERE `device_id` = ?", array($device['device_id'])) as $area)
|
||||
{
|
||||
|
||||
$area_port_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = ? AND `ospfIfAreaId` = ?", array($device['device_id'], $area['ospfAreaId']));
|
||||
$area_port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = ? AND `ospfIfAreaId` = ?", array($device['device_id'], $area['ospfAreaId']));
|
||||
|
||||
echo('<tr class="'.$area_row_class.'">');
|
||||
echo(' <td class="state-marker"></td>');
|
||||
echo(' <td class="entity-title">'.$area['ospfAreaId'] . '</td>');
|
||||
echo(' <td>' . $enabled . '</td>');
|
||||
echo ' <td>' . $area['ospfAuthType'] . '</td>';
|
||||
echo ' <td>' . $area['ospfImportAsExtern'] . '</td>';
|
||||
echo ' <td>' . $area['ospfAreaLsaCount'] . '</td>';
|
||||
echo ' <td>' . $area['ospfAreaSummary'] . '</td>';
|
||||
echo(' <td>' . $area_port_count . '('.$area_port_count_enabled.')</td>');
|
||||
echo('</tr>');
|
||||
|
||||
echo('<tr>');
|
||||
echo('<td colspan=8>');
|
||||
|
||||
/// Per-Area Ports Table
|
||||
/// FIXME -- humanize_ospf_port()
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
echo('<table class="table table-hover table-striped table-condensed ">');
|
||||
echo('<thead><tr><th class="state-marker"></th><th>Port</th><th>Status</th><th>Port Type</th><th>Port State</th></tr></thead>');
|
||||
|
||||
///# Loop Ports
|
||||
$p_sql = "SELECT * FROM `ospf_ports` AS O, `ports` AS P WHERE O.`ospfIfAdminStat` = 'enabled' AND O.`device_id` = ? AND O.`ospfIfAreaId` = ? AND P.port_id = O.port_id";
|
||||
foreach (dbFetchRows($p_sql, array($device['device_id'], $area['ospfAreaId'])) as $ospfport)
|
||||
{
|
||||
|
||||
if ($ospfport['ospfIfAdminStat'] == "enabled")
|
||||
{
|
||||
$port_enabled = '<span class="green">enabled</span>';
|
||||
$port_row_class = 'up';
|
||||
} else {
|
||||
$port_enabled = '<span class="green">disabled</span>';
|
||||
$port_row_class = 'disabled';
|
||||
}
|
||||
|
||||
echo('<tr class="'.$port_row_class.'">');
|
||||
echo(' <td class="state-marker"></td>');
|
||||
echo(' <td><strong>'. generate_port_link($ospfport) . '</strong></td>');
|
||||
echo(' <td>' . $port_enabled . '</td>');
|
||||
echo(' <td>' . $ospfport['ospfIfType'] . '</td>');
|
||||
echo(' <td>' . $ospfport['ospfIfState'] . '</td>');
|
||||
echo('</tr>');
|
||||
|
||||
$i_p++;
|
||||
} // End loop Ports
|
||||
|
||||
echo('</table>');
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
} // End loop areas
|
||||
echo '</table>';
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
|
||||
/// Global Neighbour Table
|
||||
/// FIXME -- humanize_ospf_neighbour()
|
||||
|
||||
echo generate_box_open(array('title' => 'Neighbours'));
|
||||
|
||||
echo '<table class="table table-condensed table-hover table-striped">';
|
||||
echo '<thead><tr><th class="state-marker"></th><th>Router Id</th><th>Device</th><th>IP Address</th><th>Status</th></tr></thead>';
|
||||
|
||||
// Loop Neigbours
|
||||
foreach (dbFetchRows("SELECT * FROM `ospf_nbrs` WHERE `device_id` = ?", array($device['device_id'])) as $nbr)
|
||||
{
|
||||
$host = dbFetchRow("SELECT * FROM ipv4_addresses AS A, ports AS I, devices AS D WHERE A.ipv4_address = ? AND I.port_id = A.port_id AND D.device_id = I.device_id", array($nbr['ospfNbrRtrId']));
|
||||
|
||||
if (is_array($host)) { $rtr_id = generate_device_link($host); } else { $rtr_id = "unknown"; }
|
||||
|
||||
echo('<tr class="' . $port_row_class . '">');
|
||||
echo(' <td class="state-marker"></td>');
|
||||
echo(' <td><span class="entity-title">' . $nbr['ospfNbrRtrId'] . '</span></td>');
|
||||
echo(' <td>' . $rtr_id . '</td>');
|
||||
echo(' <td>' . $nbr['ospfNbrIpAddr'] . '</td>');
|
||||
echo(' <td>');
|
||||
switch ($nbr['ospfNbrState'])
|
||||
{
|
||||
case 'full':
|
||||
echo('<span class="green">'.$nbr['ospfNbrState'].'</span>');
|
||||
break;
|
||||
case 'down':
|
||||
echo('<span class="red">'.$nbr['ospfNbrState'].'</span>');
|
||||
break;
|
||||
default:
|
||||
echo('<span class="blue">'.$nbr['ospfNbrState'].'</span>');
|
||||
break;
|
||||
}
|
||||
echo('</td>');
|
||||
echo('</tr>');
|
||||
|
||||
}
|
||||
|
||||
echo('</table>');
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
} // End loop instances
|
||||
|
||||
// EOF
|
62
html/pages/device/routing/vrf.inc.php
Normal file
62
html/pages/device/routing/vrf.inc.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Observium
|
||||
*
|
||||
* This file is part of Observium.
|
||||
*
|
||||
* @package observium
|
||||
* @subpackage web
|
||||
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2020 Observium Limited
|
||||
*
|
||||
*/
|
||||
|
||||
$link_array = [
|
||||
'page' => 'device',
|
||||
'device' => $device['device_id'],
|
||||
'tab' => 'routing',
|
||||
'proto' => 'vrf'
|
||||
];
|
||||
|
||||
$navbar = array('brand' => "VRFs", 'class' => "navbar-narrow");
|
||||
|
||||
$navbar['options']['basic']['text'] = 'Basic';
|
||||
// $navbar['options']['details']['text'] = 'Details';
|
||||
$navbar['options']['graphs'] = array('text' => 'Graphs', 'class' => 'pull-right', 'icon' => $config['icon']['graphs']);
|
||||
|
||||
foreach ($navbar['options'] as $option => $array)
|
||||
{
|
||||
if ($vars['view'] == $option) { $navbar['options'][$option]['class'] .= " active"; }
|
||||
$navbar['options'][$option]['url'] = generate_url($link_array,array('view' => $option));
|
||||
}
|
||||
|
||||
foreach (array('graphs') as $type)
|
||||
{
|
||||
foreach ($config['graph_types']['port'] as $option => $data)
|
||||
{
|
||||
if ($vars['view'] == $type && $vars['graph'] == $option)
|
||||
{
|
||||
$navbar['options'][$type]['suboptions'][$option]['class'] = 'active';
|
||||
$navbar['options'][$type]['text'] .= ' ('.$data['name'].')';
|
||||
}
|
||||
$navbar['options'][$type]['suboptions'][$option]['text'] = $data['name'];
|
||||
$navbar['options'][$type]['suboptions'][$option]['url'] = generate_url($link_array, array('view' => $type, 'graph' => $option));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
print_navbar($navbar);
|
||||
unset($navbar);
|
||||
|
||||
echo generate_box_open();
|
||||
|
||||
echo '<table class="table table-striped">';
|
||||
foreach (dbFetchRows("SELECT * FROM `vrfs` WHERE `device_id` = ? ORDER BY `vrf_name`", array($device['device_id'])) as $vrf)
|
||||
{
|
||||
include($config['html_dir']."/includes/print-vrf.inc.php");
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo generate_box_close();
|
||||
|
||||
// EOF
|
Reference in New Issue
Block a user