Commit version 24.12.13800

This commit is contained in:
2025-01-06 17:35:06 -05:00
parent b7f6a79c2c
commit 55d9218816
6133 changed files with 4239740 additions and 1374287 deletions

View File

@ -6,7 +6,7 @@
*
* @package observium
* @subpackage web
* @copyright (C) 2006-2013 Adam Armstrong, (C) 2013-2021 Observium Limited
* @copyright (C) Adam Armstrong
*
*/
@ -15,129 +15,144 @@ echo generate_box_open();
echo('<table class="table table-condensed table-striped table-hover">');
if ($config['overview_show_sysDescr']) {
echo '<tr>';
echo '<td colspan=2 style="padding: 10px;">';
echo '<tr>';
echo '<td colspan=2 style="padding: 10px;">';
/*
if (is_file($config['html_dir'] . '/images/hardware/' . trim($device['sysObjectID'], ".") . '.png')) {
echo '<img style="height: 100px; float: right;" src="'.$config['site_url'] . '/images/hardware/' . trim($device['sysObjectID'], ".") . '.png'.'"></img>';
}
*/
echo '<strong><i>' . escape_html($device['sysDescr']) . '</i></strong></td></tr>';
/*
if (is_file($config['html_dir'] . '/images/hardware/' . trim($device['sysObjectID'], ".") . '.png')) {
echo '<img style="height: 100px; float: right;" src="'.$config['site_url'] . '/images/hardware/' . trim($device['sysObjectID'], ".") . '.png'.'"></img>';
}
*/
echo '<strong><i>' . escape_html($device['sysDescr']) . '</i></strong></td></tr>';
}
// Groups
if (OBSERVIUM_EDITION !== 'community' && $_SESSION['userlevel'] >= 5 &&
$groups = get_entity_group_names('device', $device['device_id'])) {
echo('<tr>
<td class="entity">Groups</td>
<td>');
foreach ($groups as $group_id => $group) {
$link = generate_link($group, [ 'page' => 'group', 'group_id' => $group_id ]); // always escaped (as default)
echo '<span class="label">' . $link . '</span> ';
}
echo('</td>
</tr>');
}
if ($device['purpose']) {
echo('<tr>
echo('<tr>
<td class="entity">Description</td>
<td>' . escape_html($device['purpose']) . '</td>
</tr>');
}
if ($device['hardware']) {
if ($device['vendor']) {
echo('<tr>
if ($device['vendor']) {
echo('<tr>
<td class="entity">Vendor/Hardware</td>
<td>' . escape_html($device['vendor'].' '.$device['hardware']) . '</td>
<td>' . escape_html($device['vendor'] . ' ' . $device['hardware']) . '</td>
</tr>');
} else {
echo('<tr>
} else {
echo('<tr>
<td class="entity">Hardware</td>
<td>' . escape_html($device['hardware']) . '</td>
</tr>');
}
}
} elseif ($device['vendor']) {
// Only Vendor exist
echo('<tr>
// Only Vendor exist
echo('<tr>
<td class="entity">Vendor</td>
<td>' . escape_html($device['vendor']) . '</td>
</tr>');
}
if ($device['os'] !== 'generic') {
echo('<tr>
echo('<tr>
<td class="entity">Operating system</td>
<td>' . escape_html($device['os_text']) . ' ' . escape_html($device['version']) . ($device['features'] ? ' (' . escape_html($device['features']) . ')' : '') . ' </td>
</tr>');
}
if ($device['sysName']) {
echo('<tr>
echo('<tr>
<td class="entity">System name</td>');
echo('
<td>' . escape_html($device['sysName']). '</td>
</tr>');
}
if ($_SESSION['userlevel'] >= 5 && $device['ip']) {
echo('<tr>
<td class="entity">Cached IP</td>');
echo('
<td>' . escape_html($device['ip']). '</td>
echo('
<td>' . escape_html($device['sysName']) . '</td>
</tr>');
}
if ($device['sysContact']) {
echo('<tr>
echo('<tr>
<td class="entity">Contact</td>');
if (get_dev_attrib($device,'override_sysContact_bool')) {
echo('
<td>' . escape_html(get_dev_attrib($device,'override_sysContact_string')) . '</td>
if (get_dev_attrib($device, 'override_sysContact_bool')) {
echo('
<td>' . escape_html(get_dev_attrib($device, 'override_sysContact_string')) . '</td>
</tr>
<tr>
<td class="entity">SNMP Contact</td>');
}
echo('
<td>' . escape_html($device['sysContact']). '</td>
}
echo('
<td>' . escape_html($device['sysContact']) . '</td>
</tr>');
}
if ($device['location']) {
echo('<tr>
echo('<tr>
<td class="entity">Location</td>
<td>' . escape_html($device['location']) . '</td>
</tr>');
if (get_dev_attrib($device,'override_sysLocation_bool') && !empty($device['real_location'])) {
echo('<tr>
if (get_dev_attrib($device, 'override_sysLocation_bool') && !empty($device['real_location'])) {
echo('<tr>
<td class="entity">SNMP Location</td>
<td>' . escape_html($device['real_location']) . '</td>
</tr>');
}
}
}
if ($device['asset_tag']) {
echo('<tr>
echo('<tr>
<td class="entity">Asset tag</td>
<td>' . escape_html($device['asset_tag']) . '</td>
</tr>');
}
if ($device['serial']) {
echo('<tr>
echo('<tr>
<td class="entity">Serial</td>
<td>' . escape_html($device['serial']) . '</td>
</tr>');
}
if ($device['state']['la']['5min']) {
if ($device['state']['la']['5min'] > 10) {
$la_class = 'text-danger';
} elseif ($device['state']['la']['5min'] > 4) {
$la_class = 'text-warning';
} else {
$la_class = '';
}
echo('<tr>
if ($device['state']['la']['5min'] > 10) {
$la_class = 'text-danger';
} elseif ($device['state']['la']['5min'] > 4) {
$la_class = 'text-warning';
} else {
$la_class = '';
}
echo('<tr>
<td class="entity">Load average</td>
<td class="'.$la_class.'">' . number_format((float)$device['state']['la']['1min'],2) . ', ' .
number_format((float)$device['state']['la']['5min'], 2) . ', ' .
number_format((float)$device['state']['la']['15min'], 2) . '</td>
<td class="' . $la_class . '">' . number_format((float)$device['state']['la']['1min'], 2) . ', ' .
number_format((float)$device['state']['la']['5min'], 2) . ', ' .
number_format((float)$device['state']['la']['15min'], 2) . '</td>
</tr>');
}
if ($_SESSION['userlevel'] >= 5 && $device['ip']) {
echo('<tr>
<td class="entity">Cached IP</td>');
echo('
<td>' . escape_html($device['ip']) . '</td>
</tr>');
}
if ($device['uptime']) {
echo('<tr>
echo('<tr>
<td class="entity">Uptime</td>
<td>' . deviceUptime($device) . '</td>
<td>' . device_uptime($device) . '</td>
</tr>');
}
/*
@ -163,7 +178,7 @@ if ($device['status_type'] && $device['status_type'] != 'ok') {
*/
if ($device['last_rebooted']) {
echo('<tr>
echo('<tr>
<td class="entity">Last reboot</td>
<td>' . format_unixtime($device['last_rebooted']) . '</td>
</tr>');