2011-04-29 22:46:37 +00:00
|
|
|
<?php
|
|
|
|
|
2016-07-31 01:05:02 +02:00
|
|
|
echo '
|
|
|
|
<div>
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-body">
|
|
|
|
<table class="table table-condensed" style="border-collapse:collapse;">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th> </th>
|
|
|
|
<th>Device</th>
|
|
|
|
<th>Router ID</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>ABR</th>
|
|
|
|
<th>ASBR</th>
|
|
|
|
<th>Areas</th>
|
|
|
|
<th>Ports(Enabled)</th>
|
|
|
|
<th>Neighbours</th>
|
|
|
|
</tr>
|
|
|
|
</thead>';
|
2015-07-10 13:36:21 +02:00
|
|
|
foreach (dbFetchRows("SELECT * FROM `ospf_instances` WHERE `ospfAdminStat` = 'enabled'") as $instance) {
|
2011-04-29 22:46:37 +00:00
|
|
|
|
2016-07-31 01:05:02 +02:00
|
|
|
$device = device_by_id_cache($instance['device_id']);
|
|
|
|
$area_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_areas` WHERE `device_id` = '" . $device['device_id'] . "'");
|
|
|
|
$port_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `device_id` = '" . $device['device_id'] . "'");
|
|
|
|
$port_count_enabled = dbFetchCell("SELECT COUNT(*) FROM `ospf_ports` WHERE `ospfIfAdminStat` = 'enabled' AND `device_id` = '" . $device['device_id'] . "'");
|
|
|
|
$nbr_count = dbFetchCell("SELECT COUNT(*) FROM `ospf_nbrs` WHERE `device_id` = '" . $device['device_id'] . "'");
|
2011-04-29 22:46:37 +00:00
|
|
|
|
2016-07-31 01:05:02 +02:00
|
|
|
$status_color = $abr_status_color = $asbr_status_color = 'default';
|
2011-05-16 09:38:44 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
if ($instance['ospfAdminStat'] == 'enabled') {
|
2016-07-31 01:05:02 +02:00
|
|
|
$status_color = 'success';
|
2015-07-10 13:36:21 +02:00
|
|
|
}
|
2011-04-29 22:46:37 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
if ($instance['ospfAreaBdrRtrStatus'] == 'true') {
|
2016-07-31 01:05:02 +02:00
|
|
|
$abr_status_color = 'success';
|
2015-07-10 13:36:21 +02:00
|
|
|
}
|
2011-04-29 22:46:37 +00:00
|
|
|
|
2015-07-10 13:36:21 +02:00
|
|
|
if ($instance['ospfASBdrRtrStatus'] == 'true') {
|
2016-07-31 01:05:02 +02:00
|
|
|
$asbr_status_color = 'success';
|
|
|
|
}
|
|
|
|
|
|
|
|
echo '
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td></td>
|
|
|
|
<td>' . generate_device_link($device, 0, array('tab' => 'routing', 'proto' => 'ospf')) . '</td>
|
|
|
|
<td>' . $instance['ospfRouterId'] . '</td>
|
|
|
|
<td><span class="label label-' . $status_color . '">' . $instance['ospfAdminStat'] . '</span></td>
|
|
|
|
<td><span class="label label-' . $abr_status_color . '">' . $instance['ospfAreaBdrRtrStatus'] . '</span></td>
|
|
|
|
<td><span class="label label-' . $asbr_status_color . '">' . $instance['ospfASBdrRtrStatus'] . '</span></td>
|
|
|
|
<td>' . $area_count . '</td>
|
|
|
|
<td>' . $port_count . '(' . $port_count_enabled . ')</td>
|
|
|
|
<td>' . $nbr_count . '</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>';
|
|
|
|
}
|
|
|
|
echo '</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>';
|