Files
librenms-librenms/html/includes/dev-overview-data.inc.php
T

118 lines
2.6 KiB
PHP
Raw Normal View History

2009-09-07 11:07:59 +00:00
<?php
2007-06-24 15:46:47 +00:00
2015-07-13 20:10:26 +02:00
echo '<div class="container-fluid">';
echo "<div class='row'>
2014-02-26 22:33:45 +00:00
<div class='col-md-12'>
<div class='panel panel-default panel-condensed'>
2015-07-13 20:10:26 +02:00
<div class='panel-heading'>";
2015-07-13 20:10:26 +02:00
if ($config['overview_show_sysDescr']) {
echo '<strong>'.$device['sysDescr'].'</strong>';
2011-03-17 11:29:23 +00:00
}
2010-06-10 19:49:23 +00:00
2015-07-13 20:10:26 +02:00
echo '</div>
<table class="table table-hover table-condensed table-striped">';
2014-02-26 22:33:45 +00:00
2011-03-17 11:29:23 +00:00
$uptime = $device['uptime'];
2015-07-13 20:10:26 +02:00
if ($device['os'] == 'ios') {
formatCiscoHardware($device);
}
if ($device['features']) {
$device['features'] = '('.$device['features'].')';
}
2011-03-17 11:29:23 +00:00
$device['os_text'] = $config['os'][$device['os']]['text'];
2015-07-22 17:22:06 +02:00
echo '<tr>
<td>System Name</td>
<td>'.$device['sysName'].' </td>
</tr>';
if ($ip = inet6_ntop($device['ip'])) {
echo '<tr>
<td>Resolved IP</td>
<td>'.$ip.'</td>
</tr>';
}
2015-07-13 20:10:26 +02:00
if ($device['hardware']) {
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>Hardware</td>
2015-07-13 20:10:26 +02:00
<td>'.$device['hardware'].'</td>
</tr>';
2011-03-17 11:29:23 +00:00
}
2015-07-13 20:10:26 +02:00
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>Operating System</td>
2015-07-13 20:10:26 +02:00
<td>'.$device['os_text'].' '.$device['version'].' '.$device['features'].' </td>
</tr>';
2011-04-21 13:30:09 +00:00
2015-07-13 20:10:26 +02:00
if ($device['serial']) {
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>Serial</td>
2015-07-13 20:10:26 +02:00
<td>'.$device['serial'].'</td>
</tr>';
2011-03-17 11:29:23 +00:00
}
if ($device['sysObjectID']) {
echo '<tr>
<td>Object ID</td>
<td>'.$device['sysObjectID'].'</td>
</tr>';
}
2015-07-13 20:10:26 +02:00
if ($device['sysContact']) {
echo '<tr>
<td>Contact</td>';
if (get_dev_attrib($device, 'override_sysContact_bool')) {
echo '
<td>'.htmlspecialchars(get_dev_attrib($device, 'override_sysContact_string')).'</td>
</tr>
<tr>
2015-07-13 20:10:26 +02:00
<td>SNMP Contact</td>';
}
echo '
<td>'.htmlspecialchars($device['sysContact']).'</td>
</tr>';
2011-03-17 11:29:23 +00:00
}
2015-07-13 20:10:26 +02:00
if ($device['location']) {
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>Location</td>
2015-07-13 20:10:26 +02:00
<td>'.$device['location'].'</td>
</tr>';
if (get_dev_attrib($device, 'override_sysLocation_bool') && !empty($device['real_location'])) {
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>SNMP Location</td>
2015-07-13 20:10:26 +02:00
<td>'.$device['real_location'].'</td>
</tr>';
}
2011-03-17 11:29:23 +00:00
}
$loc = parse_location($device['location']);
if (!is_array($loc)) {
$loc = dbFetchRow("SELECT `lat`,`lng` FROM `locations` WHERE `location`=? LIMIT 1", array($device['location']));
}
2015-07-20 15:59:44 +01:00
if (is_array($loc)) {
echo '<tr>
<td>Lat / Lng</td>
<td>['.$loc['lat'].','.$loc['lng'].']</td>
</tr>';
}
2015-07-13 20:10:26 +02:00
if ($uptime) {
echo '<tr>
2014-02-26 22:33:45 +00:00
<td>Uptime</td>
2015-07-13 20:10:26 +02:00
<td>'.formatUptime($uptime).'</td>
</tr>';
2011-03-17 11:29:23 +00:00
}
2015-07-13 20:10:26 +02:00
echo '</table>
2014-02-26 22:33:45 +00:00
</div>
</div>
</div>
2015-07-13 20:10:26 +02:00
</div>';