Files
librenms-librenms/includes/html/pages/device/routing/isis.inc.php
Tony Murray 8e409ba051 Rewrite ISIS Adjacency discovery/polling (#13155)
* Rewrite ISIS Adjacency discovery/polling
hopefully much faster now, do most work in discovery and just check up/down in poller.

* unused variable

* Implement option for OS override

* fix an incorrect typehint

* test data

* work around stupid migration name

* update schema

* better handling for the on-demand discovery

* more detailed phpdoc

* fix when adjacency is not found

* don't clear out data when adjacency goes away

* Adjust nullable fields

* fixes

* fix class name

* correct migration

* fix bug causing adjacency data to always be blank

* port popups for port links

* isisISAdjState does not need to be nullable

* remove extra space

* default off

* If port is missing return $text

* update schema

* Cleanup old components

* correc copy paste error
2021-08-23 21:19:55 -05:00

53 lines
1.6 KiB
PHP

<?php
use App\Models\IsisAdjacency;
echo '
<div>
<div class="panel panel-default">
<div class="panel-body">
<table class="table table-condensed table-hover" style="border-collapse:collapse;">
<thead>
<tr>
<th>&nbsp;</th>
<th>Local Device</th>
<th>Local Interface</th>
<th>Adjacent</th>
<th>System ID</th>
<th>Area</th>
<th>System Type</th>
<th>Admin</th>
<th>State</th>
<th>Last Uptime</th>
</tr>
</thead>';
foreach (IsisAdjacency::where('device_id', $device['device_id'])->with('port')->get() as $adj) {
if ($adj->isisISAdjState == 'up') {
$color = 'green';
} else {
$color = 'red';
}
$interface_name = $adj->port->ifName;
echo '
<tbody>
<tr>
<td></td>
<td>' . generate_device_link($device, 0, ['tab' => 'routing', 'proto' => 'isis']) . '</td>
<td>' . \LibreNMS\Util\Url::portLink($adj->port) . '</td>
<td>' . $adj->isisISAdjIPAddrAddress . '</td>
<td>' . $adj->isisISAdjNeighSysID . '</td>
<td>' . $adj->isisISAdjAreaAddress . '</td>
<td>' . $adj->isisISAdjNeighSysType . '</td>
<td>' . $adj->isisCircAdminState . '</td>
<td><strong><span style="color: ' . $color . ';">' . $adj->isisISAdjState . '</span></strong></td>
<td>' . \LibreNMS\Util\Time::formatInterval($adj->isisISAdjLastUpTime) . '</td>
</tr>
</tbody>';
}
echo '</table>
</div>
</div>
</div>';