- Introduced `Storage/VIO.php` for monitoring VIO Fibre Channel status with client balancing checks and table sorting. - Updated `/include/en.php` and `/include/fr.php` to include new translations for ServiceNow and VIO-related navigation elements. - Improved SQL query and filtering logic in `/X/Inventory.php` to exclude VIO entries and add XenSam version data. - Enhanced `/reports/heartbeat.php` with a new mechanism for handling server heartbeat status, allowing better granularity and readability.
157 lines
6.5 KiB
PHP
157 lines
6.5 KiB
PHP
<?php
|
|
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
|
$server = $_GET['s'] ?? '';
|
|
$ts = date("Y-m-d");
|
|
|
|
$data = Invoke_Infra_long("SELECT dump FROM dump_dhcp where ts ='$ts' and server = '$server'");
|
|
$xmlRaw = $data[0]['dump'] ?? '';
|
|
if (!mb_check_encoding($xmlRaw, 'UTF-8')) {
|
|
$xmlRaw = mb_convert_encoding($xmlRaw, 'UTF-8', 'Windows-1252');
|
|
}
|
|
|
|
if ($xmlRaw === '') {
|
|
die("Aucune donnée trouvée pour le serveur $server à la date $ts");
|
|
}
|
|
|
|
libxml_use_internal_errors(true);
|
|
$xml = simplexml_load_string($xmlRaw);
|
|
if ($xml === false) {
|
|
echo '<pre>';
|
|
foreach (libxml_get_errors() as $e) {
|
|
echo trim($e->message) . " (ligne {$e->line}, col {$e->column})\n";
|
|
}
|
|
libxml_clear_errors();
|
|
exit;
|
|
}
|
|
|
|
|
|
$definitions = [];
|
|
foreach ($xml->xpath("//OptionDefinition") as $optDef) {
|
|
$definitions[(string)$optDef->OptionId] = (string)$optDef->Name;
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-t">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
|
|
|
<title>Web Infra Reports IT</title>
|
|
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
|
|
|
<script src="/js/jquery-3.6.1.min.js"></script>
|
|
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
|
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
|
<link rel="stylesheet" href="/css/preloader.css">
|
|
<script src="/js/bootstrap.bundle.min.js"></script>
|
|
<link rel="stylesheet" href="/css/bootstrap-table.min.css">
|
|
<script src="/js/bootstrap-table.min.js"></script>
|
|
<script src="/js/bootstrap-table-fr-FR.min.js"></script>
|
|
<script src="/js/tableExport.min.js"></script>
|
|
<script src="/js/bootstrap-table-export.min.js"></script>
|
|
<script src="/js/libs/js-xlsx/xlsx.core.min.js"></script>
|
|
|
|
</head>
|
|
<body class="bg-light text-dark">
|
|
<div class="container-fluid">
|
|
<div class="row flex-nowrap">
|
|
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0">
|
|
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
|
</div>
|
|
|
|
<div class="col py-3">
|
|
<h1><span class="badge bg-secondary text-white w-100"><?php echo htmlspecialchars($server); ?></span></h1>
|
|
|
|
<div class="card mb-3 bg-light text-dark">
|
|
<div class="card-header bg-info text-white">
|
|
<a class="fw-bold text-black" data-bs-toggle="collapse" href="#OptVal"><?php echo $w_globalOptionValues ; ?></a>
|
|
</div>
|
|
<div id="OptVal" class="collapse show">
|
|
<div class="card-body bg-white text-black">
|
|
<?php
|
|
$globalOptions = $xml->xpath("//IPv4/OptionValues/OptionValue");
|
|
foreach ($globalOptions as $opt):
|
|
$idx = (string)$opt->OptionId;
|
|
$vals = [];
|
|
foreach ($opt->Value as $v) $vals[] = (string)$v;
|
|
?>
|
|
<div class="row row-option">
|
|
<div class="col-md-3"><strong><?php echo $idx; ?></strong> - <?php echo $definitions[$idx] ?? 'Unknown'; ?></div>
|
|
<div class="col-md-6"><?php echo implode(" ; ", $vals); ?></div>
|
|
<div class="col-md-3 text-muted small"><?php echo (string)$opt->VendorClass; ?></div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
foreach ($xml->xpath("//Scope") as $scope):
|
|
$scopeIdRaw = (string)$scope->ScopeId;
|
|
$cleanId = "scope_" . str_replace('.', '', $scopeIdRaw);
|
|
$scopeName = (string)$scope->Name;
|
|
?>
|
|
<div class="card mb-2">
|
|
<div class="card-header bg-success text-white">
|
|
<a class="text-white fw-bold" data-bs-toggle="collapse" href="#<?php echo $cleanId; ?>">
|
|
<?php echo "$scopeIdRaw ($scopeName)"; ?>
|
|
</a>
|
|
</div>
|
|
<div id="<?php echo $cleanId; ?>" class="collapse">
|
|
<div class="card-body bg-white text-black">
|
|
<div class="row mb-3 text-center bg-secondary text-light py-2">
|
|
<div class="col-md-4"><strong><?php echo $w_start; ?>:</strong> <?php echo (string)$scope->StartRange; ?></div>
|
|
<div class="col-md-4"><strong><?php echo $w_end; ?>:</strong> <?php echo (string)$scope->EndRange; ?></div>
|
|
<div class="col-md-4"><strong><?php echo $w_mask; ?>:</strong> <?php echo (string)$scope->SubnetMask; ?></div>
|
|
</div>
|
|
|
|
<h6 class="fw-bold border-bottom"><?php echo $w_scopeOptions; ?></h6>
|
|
<?php foreach ($scope->OptionValues->OptionValue as $sOpt):
|
|
$sIdx = (string)$sOpt->OptionId;
|
|
$sVals = [];
|
|
foreach ($sOpt->Value as $sv) $sVals[] = (string)$sv;
|
|
?>
|
|
<div class="row small row-option">
|
|
<div class="col-md-3"><strong><?php echo $sIdx; ?></strong> <?php echo $definitions[$sIdx] ?? ''; ?></div>
|
|
<div class="col-md-6"><?php echo implode(" ; ", $sVals); ?></div>
|
|
<div class="col-md-3 text-muted"><?php echo (string)$sOpt->VendorClass; ?></div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
|
|
<h6 class="fw-bold border-bottom mt-3"><?php echo $w_reservations; ?></h6>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm table-hover">
|
|
<thead>
|
|
<tr class="table-secondary">
|
|
<th><?php echo $w_name; ?></th><th>IP</th><th>MAC</th><th>Description</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$reservations = $scope->Reservations->Reservation ?? null;
|
|
if ($reservations):
|
|
foreach ($reservations as $res): ?>
|
|
<tr>
|
|
<td><?php echo (string)$res->Name; ?></td>
|
|
<td><?php echo (string)$res->IPAddress; ?></td>
|
|
<td><code><?php echo (string)$res->ClientId; ?></code></td>
|
|
<td class="text-muted"><?php echo (string)$res->Description; ?></td>
|
|
</tr>
|
|
<?php endforeach;
|
|
else: ?>
|
|
<tr><td colspan="4" class="text-center text-muted"><em>Aucune réservation sur ce scope</em></td></tr>
|
|
<?php endif; ?>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script src="/js/switch.js"></script>
|
|
</html>
|