librenms-librenms/includes/html/print-stp.inc.php

32 lines
1.6 KiB
PHP
Raw Normal View History

2016-01-03 21:10:35 +01:00
<?php
2016-01-28 13:07:33 +01:00
echo '<table class="table table-condensed table-striped table-hover">';
2020-09-21 15:40:17 +02:00
$stp_raw = dbFetchRow('SELECT * FROM `stp` WHERE `device_id` = ?', [$device['device_id']]);
$stp = [
2016-01-07 18:29:29 +01:00
'Root bridge' => ($stp_raw['rootBridge'] == 1) ? 'Yes' : 'No',
'Bridge address (MAC)' => \LibreNMS\Util\Rewrite::readableMac($stp_raw['bridgeAddress']) . ' (' . \LibreNMS\Util\Rewrite::readableOUI($stp_raw['bridgeAddress']) . ')',
2016-01-07 18:29:29 +01:00
'Protocol specification' => $stp_raw['protocolSpecification'],
'Priority (0-61440)' => $stp_raw['priority'],
'Time since topology change' => \LibreNMS\Util\Time::formatInterval($stp_raw['timeSinceTopologyChange']),
2016-01-07 18:29:29 +01:00
'Topology changes' => $stp_raw['topChanges'],
'Designated root (MAC)' => \LibreNMS\Util\Rewrite::readableMac($stp_raw['designatedRoot']) . ' (' . \LibreNMS\Util\Rewrite::readableOUI($stp_raw['designatedRoot']) . ')',
2016-01-07 18:29:29 +01:00
'Root cost' => $stp_raw['rootCost'],
'Root port' => $stp_raw['rootPort'],
'Max age (s)' => $stp_raw['maxAge'],
'Hello time (s)' => $stp_raw['helloTime'],
'Hold time (s)' => $stp_raw['holdTime'],
'Forward delay (s)' => $stp_raw['forwardDelay'],
'Bridge max age (s)' => $stp_raw['bridgeMaxAge'],
'Bridge hello time (s)' => $stp_raw['bridgeHelloTime'],
2020-09-21 15:40:17 +02:00
'Bridge forward delay (s)' => $stp_raw['bridgeForwardDelay'],
];
2016-01-03 21:10:35 +01:00
foreach (array_keys($stp) as $key) {
echo '
2016-01-03 21:10:35 +01:00
<tr>
<td>' . $key . '</td>
<td>' . $stp[$key] . '</td>
2016-01-03 21:10:35 +01:00
</tr>
';
2016-01-03 21:10:35 +01:00
}
2016-01-28 13:07:33 +01:00
echo '</table>';