Compare commits
13 Commits
097481aec0
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f1b7dcd22 | ||
|
|
e9cf3077fa | ||
| 10c228f255 | |||
|
|
d5b45dbc22 | ||
| b0c9cafc46 | |||
| 9afc833361 | |||
| ea46ba5c8f | |||
| dcfe098f35 | |||
| 878106f83f | |||
| 2c279320ce | |||
| e0d2dc00c1 | |||
| a17bb63889 | |||
| 70af042b7b |
1
.idea/php.xml
generated
1
.idea/php.xml
generated
@@ -12,6 +12,7 @@
|
||||
</component>
|
||||
<component name="PhpIncludePathManager">
|
||||
<include_path>
|
||||
<path value="$PROJECT_DIR$/include" />
|
||||
<path value="$PROJECT_DIR$/../../Include" />
|
||||
</include_path>
|
||||
</component>
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Group Review</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_1; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Group Membership</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $w_groupMembership ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -60,11 +60,11 @@
|
||||
<form id="search-form" class="mb-4" method="POST" action="">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label for="group-search" class="form-label">Search AD Group</label>
|
||||
<input type="text" class="form-control" id="group-search" name="group-search" placeholder="Start typing group name ...">
|
||||
<label for="group-search" class="form-label"><?php echo $w_groupSearch; ?></label>
|
||||
<input type="text" class="form-control" id="group-search" name="group-search" placeholder="<?php echo $w_startToType; ?>">
|
||||
</div>
|
||||
<div class="col-md-2 d-flex align-items-end">
|
||||
<button type="submit" class="btn btn-primary w-100">Show Members</button>
|
||||
<button type="submit" class="btn btn-primary w-100"><?php echo $w_seeMembers; ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -6,49 +6,37 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<!-- Chart -->
|
||||
<script src="/js/chart.min.js"></script>
|
||||
<script src="/js/apexcharts.min.js"></script>
|
||||
<!-- Gauge -->
|
||||
<link rel="stylesheet" href="/css/Gauge.css">
|
||||
<script src="/js/jquery.AshAlom.gaugeMeter-2.0.0.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Database connexion -->
|
||||
<div class="container-fluid">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> </div>
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Hyper-V Clusters</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_4;?></span></h1>
|
||||
<div class="container-fluid" style="zoom:90%">
|
||||
<div class="row">
|
||||
<?php
|
||||
// =================================================================
|
||||
// STEP 1: Fetch all required data with minimal database queries (MSSQL SYNTAX)
|
||||
// STEP 1: Fetch all required data with minimal database queries
|
||||
// =================================================================
|
||||
|
||||
// Query 1: Get aggregated data for all clusters at once.
|
||||
$cluster_query = "
|
||||
SELECT
|
||||
cluster,
|
||||
@@ -73,7 +61,6 @@
|
||||
";
|
||||
$all_clusters_data = Invoke_Infra($cluster_query);
|
||||
|
||||
// Query 2: Get VM distribution for all relevant clusters at once.
|
||||
$vm_repart_query = "
|
||||
SELECT
|
||||
v.Cluster,
|
||||
@@ -96,7 +83,6 @@
|
||||
";
|
||||
$raw_vm_distribution = Invoke_Infra($vm_repart_query);
|
||||
|
||||
// Process the VM distribution data into an easy-to-use associative array
|
||||
$vm_distribution = [];
|
||||
if (is_array($raw_vm_distribution)) {
|
||||
foreach ($raw_vm_distribution as $repart) {
|
||||
@@ -106,6 +92,36 @@
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
$vm_issues_query = "
|
||||
SELECT
|
||||
v.Cluster,
|
||||
SUM(CASE WHEN v.IsClustered = 'False' THEN 1 ELSE 0 END) as unclustered_count,
|
||||
SUM(CASE WHEN v.IsClustered = 'True' AND v.Owner <> v.PreferredOwner THEN 1 ELSE 0 END) as wrong_owner_count
|
||||
FROM
|
||||
cmdb_vms v
|
||||
WHERE
|
||||
v.decomtime IS NULL
|
||||
AND v.Cluster <> ''
|
||||
AND v.Cluster NOT LIKE '%-WM%'
|
||||
AND v.Cluster NOT LIKE '%-C1MAS%'
|
||||
AND v.Cluster NOT LIKE '%-vrs%'
|
||||
AND (v.Cluster LIKE 'DUN%' OR v.Cluster LIKE 'DMV%')
|
||||
GROUP BY
|
||||
v.Cluster
|
||||
";
|
||||
$raw_vm_issues = Invoke_Infra($vm_issues_query);
|
||||
|
||||
$vm_issues = [];
|
||||
if (is_array($raw_vm_issues)) {
|
||||
foreach ($raw_vm_issues as $issue) {
|
||||
$vm_issues[$issue['Cluster']] = [
|
||||
'unclustered' => $issue['unclustered_count'],
|
||||
'wrong_owner' => $issue['wrong_owner_count']
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
// =================================================================
|
||||
// STEP 2: Loop through the pre-fetched data and display it
|
||||
// =================================================================
|
||||
@@ -136,17 +152,13 @@
|
||||
$capacity_gb = 0;
|
||||
$free_gb = 0;
|
||||
if (!empty($cluster_data['all_csvs'])) {
|
||||
// Explode the big string into an array of all CSV entries (with duplicates)
|
||||
$all_csv_entries = explode("|", $cluster_data['all_csvs']);
|
||||
// Create a new array containing only the unique CSV entries
|
||||
$unique_csv_entries = array_unique($all_csv_entries);
|
||||
// Loop through the UNIQUE entries to perform the calculation
|
||||
foreach ($unique_csv_entries as $csv_string) {
|
||||
if (str_contains($csv_string, ';')) {
|
||||
$parts = explode(";", $csv_string);
|
||||
if(count($parts) >= 3) {
|
||||
$capacity_gb += (int)$parts[1];
|
||||
// Free space is Total Capacity (parts[1]) - Used Space (parts[2])
|
||||
$free_gb += (int)$parts[1] - (int)$parts[2];
|
||||
}
|
||||
}
|
||||
@@ -155,10 +167,6 @@
|
||||
$free_gb = max(0, $free_gb);
|
||||
$free_storage_percentage = ($capacity_gb > 0) ? round($free_gb / $capacity_gb * 100) : 0;
|
||||
|
||||
// IOPS Calculation
|
||||
$avg_io = ($node_count > 0) ? round((float)$cluster_data['total_io_disk'] / $node_count * 1024) : 0;
|
||||
$io_display = ($avg_io == 0) ? "?" : $avg_io;
|
||||
|
||||
// VMs Left Calculation
|
||||
$vms_left_by_mem = ($free_mem > 0) ? floor($free_mem / 16) : 0;
|
||||
$vms_left_by_storage = ($free_gb > 0) ? floor($free_gb / 110) : 0;
|
||||
@@ -167,11 +175,11 @@
|
||||
|
||||
// --- Display Logic ---
|
||||
if ($vms_left > 2) {
|
||||
$vleft_html = "<span class='text-success'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
} elseif ($vms_left >= 1) { // Handles 1 and 2
|
||||
$vleft_html = "<span class='text-warning'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
$vleft_html = "<span class='text-success'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
} elseif ($vms_left >= 1) {
|
||||
$vleft_html = "<span class='text-warning'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
} else {
|
||||
$vleft_html = "<span class='text-danger'><b>(" . $vms_left . "</b> VMs left)</span>";
|
||||
$vleft_html = "<span class='text-danger'><b>(" . $vms_left . "</b> $w_VMleft)</span>";
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -181,7 +189,7 @@
|
||||
<div class='card-header text-white bg-dark border-secondary'>
|
||||
<h4 class="text-center"><?php echo htmlspecialchars($cluster_name); ?></h4>
|
||||
<h6 class="text-center">
|
||||
<b><?php echo $node_count; ?></b> Nodes / <b><?php echo $total_vms; ?></b> VMs <?php echo $vleft_html; ?>
|
||||
<b><?php echo $node_count; ?></b> <?php echo $w_nodes;?> / <b><?php echo $total_vms; ?></b> <?php echo $w_VMs ;?> <?php echo $vleft_html; ?>
|
||||
</h6>
|
||||
|
||||
<?php
|
||||
@@ -193,14 +201,12 @@
|
||||
$owner1_count = $dist_data[0]['vm_count'];
|
||||
$owner2_name = isset($dist_data[1]) ? $dist_data[1]['owner'] : 'N/A';
|
||||
$owner2_count = isset($dist_data[1]) ? $dist_data[1]['vm_count'] : 0;
|
||||
|
||||
$p1 = ($total_vms > 0) ? ($owner1_count / $total_vms) * 100 : 0;
|
||||
$p2 = ($total_vms > 0) ? ($owner2_count / $total_vms) * 100 : 0;
|
||||
|
||||
$vm_dist_html = "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||
<div class='progress-bar text-white' role='progressbar' style='width:$p1%'><b>$owner1_name: $owner1_count</b></div>
|
||||
<div class='progress-bar bg-info text-dark' role='progressbar' style='width:$p2%'><b>$owner2_name: $owner2_count</b></div>
|
||||
</div>";
|
||||
<div class='progress-bar text-white' role='progressbar' style='width:$p1%'><b>$owner1_name</b></div>
|
||||
<div class='progress-bar bg-info text-dark' role='progressbar' style='width:$p2%'><b>$owner2_name</b></div>
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
echo $vm_dist_html;
|
||||
@@ -213,7 +219,7 @@
|
||||
$mem_used_percentage = 100 - $free_mem_percentage;
|
||||
?>
|
||||
<div class='row mb-2 align-items-center'>
|
||||
<div class='col-7'><b>Free Mem:</b> <?php echo $free_mem . " / " . $cluster_usable_mem; ?> GB</div>
|
||||
<div class='col-7'><b><?php echo $w_freeMem;?> :</b> <?php echo $free_mem . " / " . $cluster_usable_mem; ?> GB</div>
|
||||
<div class='col-5'>
|
||||
<div class='progress' style='border: 2px solid <?php echo $mem_border; ?>; height: 20px;'>
|
||||
<div class='progress-bar bg-dark progress-bar-striped' style='width: <?php echo $mem_used_percentage; ?>%;'></div>
|
||||
@@ -236,7 +242,7 @@
|
||||
$disk_used_percentage = 100 - $free_storage_percentage;
|
||||
?>
|
||||
<div class='row mb-2 align-items-center'>
|
||||
<div class='col-7'><b>Free CSV:</b> <?php echo $display_free . " / " . $display_capacity . " " . $disk_unit; ?></div>
|
||||
<div class='col-7'><b><?php echo $w_freeCSV;?> :</b> <?php echo $display_free . " / " . $display_capacity . " " . $disk_unit; ?></div>
|
||||
<div class='col-5'>
|
||||
<div class='progress' style='border: 2px solid <?php echo $disk_border; ?>; height: 20px;'>
|
||||
<div class='progress-bar bg-dark progress-bar-striped' style='width: <?php echo $disk_used_percentage; ?>%;'></div>
|
||||
@@ -244,7 +250,25 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='row'><div class='col-7'><b>CSV I/O</b> (24h):</div><div class='col-5'><b><?php echo $io_display; ?> KB/s</b></div></div>
|
||||
|
||||
<div class='row mt-2'>
|
||||
<?php
|
||||
$unclustered_count = $vm_issues[$cluster_name]['unclustered'] ?? 0;
|
||||
$wrong_owner_count = $vm_issues[$cluster_name]['wrong_owner'] ?? 0;
|
||||
|
||||
if ($unclustered_count > 0) {
|
||||
echo "<div class='col-7'><span class='badge text-bg-danger'>$w_unclustered: $unclustered_count</span></div>";
|
||||
}else{
|
||||
echo "<div class='col-7'><span class='badge text-bg-success'>$w_unclustered: $unclustered_count</span></div>";
|
||||
}
|
||||
|
||||
if ($wrong_owner_count > 0) {
|
||||
echo "<div class='col-5'><span class='badge text-bg-warning'>$w_wrongOwner: {$wrong_owner_count}</span></div>";
|
||||
}else{
|
||||
echo "<div class='col-5'><span class='badge text-bg-success'>$w_wrongOwner: {$wrong_owner_count}</span></div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
@@ -258,14 +282,12 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<br><br>
|
||||
<h3 class="text-center">Total VMs Left: <?php echo $total_vms_left; ?></h3>
|
||||
<h3 class="text-center">Total <?php echo $w_VMleft;?>: <?php echo $total_vms_left; ?></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
131
Hyper-V/Memory-Hunt-VMs.php
Normal file
131
Hyper-V/Memory-Hunt-VMs.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
|
||||
|
||||
$answers = Invoke_Infra("SELECT
|
||||
m.*, COALESCE(s.OS, CONCAT(x.name, ' ', x.ver)) AS OS,
|
||||
CASE
|
||||
WHEN o.model = 'Virtual Machine' OR o.typ = 'MACHINE VIRTUELLE' THEN 'VM'
|
||||
WHEN o.model IS NOT NULL AND o.model <> '' THEN o.model
|
||||
ELSE 'Inconnu' -- Ou une autre valeur par défaut si tout est vide
|
||||
END AS hardware_type
|
||||
FROM cmdb_memoryusage m
|
||||
LEFT JOIN cmdb_srvall s ON m.vm_name = s.hostname
|
||||
LEFT JOIN x_cmdb_OS x ON m.vm_name = x.hostname
|
||||
LEFT JOIN cmdb_obsolescence o on m.vm_name = o.name
|
||||
where m.vm_name not like '%-v%-%' order by m.Potential_Savings_GB desc");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_6;?> </span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="name" data-sortable="true"><?php echo $w_name;?></th>
|
||||
<th data-field="Assigned" data-sortable="true"><?php echo $w_assignedGB;?></th>
|
||||
<th data-field="MinUsed" data-sortable="true"><?php echo $w_minUsedGB;?></th>
|
||||
<th data-field="AvgUsed" data-sortable="true"><?php echo $w_avgUsedGB;?></th>
|
||||
<th data-field="MaxUsed" data-sortable="true"><?php echo $w_maxUsedGB;?></th>
|
||||
<th data-field="Savings" data-sortable="true"><?php echo $w_potentialSavingsGB;?></th>
|
||||
<th data-field="StorageTotal" data-sortable="true"><?php echo $w_storageTotalGB;?></th>
|
||||
<th data-field="StorageUsed" data-sortable="true"><?php echo $w_storageUsedGB;?></th>
|
||||
<th data-field="OS" data-sortable="true" data-visible="false"><?php echo $w_os;?></th>
|
||||
<th data-field="Hardware" data-sortable="true" data-visible="false"><?php echo $w_hardware;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($answers as $row) {
|
||||
echo "<tr><td>".$row['VM_Name']."</td>";
|
||||
echo "<td>".$row['Assigned_GB']."</td>";
|
||||
echo "<td>".$row['Min_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Avg_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Max_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Potential_Savings_GB']."</td>";
|
||||
echo "<td>".$row['Storage_Total_GB']."</td>";
|
||||
echo "<td>".$row['Storage_Used_GB']."</td>";
|
||||
echo "<td>".$row['OS']."</td>";
|
||||
echo "<td>".$row['hardware_type']."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
let table = $('#t1');
|
||||
$(document).ready(function() {
|
||||
table.DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
});
|
||||
|
||||
function tableresize() {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
</SCRIPT>
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php $answers = Invoke_Infra("select * from cmdb_vms where cluster like 'DMV-VMH-SYN%' and decomtime is null order by name"); ?>
|
||||
<?php $answers = Invoke_Infra("select * from cmdb_vms where decomtime is null order by name"); ?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
@@ -42,7 +42,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h2><span class="badge text-bg-secondary " style="width:100%;" >Synergy VM List - <?php echo count($answers); ?> VMs</span></h2>
|
||||
<h2><span class="badge text-bg-secondary " style="width:100%;" >VM List - <?php echo count($answers); ?> VMs</span></h2>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
|
||||
@@ -67,85 +67,103 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='vm' data-sortable='true'>VM</th>
|
||||
<th data-field='Last Backup' data-sortable='true'>Last Backup</th>
|
||||
<th data-field='Last Result' data-sortable='true'>Last Result</th>
|
||||
<th data-field='Last Good' data-sortable='true'>Last Good Backup</th>
|
||||
<th data-field='Size' data-sortable='true'>Size</th>
|
||||
<th data-field='Host' data-sortable='true'>Host</th>
|
||||
<th data-field='Policy' data-sortable='true' data-visible='false'>Policy</th>
|
||||
<th data-field='vm' data-sortable='true'><?php echo $w_VMs;?></th>
|
||||
<th data-field='Last Backup' data-sortable='true'><?php echo $w_backuplu;?></th>
|
||||
<th data-field='Last Result' data-sortable='true'><?php echo $w_lastResult;?></th>
|
||||
<th data-field='Last Good' data-sortable='true'><?php echo $w_lastGoodBackup;?></th>
|
||||
<th data-field='Size' data-sortable='true'><?php echo $w_size;?></th>
|
||||
<th data-field='Host' data-sortable='true'><?php echo $w_host;?></th>
|
||||
<th data-field='Policy' data-sortable='true' data-visible='false'><?php echo $w_policy;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
// get all active servers
|
||||
$today = date("Y-m-d");
|
||||
$active = Invoke_Infra("SELECT name from cmdb_vms where LastInventory like'$today%'");
|
||||
$active = array_column($active, 'name');
|
||||
|
||||
// NO Backup or Backup with Errors
|
||||
$er = 0;
|
||||
$answers = Invoke_infra("SELECT * FROM VMs_Backup where ( Owner like 'DUN-VMH%' or Owner like 'MDK-VMH%' ) and name not like 'WS%' and owner not like '%WKG%' and owner not like '%VMH-WM%' and Exclusion ='' and (LastResult <> 'OK' or lastresult is null) and policy is not null order by lastresult,name");
|
||||
foreach ($answers as $row) {
|
||||
$er++;
|
||||
$date1 = date_create($row['LastKnownGood']??'01/01/1970'); $diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") >= 2 || $row['LastKnownGood'] == ''){
|
||||
echo "<tr class='table-danger'>";
|
||||
}else{
|
||||
echo "<tr class='table-warning'>";
|
||||
}
|
||||
if($diff->format("%R%a") == "-0"){$LastGood = "NEVER";}else{$LastGood = $row['LastKnownGood']." (".$diff->format("%R%a")."J)";}
|
||||
echo "<td><b>".$row['Name']."<b></td>";
|
||||
echo "<td>".$row['LastBackup']." ".$row['TimeStamp']."</td>";
|
||||
echo "<td>".$row['LastResult']."</td>";
|
||||
echo "<td>".$LastGood."</td>";
|
||||
echo "<td>".$row['LastSize']."</td>";
|
||||
echo "<td>".$row['Owner']."</td>";
|
||||
echo "<td>".$row['Policy']."</td>";
|
||||
if(in_array($row['Name'], $active)){
|
||||
$er++;
|
||||
$date1 = date_create($row['LastKnownGood'] ?? '01/01/1970');
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if ($diff->format("%R%a") >= 2 || $row['LastKnownGood'] == '') {
|
||||
echo "<tr class='table-danger'>";
|
||||
} else {
|
||||
echo "<tr class='table-warning'>";
|
||||
}
|
||||
if ($diff->format("%R%a") == "-0") {
|
||||
$LastGood = "NEVER";
|
||||
} else {
|
||||
$LastGood = $row['LastKnownGood'] . " (" . $diff->format("%R%a") . "J)";
|
||||
}
|
||||
echo "<td><b>" . $row['Name'] . "<b></td>";
|
||||
echo "<td>" . $row['LastBackup'] . " " . $row['TimeStamp'] . "</td>";
|
||||
echo "<td>" . $row['LastResult'] . "</td>";
|
||||
echo "<td>" . $LastGood . "</td>";
|
||||
echo "<td>" . $row['LastSize'] . "</td>";
|
||||
echo "<td>" . $row['Owner'] . "</td>";
|
||||
echo "<td>" . $row['Policy'] . "</td>";
|
||||
|
||||
echo "</tr>";
|
||||
echo "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
// Outdated
|
||||
$outdated = 0;
|
||||
$answers = Invoke_infra("SELECT * FROM VMs_Backup where ( Owner like 'DUN-VMH%' or Owner like 'MDK-VMH%' ) and name not like 'WS%' and owner not like '%WKG%' and owner not like '%VMH-WM%' and Exclusion ='' and LastResult = 'OK' and TRY_CAST(lastknowngood AS DATE) < CAST(DATEADD(DAY, -2, GETDATE()) AS DATE) order by name");
|
||||
foreach ($answers as $row) {
|
||||
$date1 = date_create($row['LastKnownGood']); $diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if(date('w') >= 2 && date('w') <= 6 ){
|
||||
if ($diff->format("%R%a") >= 2){
|
||||
echo "<tr class='table-warning'>";
|
||||
}else{
|
||||
echo "<tr class='table-success'>";
|
||||
}
|
||||
}else{
|
||||
if((date('w') < 2 || date('w') == 7)){
|
||||
if($diff->format("%R%a") <= 3){
|
||||
echo "<tr class='table-success'>";
|
||||
}else{
|
||||
if (in_array($row['Name'], $active)) {
|
||||
$date1 = date_create($row['LastKnownGood']);
|
||||
$diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if (date('w') >= 2 && date('w') <= 6) {
|
||||
if ($diff->format("%R%a") >= 2) {
|
||||
echo "<tr class='table-warning'>";
|
||||
} else {
|
||||
echo "<tr class='table-success'>";
|
||||
}
|
||||
} else {
|
||||
if ((date('w') < 2 || date('w') == 7)) {
|
||||
if ($diff->format("%R%a") <= 3) {
|
||||
echo "<tr class='table-success'>";
|
||||
} else {
|
||||
echo "<tr class='table-warning'>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($diff->format("%R%a") == "-0"){$LastGood = $row['LastKnownGood'];}else{$LastGood = $row['LastKnownGood']." (".$diff->format("%R%a")."J)";}
|
||||
echo "<td><b>".$row['Name']."<b></td>";
|
||||
echo "<td>".$row['LastBackup']." ".$row['TimeStamp']."</td>";
|
||||
echo "<td>".$row['LastResult']."</td>";
|
||||
if (date('w') >= 2 && date('w') <= 6 && $diff->format("%R%a") < 1){
|
||||
echo "<td>".$LastGood."</td>";
|
||||
}else{
|
||||
if ((date('w') == 1 || date('w') == 7) && $diff->format("%R%a") <= 3){
|
||||
echo "<td>".$LastGood."</td>";
|
||||
}else{
|
||||
echo "<td class='table-warning'>".$LastGood."</td>";
|
||||
$outdated++;
|
||||
if ($diff->format("%R%a") == "-0") {
|
||||
$LastGood = $row['LastKnownGood'];
|
||||
} else {
|
||||
$LastGood = $row['LastKnownGood'] . " (" . $diff->format("%R%a") . "J)";
|
||||
}
|
||||
echo "<td><b>" . $row['Name'] . "<b></td>";
|
||||
echo "<td>" . $row['LastBackup'] . " " . $row['TimeStamp'] . "</td>";
|
||||
echo "<td>" . $row['LastResult'] . "</td>";
|
||||
if (date('w') >= 2 && date('w') <= 6 && $diff->format("%R%a") < 1) {
|
||||
echo "<td>" . $LastGood . "</td>";
|
||||
} else {
|
||||
if ((date('w') == 1 || date('w') == 7) && $diff->format("%R%a") <= 3) {
|
||||
echo "<td>" . $LastGood . "</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'>" . $LastGood . "</td>";
|
||||
$outdated++;
|
||||
}
|
||||
}
|
||||
echo "<td>" . $row['LastSize'] . "</td>";
|
||||
echo "<td>" . $row['Owner'] . "</td>";
|
||||
echo "<td>" . $row['Policy'] . "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "<td>".$row['LastSize']."</td>";
|
||||
echo "<td>".$row['Owner']."</td>";
|
||||
echo "<td>".$row['Policy']."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
|
||||
// Backup OK
|
||||
$answers = Invoke_infra("SELECT * FROM VMs_Backup where ( Owner like 'DUN-VMH%' or Owner like 'MDK-VMH%' ) and name not like 'WS%' and owner not like '%WKG%' and owner not like '%VMH-WM%' and Exclusion ='' and LastResult = 'OK' and TRY_CAST(lastknowngood AS DATE) >= CAST(DATEADD(DAY, -2, GETDATE()) AS DATE) order by name");
|
||||
$total = count($answers);
|
||||
$total = is_countable($answers) ? count($answers) : 0;
|
||||
foreach ($answers as $row) {
|
||||
$date1 = date_create($row['LastKnownGood']); $diff = date_diff($date1, date_create(date("Y-m-d")));
|
||||
if(date('w') >= 2 && date('w') <= 6 ){
|
||||
@@ -210,7 +228,7 @@
|
||||
</div>
|
||||
<?php
|
||||
$success = $total - $er - $outdated -$excluded ;
|
||||
$ERR = "VMs backups (<span class='text-light'>".$total." Success</span> - <span class='text-danger'>".$er." issues</span> - <span class='text-warning'>".$outdated." outdated </span>- <span class='text-info'>".$excluded.' excluded</span>)';
|
||||
$ERR = "$w_vmBackup (<span class='text-light'>".$total." $w_success</span> - <span class='text-danger'>".$er." $w_issues</span> - <span class='text-warning'>".$outdated." $w_outdated </span>- <span class='text-info'>".$excluded." $w_excluded</span>)";
|
||||
?>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
186
Hyper-V/VMs.php
Normal file
186
Hyper-V/VMs.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php $answers = Invoke_Infra("select * from cmdb_vms where decomtime is null order by name"); ?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h2><span class="badge text-bg-secondary " style="width:100%;" ><?php echo $ti_19 . " - " . count($answers). " " .$w_VMs; ?></span></h2>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mb-1 text-dark text-uppercase text-center">
|
||||
<i class="bi bi-hourglass-split"></i><br> Work in progress ...
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-secondary progress-bar-striped progress-bar-animated" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<div id="result" class="text-center"></div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="vm">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='vm' data-sortable='true'><?php echo $w_name; ?></th>
|
||||
<th data-field='owner' data-sortable='true'><?php echo $w_owner; ?></th>
|
||||
<th data-field='infos' data-sortable='true'>Infos</th>
|
||||
<th data-field='PreferedOwner' data-sortable='true'><?php echo $w_prefferedNode; ?></th>
|
||||
<th data-field='gen-ver' data-sortable='true'>Gen & Version</th>
|
||||
<th data-field='LastInventory' data-sortable='true'><?php echo $w_lastUpdate; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
$wrongOwner = $unclustered = $v10 = 0 ; $msg ="" ; $CpuComp = 0; $DynVHD = 0;
|
||||
foreach ($answers as $row) {
|
||||
echo "<tr>";
|
||||
# Name
|
||||
$state = '<i class="bi bi-question-square-fill text-primary"></i> ';
|
||||
if($row['State'] == "Running"){$state = '<i class="bi bi-play-btn-fill text-success"></i> ';}
|
||||
if($row['State'] == "Off" || $row['State'] == "Stopping"){$state = '<i class="bi bi-stop-btn-fill text-danger"></i> ';}
|
||||
if($row['State'] == "Paused"){$state = '<i class="bi bi-pause-btn-fill text-warning"></i> ';}
|
||||
echo "<td>".$state." <b>".$row['Name']."</td>";
|
||||
# Owner
|
||||
echo "<td>".$row['Owner']."</td>";
|
||||
# Infos
|
||||
echo '<td><span class="badge rounded-pill bg-secondary text-light">'.$row['Memory'].'GB / '.$row['CPU'].' CPU</span> ';
|
||||
echo '<span class="badge rounded-pill bg-secondary text-light">VHDx(s) : '.$row['TotalDiskSize'].' GB</span> ';
|
||||
if($row['WWPNs'] != ""){
|
||||
echo '<span class="badge rounded-pill bg-primary text-light">LUN(s)</span> ';
|
||||
}
|
||||
if($row['CPUcomp'] == "True"){
|
||||
echo '<span class="badge rounded-pill bg-warning text-dark">CPU Comp.</span> '; $CpuComp++;
|
||||
}
|
||||
if($row['DynamicVHD'] == "Y"){
|
||||
echo '<span class="badge rounded-pill bg-secondary text-warning">Dyn. VHDX</span> '; $DynVHD++;
|
||||
}
|
||||
echo "</td>";
|
||||
# Prefered Owner
|
||||
if($row['Owner'] == $row['PreferredOwner']){
|
||||
echo '<td><span class="badge rounded-pill bg-success text-light">'.$row['Owner'].'</span></td> ';
|
||||
}else{
|
||||
if($row['IsClustered'] == 'True'){
|
||||
echo '<td><span class="badge rounded-pill bg-warning text-dark">'.$row['Owner'].'</span></td> ';
|
||||
$wrongOwner++;
|
||||
}else{
|
||||
echo '<td><span class="badge rounded-pill bg-danger text-dark">'.$w_unclustered.'</span></td> ';
|
||||
$unclustered++;
|
||||
}
|
||||
}
|
||||
# Gen & Ver
|
||||
echo "<td>";
|
||||
if($row['Generation'] == "2"){
|
||||
echo '<span class="badge rounded-pill bg-success text-light">Gen '.$row['Generation'].'</span> ';
|
||||
}else{
|
||||
echo '<span class="badge rounded-pill bg-warning text-dark">Gen '.$row['Generation'].'</span> ';
|
||||
}
|
||||
if($row['Version'] == "10.0"){
|
||||
echo '<span class="badge rounded-pill bg-success text-light">Ver '.$row['Version'].'</span> ';
|
||||
}else{
|
||||
echo '<span class="badge rounded-pill bg-warning text-dark">Ver '.$row['Version'].'</span> ';
|
||||
$v10++;
|
||||
}
|
||||
echo "</td>";
|
||||
# TS
|
||||
echo "<td>".$row['LastInventory']."</td>";
|
||||
echo "</tr>";
|
||||
|
||||
|
||||
}
|
||||
if($wrongOwner > 0){$msg = "<span class='badge bg-warning text-dark'>$wrongOwner $w_VMOnWrongOwner</span>";}
|
||||
if($unclustered > 0){$msg .= " <span class='badge bg-danger'>$unclustered $w_unclusteredVMs</span>";}
|
||||
if($v10 > 0){$msg .= " <span class='badge bg-warning text-dark'>$v10 $w_VMs < Ver 10.0</span>";}
|
||||
if($CpuComp > 0){$msg .= " <span class='badge bg-warning text-dark'>$CpuComp $w_vmCpuChecked</span>";}
|
||||
if($DynVHD > 0){$msg .= " <span class='badge bg-secondary text-warning'>$DynVHD $w_vmDynamicVHD</span>";}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
$(function() {
|
||||
const table = $('#t1');
|
||||
// Exécution initiale pour définir la hauteur
|
||||
adjustTableHeight();
|
||||
|
||||
// Événement de redimensionnement
|
||||
$(window).on('resize', function() {
|
||||
adjustTableHeight();
|
||||
});
|
||||
|
||||
function adjustTableHeight() {
|
||||
const windowHeight = $(window).height();
|
||||
const tableTop = table.offset().top;
|
||||
const footerHeight = 50; // Hauteur estimée pour d'éventuels éléments en bas
|
||||
let availableHeight = windowHeight - tableTop - footerHeight;
|
||||
|
||||
// Définir une hauteur minimale
|
||||
availableHeight = Math.max(availableHeight, 400);
|
||||
|
||||
table.bootstrapTable('refreshOptions', {
|
||||
height: availableHeight
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
document.getElementById("result").innerHTML = "<?php echo "<h4>".$msg."</h4>" ; ?>";
|
||||
|
||||
</script>
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -41,7 +41,7 @@
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold"
|
||||
style="width:100%;"><?php echo $_GET['cluster'] . " Details"; ?></span></h1>
|
||||
style="width:100%;"><?php echo $_GET['cluster']; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
@@ -56,10 +56,8 @@
|
||||
|
||||
?>
|
||||
<div class="container-fluid" style="zoom:100%">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold"
|
||||
style="width:100%;"><?php echo $_GET['cluster']; ?></span></h2>
|
||||
<?php
|
||||
echo "<b>Worst Failover scenario available memory : </b>" . ($clmem - $vmmem) . " / " . $clmem . " GB";
|
||||
echo "<b>$w_worstScenario : </b>" . ($clmem - $vmmem) . " / " . $clmem . " GB";
|
||||
$pcent = round(($clmem - $vmmem) / $clmem * 100);
|
||||
$pcent_restant = 100 - $pcent;
|
||||
if ($pcent <= 5) {
|
||||
@@ -86,11 +84,11 @@
|
||||
foreach ($clusters as $cluster) {
|
||||
echo "<div class='col-6'>";
|
||||
$nbvm = Invoke_Infra("select count(*) as nbvm, sum(memory) as vmmem from cmdb_vms where owner ='" . $cluster['node'] . "' and decomtime is null");
|
||||
echo '<h3><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">' . $cluster['node'] . " - " . $nbvm[0]['nbvm'] . " VMs <small><small> <i class='bi bi-clock'></i> " . $cluster['ts'] . "</small></small></span></h3><br>";
|
||||
echo '<h3><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">' . $cluster['node'] . " - " . $nbvm[0]['nbvm'] . " $w_VMs <small><small> <i class='bi bi-clock'></i> " . $cluster['ts'] . "</small></small></span></h3><br>";
|
||||
#Memory
|
||||
echo "<div class='row'>";
|
||||
echo "<div class='col'>";
|
||||
echo "<b>Free Memory : </b>" . ($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) . " / " . ($cluster['node_ram'] - 32) . " GB";
|
||||
echo "<b>$w_freeMem : </b>" . ($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) . " / " . ($cluster['node_ram'] - 32) . " GB";
|
||||
$pcent = round(($cluster['node_ram'] - 32 - $nbvm[0]['vmmem']) / ($cluster['node_ram'] - 32) * 100);
|
||||
$pcent_restant = 100 - $pcent;
|
||||
if ($pcent <= 5) {
|
||||
@@ -138,7 +136,7 @@
|
||||
$total = explode(";", $csv)[1];
|
||||
$used = explode(";", $csv)[2];
|
||||
$free = $total - $used;
|
||||
echo " Free : </b>" . $free . "/" . $total . " GB";
|
||||
echo " : </b>" . $free . "/" . $total . " GB";
|
||||
echo "</div>";
|
||||
echo "<div class='col'>";
|
||||
$pcent = round($free / $total * 100);
|
||||
@@ -157,7 +155,7 @@
|
||||
<div class='progress-bar bg-dark progress-bar-striped' role='progressbar' style='width: $pcent_restant%;' aria-valuenow='$pcent_restant' aria-valuemin='0' aria-valuemax='100'></div>
|
||||
<div class='progress-bar $color' role='progressbar' style='width: $pcent%;' aria-valuenow='$pcent' aria-valuemin='0' aria-valuemax='100'></div>
|
||||
</div>";
|
||||
echo "</div>";
|
||||
echo "</small></div>";
|
||||
} else {
|
||||
echo "<div class='col'></div><br>";
|
||||
}
|
||||
@@ -193,10 +191,10 @@
|
||||
echo '<span class="badge rounded-pill bg-primary text-light">LUN(s)</span> ';
|
||||
}
|
||||
if ($vm['IsClustered'] != "True") {
|
||||
echo '<span class="badge rounded-pill bg-danger text-dark"><small>Unclustered</small></span> ';
|
||||
echo "<span class='badge rounded-pill bg-danger text-dark'><small>$w_unclustered</small></span> ";
|
||||
} else {
|
||||
if ($vm['Owner'] != $vm['PreferredOwner']) {
|
||||
echo '<span class="badge rounded-pill bg-warning text-dark"><small>Wrong Owner</small></span> ';
|
||||
echo "<span class='badge rounded-pill bg-warning text-dark'><small>$w_wrongOwner</small></span> ";
|
||||
}
|
||||
}
|
||||
echo "</div>";
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
$folders = Invoke_Infra("SELECT * FROM FLS_and_PRS where typ in('PROJET','TEAMS') order by [server], folder");
|
||||
$answers = Invoke_Infra("SELECT * FROM v_HyperV_Memory_Optimization order by Total_VM_Savings_GB desc");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
@@ -44,8 +44,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Project and Team folders <small><small>(<?php echo count($folders); ?> entries)</small></small></span></h1>
|
||||
<h6>Updated every day at 07:00:00</h6>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_5 ;?> </span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -71,32 +70,22 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true">Server</th>
|
||||
<th data-field="Folder" data-sortable="true">Folder</th>
|
||||
<th data-field="Type" data-sortable="true">Type</th>
|
||||
<th data-field="ACL" data-sortable="true">ACL</th>
|
||||
<th data-field="Quota" data-sortable="true">Quota</th>
|
||||
<th data-field="Size" data-sortable="true">Size</th>
|
||||
<th data-field="Users" data-sortable="true">Effective Users</th>
|
||||
<th data-field="name" data-sortable="true"><?php echo $w_host;?></th>
|
||||
<th data-field="VMs" data-sortable="true"><?php echo $w_VMs;?></th>
|
||||
<th data-field="Assigned" data-sortable="true"><?php echo $w_vmAssignedGB;?></th>
|
||||
<th data-field="MaxUsed" data-sortable="true"><?php echo $w_vmMaxUsedGB ;?></th>
|
||||
<th data-field="Savings" data-sortable="true"><?php echo $w_potentialSavingsGB;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($folders as $answer) {
|
||||
if($answer['acl'] == "" || $answer['users'] == 0){
|
||||
echo "<tr class='table-warning'>";
|
||||
}else{
|
||||
echo "<tr>";
|
||||
}
|
||||
echo "<td class='text-nowrap'>".$answer['server']."</td>";
|
||||
echo "<td>".$answer['folder']."</td>";
|
||||
echo "<td>".$answer['typ']."</td>";
|
||||
echo "<td>".$answer['acl']."</td>";
|
||||
echo "<td>".$answer['quota']."</td>";
|
||||
echo "<td>".$answer['size']."</td>";
|
||||
echo "<td>".$answer['users']."</td>";
|
||||
echo "</tr>";
|
||||
foreach ($answers as $row) {
|
||||
echo "<tr><td>".$row['HyperV_Host']."</td>";
|
||||
echo "<td>".$row['VM_Count']."</td>";
|
||||
echo "<td>".$row['Total_VM_Assigned_GB']."</td>";
|
||||
echo "<td>".$row['Total_VM_Max_Usage_GB']."</td>";
|
||||
echo "<td>".$row['Total_VM_Savings_GB']."</td></tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
@@ -115,7 +104,7 @@
|
||||
<SCRIPT>
|
||||
let table = $('#t1');
|
||||
$(document).ready(function() {
|
||||
$('#t1').DataTable({
|
||||
table.DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
@@ -135,5 +124,4 @@
|
||||
}
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
</script>
|
||||
|
||||
</SCRIPT>
|
||||
120
Inventory/ClusterResource.php
Normal file
120
Inventory/ClusterResource.php
Normal file
@@ -0,0 +1,120 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<style>
|
||||
.cluster-separator td {
|
||||
border-top: 3px solid lightseagreen; /* Bordure épaisse et sombre */
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
set_time_limit(300);
|
||||
$Clusters = Invoke_Infra(" select * from cmdb_clusterResources
|
||||
where Name not in('Available Storage')
|
||||
order by Cluster, name");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_18; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mb-1 text-dark text-uppercase text-center">
|
||||
<i class="bi bi-hourglass-split"></i><br> Work in progress ...
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-secondary progress-bar-striped progress-bar-animated" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true"><?php echo $w_cluster; ?></th>
|
||||
<th data-field="Folder" data-sortable="true"><?php echo $w_resource; ?></th>
|
||||
<th data-field="ACL" data-sortable="true"><?php echo $w_owner; ?></th>
|
||||
<th data-field="AD" data-sortable="true"><?php echo $w_state; ?></th>
|
||||
<th data-field="Enabled" data-sortable="true">Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
$last = "";
|
||||
foreach ($Clusters as $answer) {
|
||||
$current = $answer['Cluster'];
|
||||
if($current != $last) {
|
||||
echo "<tr class='cluster-separator'>";
|
||||
echo "<td class='text-nowrap table-secondary'><b>" . $answer['Cluster'] . "</td>";
|
||||
$last = $current;
|
||||
}else{
|
||||
echo "<tr><td></td>";
|
||||
}
|
||||
echo "<td>".$answer['Name']."</td>";
|
||||
echo "<td>".$answer['Owner']."</td>";
|
||||
echo "<td>".$answer['State']."</td>";
|
||||
echo "<td>".$answer['ts']."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
<script src="/js/tableResize.js"></script>
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -106,35 +106,45 @@
|
||||
<!-- Main content -->
|
||||
|
||||
<!-- OS, Host, Site, Maintenance -->
|
||||
<div id="OS" class="fs-4">
|
||||
<span class="badge rounded-pill bg-secondary text-light"><?= $OSName ?></span>
|
||||
<?php if($OSKernel){echo " <span class='badge rounded-pill bg-secondary text-light'>$OSKernel</span>";} ?>
|
||||
<?php
|
||||
if(is_array($Qvm)){
|
||||
$site = Invoke_Infra("SELECT site from cmdb_physical_site where hostname ='".$Qvm[0]['Owner']."'")[0]['site'];
|
||||
if($Qvm[0]['Owner'] == $Qvm[0]['PreferredOwner']){
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>Host : ".$Qvm[0]['Owner']."</span>";
|
||||
<div id="OS" class="fs-4 d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<span class="badge rounded-pill bg-secondary text-light"><?= $OSName ?></span>
|
||||
<?php if($OSKernel){echo " <span class='badge rounded-pill bg-secondary text-light'>$OSKernel</span>";} ?>
|
||||
<?php
|
||||
if(is_array($Qvm)){
|
||||
$site = Invoke_Infra("SELECT site from cmdb_physical_site where hostname ='".$Qvm[0]['Owner']."'")[0]['site'] ?? "?";
|
||||
if($Qvm[0]['Owner'] == $Qvm[0]['PreferredOwner']){
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>$w_host : ".$Qvm[0]['Owner']."</span>";
|
||||
}else{
|
||||
echo " <span class='badge rounded-pill bg-warning text-dark'>$w_host : ".$Qvm[0]['Owner']."</span>";
|
||||
}
|
||||
}else{
|
||||
echo " <span class='badge rounded-pill bg-warning text-dark'>Host : ".$Qvm[0]['Owner']."</span>";
|
||||
if(is_array($Qx)){
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>$w_host : ".$Qx[0]['Owner']."</span>";
|
||||
$site = substr($Qx[0]['Owner'],0,3);
|
||||
}else{
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>Physical</span>";
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>".Invoke_GLPI("select a.name from glpi_computermodels a left join glpi_computers b on a.id = b.computermodels_id where b.name = '$server'")[0]['name']."</span>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(is_array($Qx)){
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>Host : ".$Qx[0]['Owner']."</span>";
|
||||
$site = substr($Qx[0]['Owner'],0,3);
|
||||
}else{
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>Physical</span>";
|
||||
echo " <span class='badge rounded-pill bg-success text-light'>".Invoke_GLPI("select a.name from glpi_computermodels a left join glpi_computers b on a.id = b.computermodels_id where b.name = '$server'")[0]['name']."</span>";
|
||||
?>
|
||||
<?php if(isset($site)){echo "<span class='badge rounded-pill bg-secondary text-light'>Site : $site</span>";} ?>
|
||||
<?php if(is_array($Qvm) && $Qvm[0]['IsClustered'] != 'True'){echo " <span class='badge rounded-pill bg-warning text-dark'>Unclustered VM</span>";} ?>
|
||||
<?php
|
||||
if(is_array($m) && ($m[0]['scom'] == "Y" || $m[0]['zabbix'] == "Y" || $m[0]['aixcmdb'] == "Y")){
|
||||
echo " <span class='badge rounded-pill bg-primary text-dark blinking'>Maintenance ON</span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php if(isset($site)){echo "<span class='badge rounded-pill bg-secondary text-light'>Site : $site</span>";} ?>
|
||||
<?php if(is_array($Qvm) && $Qvm[0]['IsClustered'] != 'True'){echo " <span class='badge rounded-pill bg-warning text-dark'>Unclustered VM</span>";} ?>
|
||||
<?php
|
||||
$m = Invoke_Infra("select * from Maintenance_Status where server ='$server'");
|
||||
if($m[0]['scom'] == "Y" || $m[0]['zabbix'] == "Y" || $m[0]['aixcmdb'] == "Y"){
|
||||
echo " <span class='badge rounded-pill bg-primary text-dark blinking'>Maintenance ON</span>";
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="ms-3">
|
||||
<a href="https://azt-qat-s1spt.armony.net/servermanager/connections/server/<?= strtoupper($server) ?>.armony.net/tools/overview"
|
||||
target="_blank"
|
||||
class="badge rounded-pill bg-primary text-light text-decoration-none">
|
||||
<i class="bi bi-cpu-fill"></i> Admin Center
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@@ -154,7 +164,7 @@
|
||||
<div class="chart-container col">
|
||||
<div class="card mb-3" style="border: 3px solid black">
|
||||
<div class="card-header text-dark text-center fs-5 bg-info">
|
||||
<i class="fs-7 bi-memory text-black"></i><b> Memory : <?= $memory ?></b>
|
||||
<i class="fs-7 bi-memory text-black"></i><b> <?php echo $w_memory;?> : <?= $memory ?></b>
|
||||
</div>
|
||||
<div class="card-body bg-dark fs-4">
|
||||
<canvas id="ramChart"></canvas>
|
||||
@@ -226,27 +236,27 @@
|
||||
<!-- Last boot, last rollup, next rollup -->
|
||||
<?php
|
||||
if(is_array($Qw) && $Qw[0]['lastBoot'] != ""){
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Boot : ".$Qw[0]['lastBoot']."</span>";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastReboot : ".$Qw[0]['lastBoot']."</span>";
|
||||
}elseif(is_array($Qx) && $Qx[0]['LastBoot'] != ""){
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Boot : ".$Qx[0]['LastBoot']."</span>";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastReboot : ".$Qx[0]['LastBoot']."</span>";
|
||||
}
|
||||
if(is_array($Qw) && $Qw[0]['LastKBUpdate'] != ""){
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>Last Update : ".$Qw[0]['LastKBUpdate']."</span>";
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastUpdate : ".$Qw[0]['LastKBUpdate']."</span>";
|
||||
}elseif(is_array($Qx) && $Qx[0]['LastUpdate'] != ""){
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Last Update : ".$Qx[0]['LastUpdate']."</span>";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>$w_lastUpdate : ".$Qx[0]['LastUpdate']."</span>";
|
||||
}
|
||||
if($OSType == "Windows"){
|
||||
$date = Invoke_Entry01("select next from rollupdate where Server='$server'");
|
||||
if(is_array($date)){
|
||||
if($date != ""){
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>Next Rollup : ".$date[0]['next']."</span>";
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>$w_nextRollup : ".$date[0]['next']."</span>";
|
||||
}
|
||||
}
|
||||
}
|
||||
if($OSType == "Linux"){
|
||||
$date = Invoke_Infra("select Next from rollup_linux_calendar where Server='$server'")[0]['Next'];
|
||||
if($date != ""){
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>Next Rollup : $date </span>";
|
||||
echo " <span class='badge rounded-pill bg-secondary text-light fs-5'>$w_nextRollup : $date </span>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -298,17 +308,33 @@
|
||||
<!-- Backup for AIX, Linux -->
|
||||
<?php
|
||||
if(is_array($Qx)){
|
||||
$backup = Invoke_Infra("select * from X_cmdb_Backupsys where HOSTNAME='$server'");
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>LastBackup : ".explode(".",$backup[0]['LastBackup'])[0]."</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : ".$backup[0]['BackupType']."</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Media : ".$backup[0]['Location']."</span>";
|
||||
try {
|
||||
$backup = Invoke_Infra("select * from X_cmdb_Backupsys where HOSTNAME='$server'");
|
||||
if(is_array($backup) && $backup[0]['LastBackup']) {
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>LastBackup : " . explode(".", $backup[0]['LastBackup'])[0] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>BackupType : " . $backup[0]['BackupType'] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Media : " . $backup[0]['Location'] . "</span>";
|
||||
}
|
||||
} catch (Exception $e) {} // Catch any potential errors during backup information retrieval
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<!-- Network configuration for Windows -->
|
||||
<?php
|
||||
if(is_array($Qw)){
|
||||
$answer = Invoke_Entry01("SELECT Server,IpAddress,Gateway,DHCP,Subnet,MacAddress,DNSSuffix,DNS FROM networkcards where Server='$server'");
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>IP : " . $answer[0]['IpAddress'] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Mask : " . $answer[0]['Subnet'] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Gateway : " . $answer[0]['Gateway'] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>DNS : " . $answer[0]['DNS'] . "</span> ";
|
||||
echo "<span class='badge rounded-pill bg-secondary text-light fs-5'>Mac : " . $answer[0]['MacAddress'] . "</span> ";
|
||||
}
|
||||
?>
|
||||
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
||||
function decypher(string $name): ?string {
|
||||
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||
|
||||
foreach ([$openssl,$cmsFile,$certPem,$keyPem] as $p) {
|
||||
if (!is_file($p)) { error_log("Missing file: $p"); return null; }
|
||||
}
|
||||
|
||||
$cmd = '"' . $openssl . '" cms -decrypt -inform PEM'
|
||||
. ' -in ' . escapeshellarg($cmsFile)
|
||||
. ' -recip ' . escapeshellarg($certPem)
|
||||
. ' -inkey ' . escapeshellarg($keyPem)
|
||||
. ' -out -';
|
||||
|
||||
$spec = [
|
||||
0 => ['pipe','r'], // stdin (unused)
|
||||
1 => ['pipe','w'], // stdout -> texte déchiffré
|
||||
2 => ['pipe','w'], // stderr -> erreurs OpenSSL
|
||||
];
|
||||
$proc = proc_open($cmd, $spec, $pipes);
|
||||
if (!is_resource($proc)) { error_log('proc_open failed'); return null; }
|
||||
fclose($pipes[0]); // rien à envoyer en stdin
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
|
||||
$code = proc_close($proc);
|
||||
|
||||
if ($code !== 0) {
|
||||
error_log("OpenSSL failed (code $code): $stderr");
|
||||
return null;
|
||||
}
|
||||
return $stdout;
|
||||
}
|
||||
function DB_ZABBIX()
|
||||
{
|
||||
$host = 'aztprdzabbix52.armony.net';
|
||||
$dbname = 'zabbix';
|
||||
$user = 'patrick';
|
||||
$pass = decypher( 'zabbix');
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
|
||||
return $pdo;
|
||||
}
|
||||
$pdo = DB_ZABBIX();
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
||||
function decypher(string $name): ?string {
|
||||
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||
|
||||
foreach ([$openssl,$cmsFile,$certPem,$keyPem] as $p) {
|
||||
if (!is_file($p)) { error_log("Missing file: $p"); return null; }
|
||||
}
|
||||
|
||||
$cmd = '"' . $openssl . '" cms -decrypt -inform PEM'
|
||||
. ' -in ' . escapeshellarg($cmsFile)
|
||||
. ' -recip ' . escapeshellarg($certPem)
|
||||
. ' -inkey ' . escapeshellarg($keyPem)
|
||||
. ' -out -';
|
||||
|
||||
$spec = [
|
||||
0 => ['pipe','r'], // stdin (unused)
|
||||
1 => ['pipe','w'], // stdout -> texte déchiffré
|
||||
2 => ['pipe','w'], // stderr -> erreurs OpenSSL
|
||||
];
|
||||
$proc = proc_open($cmd, $spec, $pipes);
|
||||
if (!is_resource($proc)) { error_log('proc_open failed'); return null; }
|
||||
fclose($pipes[0]); // rien à envoyer en stdin
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
|
||||
$code = proc_close($proc);
|
||||
|
||||
if ($code !== 0) {
|
||||
error_log("OpenSSL failed (code $code): $stderr");
|
||||
return null;
|
||||
}
|
||||
return $stdout;
|
||||
}
|
||||
function DB_ZABBIX()
|
||||
{
|
||||
$host = 'aztprdzabbix52.armony.net';
|
||||
$dbname = 'zabbix';
|
||||
$user = 'patrick';
|
||||
$pass = decypher( 'zabbix');
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
|
||||
return $pdo;
|
||||
}
|
||||
$pdo = DB_ZABBIX();
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,48 @@
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
||||
function decypher(string $name): ?string {
|
||||
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||
|
||||
foreach ([$openssl,$cmsFile,$certPem,$keyPem] as $p) {
|
||||
if (!is_file($p)) { error_log("Missing file: $p"); return null; }
|
||||
}
|
||||
|
||||
$cmd = '"' . $openssl . '" cms -decrypt -inform PEM'
|
||||
. ' -in ' . escapeshellarg($cmsFile)
|
||||
. ' -recip ' . escapeshellarg($certPem)
|
||||
. ' -inkey ' . escapeshellarg($keyPem)
|
||||
. ' -out -';
|
||||
|
||||
$spec = [
|
||||
0 => ['pipe','r'], // stdin (unused)
|
||||
1 => ['pipe','w'], // stdout -> texte déchiffré
|
||||
2 => ['pipe','w'], // stderr -> erreurs OpenSSL
|
||||
];
|
||||
$proc = proc_open($cmd, $spec, $pipes);
|
||||
if (!is_resource($proc)) { error_log('proc_open failed'); return null; }
|
||||
fclose($pipes[0]); // rien à envoyer en stdin
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
|
||||
$code = proc_close($proc);
|
||||
|
||||
if ($code !== 0) {
|
||||
error_log("OpenSSL failed (code $code): $stderr");
|
||||
return null;
|
||||
}
|
||||
return $stdout;
|
||||
}
|
||||
function DB_ZABBIX()
|
||||
{
|
||||
$host = 'aztprdzabbix52.armony.net';
|
||||
$dbname = 'zabbix';
|
||||
$user = 'patrick';
|
||||
$pass = decypher( 'zabbix');
|
||||
$pdo = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
|
||||
return $pdo;
|
||||
}
|
||||
$pdo = DB_ZABBIX();
|
||||
|
||||
$server = strtoupper($_GET['c']);
|
||||
|
||||
@@ -1,9 +1,56 @@
|
||||
<?php
|
||||
header('Content-Type: application/json');
|
||||
include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ;
|
||||
function decypher(string $name): ?string {
|
||||
$openssl = 'C:\Program Files\FireDaemon OpenSSL 3\bin\openssl.exe';
|
||||
$cmsFile = "F:\\Include\\dat\\$name.p7m";
|
||||
$certPem = "F:\\Include\\certs\\cert_only.pem";
|
||||
$keyPem = "F:\\Include\\certs\\key_only.pem";
|
||||
|
||||
foreach ([$openssl,$cmsFile,$certPem,$keyPem] as $p) {
|
||||
if (!is_file($p)) { error_log("Missing file: $p"); return null; }
|
||||
}
|
||||
|
||||
$cmd = '"' . $openssl . '" cms -decrypt -inform PEM'
|
||||
. ' -in ' . escapeshellarg($cmsFile)
|
||||
. ' -recip ' . escapeshellarg($certPem)
|
||||
. ' -inkey ' . escapeshellarg($keyPem)
|
||||
. ' -out -';
|
||||
|
||||
$spec = [
|
||||
0 => ['pipe','r'], // stdin (unused)
|
||||
1 => ['pipe','w'], // stdout -> texte déchiffré
|
||||
2 => ['pipe','w'], // stderr -> erreurs OpenSSL
|
||||
];
|
||||
$proc = proc_open($cmd, $spec, $pipes);
|
||||
if (!is_resource($proc)) { error_log('proc_open failed'); return null; }
|
||||
fclose($pipes[0]); // rien à envoyer en stdin
|
||||
|
||||
$stdout = stream_get_contents($pipes[1]); fclose($pipes[1]);
|
||||
$stderr = stream_get_contents($pipes[2]); fclose($pipes[2]);
|
||||
$code = proc_close($proc);
|
||||
|
||||
if ($code !== 0) {
|
||||
error_log("OpenSSL failed (code $code): $stderr");
|
||||
return null;
|
||||
}
|
||||
return $stdout;
|
||||
}
|
||||
function DB_INFRA() {
|
||||
$user="INFRA_dbo";
|
||||
$pwd=decypher("infra");
|
||||
$server="DUN-PRD-R1MSSQL.armony.net\PRD";
|
||||
$database="INFRA";
|
||||
$conn = odbc_connect("Driver={SQL Server};Server=$server;Database=$database;", $user, $pwd);
|
||||
return $conn ;
|
||||
}
|
||||
if (isset($_GET['term'])) {
|
||||
$term = $_GET['term'];
|
||||
$query = "SELECT hostname AS serv FROM cmdb_srvall WHERE hostname LIKE '%$term%' UNION SELECT hostname AS serv FROM x_SRVALL WHERE hostname LIKE '%$term%'";
|
||||
$query = "SELECT hostname AS serv FROM cmdb_srvall
|
||||
WHERE hostname LIKE '%$term%' AND (DECOM IS NULL OR DATEDIFF(day, DECOM, GETDATE()) <30)
|
||||
UNION
|
||||
SELECT hostname AS serv FROM x_SRVALL
|
||||
WHERE hostname LIKE '%$term%' AND (DECOM IS NULL OR DATEDIFF(day, DECOM, GETDATE()) <30)";
|
||||
|
||||
$conn = DB_INFRA();
|
||||
$rs = odbc_exec($conn, $query);
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
@@ -24,8 +24,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
155
Network/dhcp_detail.php
Normal file
155
Network/dhcp_detail.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||
|
||||
$server = $_GET['s'] ?? '';
|
||||
$ts = date("Y-m-d");
|
||||
|
||||
$data = Invoke_Entry01("SELECT dump FROM dump_dhcp where ts ='$ts' and server = '$server'");
|
||||
$xmlRaw = $data[0]['dump'] ?? '';
|
||||
|
||||
if (!$xmlRaw) {
|
||||
die("Aucune donnée trouvée pour le serveur $server à la date $ts");
|
||||
}
|
||||
|
||||
$xmlString = mb_convert_encoding($xmlRaw, 'UTF-8', 'ISO-8859-1');
|
||||
if (!str_contains($xmlString, '<?xml')) {
|
||||
$xmlString = '<?xml version="1.0" encoding="UTF-8"?>' . $xmlString;
|
||||
}
|
||||
|
||||
try {
|
||||
$xml = new SimpleXMLElement($xmlString);
|
||||
} catch (Exception $e) {
|
||||
echo "Erreur de parsing XML : " . $e->getMessage();
|
||||
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>
|
||||
70
Network/dhcp_servers.php
Normal file
70
Network/dhcp_servers.php
Normal file
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
// Include global configurations
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||
|
||||
$ts = date("Y-m-d");
|
||||
$serversData = Invoke_Entry01("SELECT Server,TS FROM dump_dhcp where ts ='$ts' order by server asc");
|
||||
|
||||
?>
|
||||
<!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 text-bg-secondary w-100"><?php echo count($serversData); ?> DHCP <?php echo $w_server; ?></span></h1>
|
||||
|
||||
<div class="container mt-4">
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true"><?php echo $w_server; ?></th>
|
||||
<th data-field="Last" data-sortable="true"><?php echo $w_backuplu; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($serversData as $row): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="dhcp_detail.php?s=<?php echo urlencode($row['Server']); ?>" class="fw-bold">
|
||||
<?php echo $row['Server']; ?>
|
||||
</a>
|
||||
</td>
|
||||
<td><?php echo $row['TS']; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</html>
|
||||
@@ -62,7 +62,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Rollup Calendar</h6></span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_14;?></h6></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -88,20 +88,20 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true">Server</th>
|
||||
<th data-field="Server" data-sortable="true"><?php echo $w_server;?></th>
|
||||
<th data-field="Type" data-sortable="true">Type</th>
|
||||
<th data-field="January" data-sortable="true">January</th>
|
||||
<th data-field="February" data-sortable="true">February</th>
|
||||
<th data-field="March" data-sortable="true">March</th>
|
||||
<th data-field="April" data-sortable="true">April</th>
|
||||
<th data-field="May" data-sortable="true">May</th>
|
||||
<th data-field="June" data-sortable="true">June</th>
|
||||
<th data-field="July" data-sortable="true">July</th>
|
||||
<th data-field="August" data-sortable="true">August</th>
|
||||
<th data-field="September" data-sortable="true">September</th>
|
||||
<th data-field="October" data-sortable="true">October</th>
|
||||
<th data-field="November" data-sortable="true">November</th>
|
||||
<th data-field="December" data-sortable="true">December</th>
|
||||
<th data-field="January" data-sortable="true">01</th>
|
||||
<th data-field="February" data-sortable="true">02</th>
|
||||
<th data-field="March" data-sortable="true">03</th>
|
||||
<th data-field="April" data-sortable="true">04</th>
|
||||
<th data-field="May" data-sortable="true">05</th>
|
||||
<th data-field="June" data-sortable="true">06</th>
|
||||
<th data-field="July" data-sortable="true">07</th>
|
||||
<th data-field="August" data-sortable="true">08</th>
|
||||
<th data-field="September" data-sortable="true">09</th>
|
||||
<th data-field="October" data-sortable="true">10</th>
|
||||
<th data-field="November" data-sortable="true">11</th>
|
||||
<th data-field="December" data-sortable="true">12</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
44
SecureBoot/SecureBoot-SRV.php
Normal file
44
SecureBoot/SecureBoot-SRV.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<!-- Chart -->
|
||||
<script src="/js/chart.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ; ?> <!-- Database connexion -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3 vh-100">
|
||||
<iframe src="SecureBoot_Dashboard_Latest_SRV.html" style="width: 100%; height: 100%; border: none;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
44
SecureBoot/SecureBoot-WS.php
Normal file
44
SecureBoot/SecureBoot-WS.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<!-- Chart -->
|
||||
<script src="/js/chart.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ; ?> <!-- Database connexion -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3 vh-100">
|
||||
<iframe src="SecureBoot_Dashboard_Latest_WS.html" style="width: 100%; height: 100%; border: none;"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Home Directories with issues <small><small>(<?php echo count($folders); ?> entries) </small></small></span></h1><h6>Updated every day at 07:00:00</h6>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_8;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -75,15 +75,15 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true">Server</th>
|
||||
<th data-field="Folder" data-sortable="true">Folder</th>
|
||||
<th data-field="Server" data-sortable="true"><?php echo $w_server;?></th>
|
||||
<th data-field="Folder" data-sortable="true"><?php echo $w_folder;?></th>
|
||||
<th data-field="ACL" data-sortable="true">ACL</th>
|
||||
<th data-field="AD" data-sortable="true">in AD</th>
|
||||
<th data-field="Enabled" data-sortable="true">Account Enabled</th>
|
||||
<th data-field="AD" data-sortable="true"><?php echo $w_inAD;?></th>
|
||||
<th data-field="Enabled" data-sortable="true"><?php echo $w_accountEnabled;?></th>
|
||||
<th data-field="o365" data-sortable="true">o365</th>
|
||||
<th data-field="Quota" data-sortable="true">Quota</th>
|
||||
<th data-field="Size" data-sortable="true">Size</th>
|
||||
<th data-field="LastLogon" data-sortable="true">Last Logon</th>
|
||||
<th data-field="Size" data-sortable="true"><?php echo $w_size;?></th>
|
||||
<th data-field="LastLogon" data-sortable="true"><?php echo $w_lastLogon;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Project and Team folders <small><small>(<?php echo count($folders); ?> entries) </small></small></span></h1><h6>Updated every day at 07:00:00</h6>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_7;?> <small><small>(<?php echo count($folders); ?> <?php echo $entries; ?>) </small></small></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -70,13 +70,13 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Server" data-sortable="true">Server</th>
|
||||
<th data-field="Folder" data-sortable="true">Folder</th>
|
||||
<th data-field="Server" data-sortable="true"><?php echo $w_server; ?></th>
|
||||
<th data-field="Folder" data-sortable="true"><?php echo $w_folder; ?></th>
|
||||
<th data-field="Type" data-sortable="true">Type</th>
|
||||
<th data-field="ACL" data-sortable="true">ACL</th>
|
||||
<th data-field="Quota" data-sortable="true">Quota</th>
|
||||
<th data-field="Size" data-sortable="true">Size</th>
|
||||
<th data-field="Users" data-sortable="true">Effective Users</th>
|
||||
<th data-field="Size" data-sortable="true"><?php echo $w_size; ?></th>
|
||||
<th data-field="Users" data-sortable="true"><?php echo $w_users; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -126,6 +126,10 @@
|
||||
.gain-item span:last-child {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.orphan-btn {
|
||||
width: 120px;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
@@ -141,7 +145,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">SVC Storage Dashboard</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_15 ;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
@@ -209,22 +213,34 @@
|
||||
}
|
||||
|
||||
// Orphan Hosts
|
||||
// Hosts / clusters without LUNs
|
||||
$orphanHosts = 0;
|
||||
$chc = "bg-success";
|
||||
$lHOST = "";
|
||||
|
||||
// Standalone hosts: heuristic only
|
||||
foreach ($json['Data']['Hosts'] as $host) {
|
||||
if ($host['protocol'] != "scsi") {
|
||||
$isStandalone = empty($host['host_cluster_id']);
|
||||
$isOffline = isset($host['status']) && $host['status'] === 'offline';
|
||||
$isScsi = isset($host['protocol']) && $host['protocol'] === 'scsi';
|
||||
|
||||
if ($isStandalone && $isOffline && $isScsi) {
|
||||
$orphanHosts++;
|
||||
$chc = "bg-warning";
|
||||
$lHOST .= $host['name'] . "<br>";
|
||||
$lHOST .= "[HOST] " . $host['name'] . "<br>";
|
||||
}
|
||||
}
|
||||
if ($json['Data']['Hostclusters']) {
|
||||
foreach ($json['Data']['Hostclusters'] as $host) {
|
||||
if ($host['protocol'] != "scsi") {
|
||||
|
||||
// Host clusters: real check with mapping_count
|
||||
if (!empty($json['Data']['Hostclusters'])) {
|
||||
foreach ($json['Data']['Hostclusters'] as $cluster) {
|
||||
$isScsi = isset($cluster['protocol']) && $cluster['protocol'] === 'scsi';
|
||||
$hasNoMappings = isset($cluster['mapping_count']) && (int)$cluster['mapping_count'] === 0;
|
||||
|
||||
if ($isScsi && $hasNoMappings) {
|
||||
$orphanHosts++;
|
||||
$chc = "bg-warning";
|
||||
$lHOST .= $host['name'] . "<br>";
|
||||
$lHOST .= "[CLUSTER] " . $cluster['name'] . "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +260,7 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Physical Capacity</h5>
|
||||
<h5 class="card-title"><?php echo $w_physicalCapacity;?></h5>
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<span class="percent"><?= number_format($data['physical_used_percent']) ?>%</span>
|
||||
@@ -270,7 +286,7 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Volume Capacity</h5>
|
||||
<h5 class="card-title"><?php echo $w_volumeCapacity;?></h5>
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<span class="percent"><?= number_format($data['volume_written_percent']) ?>%</span>
|
||||
@@ -292,13 +308,13 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Capacity gain</h5>
|
||||
<h5 class="card-title"><?php echo $w_capacityGain;?></h5>
|
||||
<div class="gain-item">
|
||||
<span><?= number_format($data['compression_savings_percent']) ?>% Compression</span>
|
||||
<span><?= formatBytes($data['compression_savings']) ?></span>
|
||||
</div>
|
||||
<div class="gain-item">
|
||||
<span><?= number_format($data['thin_savings_percent']) ?>% Thin provisioning</span>
|
||||
<span><?= number_format($data['thin_savings_percent']) ?>% <?php echo $w_thin;?></span>
|
||||
<span><?= formatBytes($data['thin_savings']) ?></span>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -328,7 +344,7 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Physical Capacity</h5>
|
||||
<h5 class="card-title"><?php echo $w_physicalCapacity;?></h5>
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<span class="percent"><?= number_format($data['physical_used_percent']) ?>%</span>
|
||||
@@ -354,7 +370,7 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Volume Capacity</h5>
|
||||
<h5 class="card-title"><?php echo $w_volumeCapacity;?></h5>
|
||||
<div class="d-flex justify-content-between align-items-start mb-2">
|
||||
<div>
|
||||
<span class="percent"><?= number_format($data['volume_written_percent']) ?>%</span>
|
||||
@@ -376,13 +392,13 @@
|
||||
<div class="card h-100" style="border: none">
|
||||
<div class="card-body capacity-block bg-dark">
|
||||
<div>
|
||||
<h5 class="card-title">Capacity gain</h5>
|
||||
<h5 class="card-title"><?php echo $w_capacityGain;?></h5>
|
||||
<div class="gain-item">
|
||||
<span><?= number_format($data['compression_savings_percent']) ?>% Compression</span>
|
||||
<span><?= formatBytes($data['compression_savings']) ?></span>
|
||||
</div>
|
||||
<div class="gain-item">
|
||||
<span><?= number_format($data['thin_savings_percent']) ?>% Thin provisioning</span>
|
||||
<span><?= number_format($data['thin_savings_percent']) ?>% <?php echo $w_thin;?></span>
|
||||
<span><?= formatBytes($data['thin_savings']) ?></span>
|
||||
</div>
|
||||
<hr>
|
||||
@@ -402,58 +418,64 @@
|
||||
|
||||
<hr>
|
||||
<!-- IO_grp -->
|
||||
<div class="row flex-nowrap text-center">
|
||||
<div class="col"><!-- GRP0 -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="row flex-nowrap text-center align-items-stretch">
|
||||
<div class="col d-flex"><!-- GRP0 -->
|
||||
<div class="card border-secondary mb-3 w-100 h-100">
|
||||
<div class="card-header text-dark text-center bg-info">
|
||||
<h5><i class="fs-4 bi-hdd-network text-black"></i> IO_grp 0</h5>
|
||||
</div>
|
||||
<div class="card-body bg-dark">
|
||||
<b>Hosts : </b><?php echo $json['Data']['IOgroups']['io_grp0']['host_count']; ?><br>
|
||||
<b>Volumes : </b><?php echo $json['Data']['IOgroups']['io_grp0']['vdisk_count']; ?>
|
||||
<div class="card-body bg-dark text-center">
|
||||
<div><b><?php echo $w_host; ?> :</b> <?php echo $json['Data']['IOgroups']['io_grp0']['host_count']; ?></div>
|
||||
<div><b>Volumes :</b> <?php echo $json['Data']['IOgroups']['io_grp0']['vdisk_count']; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"><!-- GRP1 -->
|
||||
<div class="card border-secondary mb-3">
|
||||
|
||||
<div class="col d-flex"><!-- GRP1 -->
|
||||
<div class="card border-secondary mb-3 w-100 h-100">
|
||||
<div class="card-header text-dark text-center bg-info">
|
||||
<h5><i class="fs-4 bi-hdd-network text-black"></i> IO_grp 1</h5>
|
||||
</div>
|
||||
<div class="card-body bg-dark text-left">
|
||||
<b>Hosts : </b><?php echo $json['Data']['IOgroups']['io_grp1']['host_count']; ?><br>
|
||||
<b>Volumes : </b><?php echo $json['Data']['IOgroups']['io_grp1']['vdisk_count']; ?>
|
||||
<div class="card-body bg-dark text-center">
|
||||
<div><b><?php echo $w_host; ?> :</b> <?php echo $json['Data']['IOgroups']['io_grp1']['host_count']; ?></div>
|
||||
<div><b>Volumes :</b> <?php echo $json['Data']['IOgroups']['io_grp1']['vdisk_count']; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"><!-- GRP2 -->
|
||||
<div class="card border-secondary mb-3">
|
||||
|
||||
<div class="col d-flex"><!-- GRP2 -->
|
||||
<div class="card border-secondary mb-3 w-100 h-100">
|
||||
<div class="card-header text-dark text-center bg-info">
|
||||
<h5><i class="fs-4 bi-hdd-network text-black"></i> IO_grp 2</h5>
|
||||
</div>
|
||||
<div class="card-body bg-dark">
|
||||
<b>Hosts : </b><?php echo $json['Data']['IOgroups']['io_grp2']['host_count']; ?><br>
|
||||
<b>Volumes : </b><?php echo $json['Data']['IOgroups']['io_grp2']['vdisk_count']; ?>
|
||||
<div class="card-body bg-dark text-center">
|
||||
<div><b><?php echo $w_host; ?> :</b> <?php echo $json['Data']['IOgroups']['io_grp2']['host_count']; ?></div>
|
||||
<div><b>Volumes :</b> <?php echo $json['Data']['IOgroups']['io_grp2']['vdisk_count']; ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"><!-- Orphan LUNS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
|
||||
<div class="col d-flex"><!-- Orphan LUNS -->
|
||||
<div class="card border-secondary mb-3 w-100 h-100">
|
||||
<div class="card-header text-dark text-center <?php echo $cuc; ?>">
|
||||
<h5><i class="fs-4 bi-hdd text-black"></i> Unnasigned LUNs</h5>
|
||||
<h5><i class="fs-4 bi-hdd text-black"></i> <?php echo $w_unassignedLUNs; ?></h5>
|
||||
</div>
|
||||
<div class="card-body bg-dark text-center fs-2">
|
||||
<button type="button" class="btn btn-secondary" data-bs-html="true" data-toggle="tooltip"
|
||||
data-placement="top" title="<?php echo $lLUN; ?>"><b><?php echo $unnasigned; ?></b></button>
|
||||
<div class="card-body bg-dark text-center fs-2 d-flex flex-column justify-content-center align-items-center">
|
||||
<a href="http://infra-tools.appliarmony.net/storage/svc-orphan-luns.php" target="_blank">
|
||||
<button type="button" class="btn btn-secondary orphan-btn" data-bs-html="true" data-toggle="tooltip"
|
||||
data-placement="top" title="<?php echo $lLUN; ?>"><b><?php echo $unnasigned; ?></b></button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"><!-- Orphan Hosts -->
|
||||
<div class="card border-secondary mb-3">
|
||||
|
||||
<div class="col d-flex"><!-- Orphan Hosts -->
|
||||
<div class="card border-secondary mb-3 w-100 h-100">
|
||||
<div class="card-header text-dark text-center <?php echo $chc; ?>">
|
||||
<h5><i class="fs-4 bi-hdd text-black"></i> Hosts w/o LUNs</h5>
|
||||
<h5><i class="fs-4 bi-hdd text-black"></i> <?php echo $w_hostsWoLUNs; ?></h5>
|
||||
</div>
|
||||
<div class="card-body bg-dark text-center fs-2">
|
||||
<button type="button" class="btn btn-secondary" data-bs-html="true" data-toggle="tooltip"
|
||||
<div class="card-body bg-dark text-center fs-2 d-flex flex-column justify-content-center align-items-center">
|
||||
<button type="button" class="btn btn-secondary orphan-btn" data-bs-html="true" data-toggle="tooltip"
|
||||
data-placement="top" title="<?php echo $lHOST; ?>"><b><?php echo $orphanHosts; ?></b></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/bootstrap-icons/bootstrap-icons.css">
|
||||
<script src="/js/bootstrap.bundle.min.js"></script>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<!-- Chart -->
|
||||
<script src="/js/chart.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ; ?>
|
||||
<?php
|
||||
//get full data
|
||||
$json = json_decode(PostJson("$bdnuss/Storage/SVC/SVC_INVENTORY.php",''),true);
|
||||
// Unnasigned Luns
|
||||
$unnasigned = 0 ;
|
||||
$list = "";
|
||||
foreach($json['Data']['Volumes'] as $volume){
|
||||
if($volume['protocol'] != "scsi"){$unnasigned++;$list.="<tr><td>".$volume['name']."</td></tr>";}
|
||||
}
|
||||
?>
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/navbar.html" ; ?> <!-- Left Navbar -->
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo "$unnasigned SVC Orphan LUN(s)" ; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<br>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="luns" data-sortable="true">Luns</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php echo $list; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
186
Storage/SwitchsSAN.php
Normal file
186
Storage/SwitchsSAN.php
Normal file
@@ -0,0 +1,186 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<title>Infra Reports IT - SAN Status</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">
|
||||
<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>
|
||||
|
||||
<style>
|
||||
.card-header a { text-decoration: none; color: white; display: block; width: 100%; }
|
||||
.card-header a:hover { color: #f0f0f0; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php
|
||||
// Include global configurations
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||
|
||||
// --- PHP LOGIC START ---
|
||||
|
||||
// 1. Fetch JSON Data
|
||||
$jsonString = PostJson("$bdnuss/Storage/BROCADE/PORT/BROCADE_PORT_LIST.php", '');
|
||||
|
||||
// 2. Decode to PHP Array
|
||||
$sanData = json_decode($jsonString, true);
|
||||
|
||||
// Check if decode was successful
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
$sanData = [];
|
||||
$errorMessage = "Error decoding JSON: " . json_last_error_msg();
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="container-fluid" id="content">
|
||||
<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" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Fibre Channel Switch Status</span></h1>
|
||||
|
||||
<div class="container mt-4">
|
||||
|
||||
<?php if (isset($errorMessage)): ?>
|
||||
<div class="alert alert-danger"><?php echo $errorMessage; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div id="accordion">
|
||||
<?php
|
||||
// Loop through Switches
|
||||
if (!empty($sanData)) {
|
||||
$switchIndex = 0;
|
||||
|
||||
foreach ($sanData as $switchName => $ports) {
|
||||
$switchIndex++;
|
||||
$collapseId = "collapse_" . $switchIndex;
|
||||
|
||||
// Inject PortID into the array content for easier sorting
|
||||
foreach ($ports as $k => $v) $ports[$k]['_PortID'] = $k;
|
||||
|
||||
// Custom Sort: Errors (Desc) > vFabric (Asc) > Port (Natural Asc)
|
||||
uasort($ports, function ($a, $b) {
|
||||
// Errors (Descending)
|
||||
$errA = (int)$a['Errors'];
|
||||
$errB = (int)$b['Errors'];
|
||||
if ($errA !== $errB) {
|
||||
return $errB <=> $errA;
|
||||
}
|
||||
|
||||
// vFabric (Ascending / Case Insensitive)
|
||||
$vfA = $a['vFabric'] ?? '';
|
||||
$vfB = $b['vFabric'] ?? '';
|
||||
$cmpVf = strcasecmp($vfA, $vfB);
|
||||
if ($cmpVf !== 0) {
|
||||
return $cmpVf;
|
||||
}
|
||||
|
||||
// Port ID (Natural Sort, e.g. 2 comes before 10)
|
||||
return strnatcmp($a['_PortID'], $b['_PortID']);
|
||||
});
|
||||
// Initialize counters & buffers
|
||||
$upCount = 0;
|
||||
$downCount = 0;
|
||||
$errorCount = 0;
|
||||
$tableBody = "";
|
||||
|
||||
// Generate HTML Rows based on sorted data
|
||||
foreach ($ports as $portId => $portData) {
|
||||
$state = $portData['State'];
|
||||
$errors = (int)$portData['Errors'];
|
||||
|
||||
if ($state === 'UP') $upCount++;
|
||||
elseif ($state === 'DN') $downCount++;
|
||||
|
||||
if ($errors > 0 && $state === 'UP') $errorCount++;
|
||||
|
||||
if ($state === 'DN') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Determine Row CSS Class
|
||||
$rowClass = "table-success";
|
||||
if ($errors > 0) $rowClass = "table-danger";
|
||||
|
||||
// Build Row HTML
|
||||
$tableBody .= "
|
||||
<tr class='{$rowClass}'>
|
||||
<td>{$portData['vFabric']}</td>
|
||||
<td>{$portId}</td>
|
||||
<td>{$portData['Status']}</td>
|
||||
<td>{$portData['State']}</td>
|
||||
<td>{$portData['Speed']}</td>
|
||||
<td>{$portData['Nego']}</td>
|
||||
<td>{$portData['FrameTX']}</td>
|
||||
<td>{$portData['FrameRX']}</td>
|
||||
<td data-value='{$errors}'><strong>{$portData['Errors']}</strong></td>
|
||||
</tr>";
|
||||
}
|
||||
|
||||
// Determine Header Color
|
||||
$headerColor = ($errorCount > 0) ? "DarkOrange" : "green";
|
||||
$msg = ($errorCount > 0) ? "<b> {$errorCount} issue(s)</b>" : "OK";
|
||||
?>
|
||||
|
||||
<div class="card" style="background-color:<?php echo $headerColor; ?>;">
|
||||
<h4 class="card-header">
|
||||
<a class="btn text-white fs-3 w-100 text-start" data-bs-toggle="collapse" href="#<?php echo $collapseId; ?>">
|
||||
<b><?php echo strtoupper($switchName); ?> : <?php echo $upCount; ?> Ports UP / <?php echo ($upCount + $downCount); ?> : <?php echo $msg; ?></b>
|
||||
</a>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div id="<?php echo $collapseId; ?>" class="collapse" data-bs-parent="#accordion">
|
||||
<div class="card-body bg-white border p-0">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover mb-0 text-center" data-toggle="table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th data-sortable="true">vFabric</th>
|
||||
<th data-sortable="true">Port</th>
|
||||
<th data-sortable="true">Status</th>
|
||||
<th data-sortable="true">State</th>
|
||||
<th data-sortable="true">Speed</th>
|
||||
<th data-sortable="true">Nego</th>
|
||||
<th data-sortable="true">FrameTX</th>
|
||||
<th data-sortable="true">FrameRX</th>
|
||||
<th data-sortable="true">Errors</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php echo $tableBody; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo "<div class='alert alert-warning'>No data available via API.</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</html>
|
||||
@@ -44,7 +44,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">AutoRemediation Logs</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_11;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -70,9 +70,9 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='ts' data-sortable='true'>TimeStamp</th>
|
||||
<th data-field='host' data-sortable='true'>Host</th>
|
||||
<th data-field='command' data-sortable='true'>Command</th>
|
||||
<th data-field='ts' data-sortable='true'>Date</th>
|
||||
<th data-field='host' data-sortable='true'><?php echo $w_host;?></th>
|
||||
<th data-field='command' data-sortable='true'><?php echo $w_command;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
153
X/Backups.php
Normal file
153
X/Backups.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<!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">
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||
$list = Invoke_Infra("select * from X_cmdb_backupsys order by HOSTNAME");
|
||||
$all = $_POST['show_all'] ?? 0;
|
||||
|
||||
// Si on affiche TOUT, alors on force l'affichage de la taille,
|
||||
// ou on récupère la valeur normale si All n'est pas coché.
|
||||
if ($all == 1) {
|
||||
$showSize = 1;
|
||||
} else {
|
||||
$showSize = $_POST['show_size'] ?? 0;
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<div class="container-fluid" id="content">
|
||||
<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" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $w_backup;?> Linux/AIX</span></h1>
|
||||
|
||||
<div class="d-flex justify-content-start align-items-center mb-2 p-2 rounded bg-secondary-subtle">
|
||||
<form class="form-inline d-flex gap-4" action="Backups.php" method="post" >
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch"
|
||||
id="showAll" name="show_all" value="1"
|
||||
<?php echo ($all == 1) ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="showAll"><strong><?php echo $w_all ;?></strong></label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch" <?php echo ($all == 1) ? 'style="display:none;"' : ''; ?>>
|
||||
<input class="form-check-input" type="checkbox" role="switch"
|
||||
id="showSize" name="show_size" value="1"
|
||||
<?php echo ($showSize == 1) ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="showSize"><strong><?php echo $w_size ;?> >= 15GB</strong></label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true"><?php echo $w_name ;?></th>
|
||||
<th data-field="ts" data-sortable="true">Date</th>
|
||||
<th data-field="Log" data-sortable="true">Log</th>
|
||||
<th data-field="Type" data-sortable="true">Type</th>
|
||||
<th data-field="Location" data-sortable="true"><?php echo $w_location ;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$now = new DateTime();
|
||||
foreach ($list as $s) {
|
||||
$name = $s['HOSTNAME'];
|
||||
$ts = $s['ts'];
|
||||
$lastBackup = (explode(".",$s['LastBackup'] ?? ''))[0];
|
||||
$location = $s['Location'];
|
||||
$log = $s['Log'];
|
||||
$backuptype = $s['BackupType'];
|
||||
|
||||
if(str_contains($log, "Length")) {
|
||||
$size = floor(explode(" ",$log)[1] / 1024 / 1024 / 1024);
|
||||
if(explode(" ",$log)[1] > 16106127360) {
|
||||
$log = "Size : $size GB";
|
||||
if($showSize == 0){ continue; }
|
||||
}else{
|
||||
$log = "OK - $size GB";
|
||||
if($all == 0){ continue; }
|
||||
}
|
||||
}
|
||||
|
||||
if(str_contains($log, "Total bytes written:")) {
|
||||
$size = floor(explode(" ",$log)[3] / 1024 / 1024 / 1024);
|
||||
if(explode(" ",$log)[3] > 16106127360) {
|
||||
$log = "Size : $size GB";
|
||||
if($showSize == 0){ continue; }
|
||||
}else{
|
||||
$log = "OK - $size GB";
|
||||
if($all == 0){ continue; }
|
||||
}
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
echo "<td>$name</td>";
|
||||
echo "<td>$ts</td>";
|
||||
if(str_contains($log, "waiting")) {
|
||||
echo "<td class='table-primary'><b>$log</b></td>";
|
||||
}elseif(str_contains($log, "error")){
|
||||
echo "<td class='table-danger'><b>$log</b></td>";
|
||||
}elseif(str_contains($log, "progress")){
|
||||
echo "<td class='table-success'><b>$log</b></td>";
|
||||
}elseif(str_contains($log, "OK -")){
|
||||
echo "<td class='table-success'>$log</td>";
|
||||
}elseif(str_contains($log, "Size : ")){
|
||||
echo "<td class='table-warning'>$log</td>";
|
||||
}else{echo "<td>$log</td>"; }
|
||||
echo "<td>$backuptype</td>";
|
||||
echo "<td>$location</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
$('#showAll').on('change', function() {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
$('#showSize').on('change', function() {
|
||||
$(this).closest('form').submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</HTML>
|
||||
<script src="/js/tableResize.js"></script>
|
||||
495
X/Inventory.php
495
X/Inventory.php
@@ -2,22 +2,18 @@
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
@@ -28,192 +24,339 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/global.php"; ?>
|
||||
<?php // DATA
|
||||
$servers = Invoke_Infra("select * from x_inventory where type is not null");
|
||||
$UTDS1 = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 's1'"))[0]['utd'];
|
||||
$UTDNessus = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 'nessus'"))[0]['utd'];
|
||||
$UTDZabbix = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 'zabbix'"))[0]['utd'];
|
||||
?>
|
||||
<?php
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php";
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">AIX / Linux inventory</span></h1>
|
||||
// NOUVEAU : Gérer les filtres
|
||||
// Par défaut, tout est coché (true)
|
||||
// On vérifie si un paramètre est passé dans l'URL pour décocher une case
|
||||
$show_aix = isset($_GET['show_aix']) ? $_GET['show_aix'] === '1' : true;
|
||||
$show_linux = isset($_GET['show_linux']) ? $_GET['show_linux'] === '1' : true;
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
// Construction de la requête SQL
|
||||
$base_sql = "SELECT * FROM x_inventory WHERE type IS NOT NULL and hostname not in ('DUNAPPDNIM51','DUNAPPDNIM52') ";
|
||||
$conditions = [];
|
||||
|
||||
if ($show_aix) {
|
||||
// La condition pour AIX est simple
|
||||
$conditions[] = "type = 'AIX'";
|
||||
}
|
||||
if ($show_linux) {
|
||||
// D'après votre code, tout ce qui n'est pas 'AIX' est considéré comme Linux
|
||||
$conditions[] = "type <> 'AIX'";
|
||||
}
|
||||
|
||||
if (!empty($conditions)) {
|
||||
// On ajoute les conditions à la requête de base
|
||||
$sql = $base_sql . " AND (" . implode(' OR ', $conditions) . ")";
|
||||
} else {
|
||||
// Si rien n'est coché, on ne retourne aucun résultat
|
||||
$sql = $base_sql . " AND 1=0";
|
||||
}
|
||||
|
||||
|
||||
// DATA
|
||||
$servers = Invoke_Infra($sql); // On utilise la nouvelle requête
|
||||
$UTDS1 = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 's1'"))[0]['utd'];
|
||||
$UTDNessus = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 'nessus'"))[0]['utd'];
|
||||
$UTDZabbix = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 'zabbix'"))[0]['utd'];
|
||||
$rows = Invoke_Infra("SELECT DISTINCT(Ver) FROM X_cmdb_Product WHERE Name='bes'");
|
||||
$versions = array_map(fn ($r) => $r['Ver'] ?? null, $rows);
|
||||
$versions = array_values(array_filter($versions));
|
||||
usort($versions, 'version_compare');
|
||||
$UTDBES = end($versions);
|
||||
$UTDFI = (Invoke_Infra("select max(Ver) as utd from X_cmdb_Product where Name = 'fi'"))[0]['utd'];
|
||||
?>
|
||||
|
||||
|
||||
<div class="container-fluid" id="content">
|
||||
<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" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_9;?></span></h1>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-start align-items-center mb-2 p-2 rounded bg-secondary-subtle">
|
||||
<form class="form-inline d-flex gap-4">
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="showAix" <?php echo $show_aix ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="showAix"><strong>AIX</strong></label>
|
||||
</div>
|
||||
<div class="form-check form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="showLinux" <?php echo $show_linux ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" for="showLinux"><strong>Linux</strong></label>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true">Name</th>
|
||||
<th data-field="OS" data-sortable="true">OS Type</th>
|
||||
<th data-field="distrib" data-sortable="true">Distrib</th>
|
||||
<th data-field="Last Boot" data-sortable="true">Last reboot</th>
|
||||
<th data-field="Last Backup" data-sortable="true">Last backup</th>
|
||||
<th data-field="Auth" data-sortable="true">Auth</th>
|
||||
<th data-field="SentinelOne" data-sortable="true">SentinelOne</th>
|
||||
<th data-field="Nessus" data-sortable="true">Nessus</th>
|
||||
<th data-field="Zabbix" data-sortable="true">Zabbix</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true"><?php echo $w_name ;?></th>
|
||||
<th data-field="Heartbeat" data-sortable="true" data-visible="false"><?php echo $w_heartbeat ;?></th>
|
||||
<th data-field="Host" data-sortable="true"><?php echo $w_host ;?></th>
|
||||
<th data-field="OS" data-sortable="true"><?php echo $w_os ;?></th>
|
||||
<th data-field="distrib" data-sortable="true">Distrib</th>
|
||||
<th data-field="Last Boot" data-sortable="true"><?php echo $w_lastReboot ;?></th>
|
||||
<th data-field="Last Backup" data-sortable="true"><?php echo $w_backuplu ;?></th>
|
||||
<th data-field="Auth" data-sortable="true">Auth</th>
|
||||
<th data-field="SentinelOne" data-sortable="true">SentinelOne</th>
|
||||
<th data-field="Nessus" data-sortable="true">Nessus</th>
|
||||
<th data-field="Zabbix" data-sortable="true">Zabbix</th>
|
||||
<th data-field="BES" data-sortable="true" data-visible="false">BES</th>
|
||||
<th data-field="FI" data-sortable="true" data-visible="false">Fusion Inv.</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
$total = 0;
|
||||
foreach ($servers as $s) {
|
||||
$total++;
|
||||
echo "<tr>";
|
||||
//name
|
||||
$name = $s['hostname'];
|
||||
echo "<td><a href='/inventory/server-detail.php?s=".$name."' target='_blank'>$name</a></td>";
|
||||
<tbody>
|
||||
<?php
|
||||
$total = 0;
|
||||
foreach ($servers as $s) {
|
||||
$total++;
|
||||
echo "<tr>";
|
||||
//name
|
||||
$name = $s['hostname'];
|
||||
$heartbeat = $s['Heartbeat'];
|
||||
$statusClass = '';
|
||||
$heartbeatDate = new DateTime($heartbeat);
|
||||
$now = new DateTime();
|
||||
$interval = $now->diff($heartbeatDate);
|
||||
$diffInMinutes = ($interval->days * 24 * 60) + ($interval->h * 60) + $interval->i;
|
||||
if ($diffInMinutes < 10) {
|
||||
$statusClass = 'table-success';
|
||||
} elseif ($diffInMinutes <= 30) {
|
||||
$statusClass = 'table-warning';
|
||||
} else {
|
||||
$statusClass = 'table-danger';
|
||||
}
|
||||
echo "<td class='$statusClass'>";
|
||||
echo " <a href='/inventory/server-detail.php?s={$name}' target='_blank'>{$name}</a>";
|
||||
echo "</td>";
|
||||
|
||||
//OS Type
|
||||
$typ = match ($s['type'] ?? null) {
|
||||
'AIX' => 'AIX',
|
||||
null, '' => '',
|
||||
default => 'LINUX',
|
||||
};
|
||||
echo "<td>".$s['type']."</td>";
|
||||
//heartbeat
|
||||
echo "<td>" . $s["Heartbeat"] . "</td>";
|
||||
|
||||
//Distrib
|
||||
$Distrib = "";
|
||||
if($typ == "AIX"){
|
||||
$Distrib = $s['osversion'];
|
||||
}
|
||||
if($typ == "LINUX"){
|
||||
$Distrib = $s['osversion']." <small>(".str_replace(".x86_64","",$s['kernel']).")</small>";
|
||||
}
|
||||
echo "<td>$Distrib</td>";
|
||||
//Host
|
||||
echo "<td>" . $s['Owner'] . "</td>";
|
||||
//OS Type
|
||||
$typ = match ($s['type'] ?? null) {
|
||||
'AIX' => 'AIX',
|
||||
null, '' => '',
|
||||
default => 'LINUX',
|
||||
};
|
||||
echo "<td>" . $s['type'] . "</td>";
|
||||
|
||||
//LastReboot
|
||||
$lr = $s['lastboot'] ?? ""; $lrDate="";
|
||||
try {
|
||||
$lrDate = new DateTime($lr);
|
||||
} catch (DateMalformedStringException $e) {}
|
||||
$interval = (new DateTime())->diff($lrDate);
|
||||
if($interval->days > 60){
|
||||
echo "<td class='table-danger'>$lr</td>";
|
||||
}else{
|
||||
if($interval->days > 1){
|
||||
echo "<td>$lr</td>";
|
||||
}else{
|
||||
echo "<td class='table-success'>$lr</td>";
|
||||
}
|
||||
}
|
||||
//Distrib
|
||||
$Distrib = "";
|
||||
if ($typ == "AIX") {
|
||||
$Distrib = $s['osversion'];
|
||||
}
|
||||
if ($typ == "LINUX") {
|
||||
$Distrib = $s['osversion'] . " <small>(" . str_replace(".x86_64", "", $s['kernel']) . ")</small>";
|
||||
}
|
||||
echo "<td>$Distrib</td>";
|
||||
|
||||
//LastBackup
|
||||
$lr = explode(".",$s['backuplast'] ?? "")[0];
|
||||
$size = 0;
|
||||
if($s['backuplog'] != "") {
|
||||
if (str_contains($s['backuplog'],"Length")) {
|
||||
$size = explode(" ", $s['backuplog'])[1];
|
||||
} else {
|
||||
$size = explode(" ", $s['backuplog'])[3];
|
||||
}
|
||||
$size = floor($size / 1024 / 1024 / 1024);
|
||||
}
|
||||
if($size >= 15){
|
||||
$size = "<span class='text-danger'><b>$size GB</b></span>";
|
||||
}else{
|
||||
$size = "$size GB";
|
||||
}
|
||||
try {
|
||||
$lrDate = new DateTime($lr);
|
||||
} catch (DateMalformedStringException $e) {}
|
||||
$interval = (new DateTime())->diff($lrDate);
|
||||
if($interval->days > 7 || $s['backuplast'] == ""){
|
||||
echo "<td class='table-danger'>$lr"." ".$size."</td>";
|
||||
}else{
|
||||
if($interval->days > 1){
|
||||
echo "<td>".date_format($lrDate,"Y-m-d H:i:s")." - ".$size."</td>";
|
||||
}else{
|
||||
echo "<td class='table-success'>$lr"." - ".$size."</td>";
|
||||
}
|
||||
}
|
||||
|
||||
//Auth
|
||||
echo "<td>".$s['auth']."</td>";
|
||||
|
||||
//SentinelOne
|
||||
$s1s = $s['S1State']; $s1v = $s['S1Version'];
|
||||
if($typ == "LINUX"){
|
||||
if($s1s == "YY"){
|
||||
if($s1v == $UTDS1) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
}else{
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
}else{
|
||||
if($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
}else{
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
echo "<td></td>";
|
||||
}
|
||||
|
||||
//Nessus
|
||||
$s1s = $s['NessusState']; $s1v = $s['NessusVersion'];
|
||||
if($typ == "LINUX"){
|
||||
if($s1s == "YYY_YYY"){
|
||||
if($s1v == $UTDNessus) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
}else{
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
}else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
echo "<td></td>";
|
||||
//LastReboot
|
||||
$lr = $s['lastboot'] ?? "";
|
||||
$lrDate = "";
|
||||
try {
|
||||
$lrDate = new DateTime($lr);
|
||||
} catch (DateMalformedStringException $e) {
|
||||
}
|
||||
$interval = (new DateTime())->diff($lrDate);
|
||||
if ($interval->days > 60) {
|
||||
echo "<td class='table-danger'>$lr</td>";
|
||||
} else {
|
||||
if ($interval->days > 1) {
|
||||
echo "<td>$lr</td>";
|
||||
} else {
|
||||
echo "<td class='table-success'>$lr</td>";
|
||||
}
|
||||
|
||||
//Zabbix
|
||||
$s1s = $s['ZabbixState']; $s1v = $s['ZabbixVersion'];
|
||||
if($s1s == "Y"){
|
||||
if($s1v == $UTDZabbix) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
}else{
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
}else{
|
||||
if($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
}else{
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
<h5 class="text-center"><?php echo $total; ?> servers</h5>
|
||||
</div>
|
||||
//LastBackup
|
||||
$lr = explode(".", $s['backuplast'] ?? "")[0];
|
||||
if(str_contains(strtolower($s['backuplog'] ?? ''), 'progress')){
|
||||
$size = "<span class='text-warning'>In Progress</span>";
|
||||
}elseif (str_contains(strtolower($s['backuplog'] ?? ''), 'waiting')){
|
||||
$size = "<span class='text-warning'><br>".$s['backuplog']."</span>";
|
||||
}elseif (str_contains(strtolower($s['backuplog'] ?? ''), 'error')){
|
||||
$size = "<span class='text-danger'><b> ERROR !!!</b></span>";
|
||||
}else {
|
||||
$size = 0;
|
||||
if ($s['backuplog'] != "") {
|
||||
if (str_contains($s['backuplog'], "Length")) {
|
||||
$size = explode(" ", $s['backuplog'])[1];
|
||||
} else {
|
||||
$size = explode(" ", $s['backuplog'])[3];
|
||||
}
|
||||
$size = floor($size / 1024 / 1024 / 1024);
|
||||
}
|
||||
if ($size >= 15) {
|
||||
$size = "<span class='text-danger'><b>$size GB</b></span>";
|
||||
} else {
|
||||
$size = "$size GB";
|
||||
}
|
||||
}
|
||||
try {
|
||||
$lrDate = new DateTime($lr);
|
||||
} catch (DateMalformedStringException $e) {
|
||||
}
|
||||
$interval = (new DateTime())->diff($lrDate);
|
||||
if ($interval->days > 7 || $s['backuplast'] == "") {
|
||||
echo "<td class='table-danger'>$lr" . " " . $size . "</td>";
|
||||
} else {
|
||||
if ($interval->days > 1) {
|
||||
echo "<td>" . date_format($lrDate, "Y-m-d H:i:s") . " - " . $size . "</td>";
|
||||
} else {
|
||||
echo "<td class='table-success'>$lr" . " - " . $size . "</td>";
|
||||
}
|
||||
}
|
||||
|
||||
//Auth
|
||||
echo "<td>" . $s['auth'] . "</td>";
|
||||
|
||||
//SentinelOne
|
||||
$s1s = $s['S1State'];
|
||||
$s1v = $s['S1Version'];
|
||||
if ($typ == "LINUX") {
|
||||
if ($s1s == "YY") {
|
||||
if ($s1v == $UTDS1) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
} else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<td></td>";
|
||||
}
|
||||
|
||||
//Nessus
|
||||
$s1s = $s['NessusState'];
|
||||
$s1v = $s['NessusVersion'];
|
||||
if ($typ == "LINUX") {
|
||||
if ($s1s == "YYY_YYY") {
|
||||
if ($s1v == $UTDNessus) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
} else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<td></td>";
|
||||
}
|
||||
|
||||
//Zabbix
|
||||
$s1s = $s['ZabbixState'];
|
||||
$s1v = $s['ZabbixVersion'];
|
||||
if ($typ == "AIX" && str_starts_with($s['osversion'], '6')) {
|
||||
echo "<td></td>";
|
||||
} else {
|
||||
if ($s1s == "Y") {
|
||||
if ($s1v == $UTDZabbix) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
} else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//BES
|
||||
$s1s = $s['BESState'];
|
||||
$s1v = $s['BESVersion'];
|
||||
if ($s1s == "Y") {
|
||||
if ($s1v == $UTDBES) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
} else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
|
||||
//FI
|
||||
$s1s = $s['FIState'];
|
||||
$s1v = $s['FIVersion'];
|
||||
if ($typ == "LINUX") {
|
||||
if ($s1s == "Y") {
|
||||
if ($s1v == $UTDFI) {
|
||||
echo "<td class='table-success'>$s1v $s1s</td>";
|
||||
} else {
|
||||
echo "<td class='table-warning'><b>$s1v</b> $s1s</td>";
|
||||
}
|
||||
} else {
|
||||
if ($s1v == "") {
|
||||
echo "<td class='table-danger text-center'>MISSING</td>";
|
||||
} else {
|
||||
echo "<td class='table-danger'>$s1v <b>$s1s</b></td>";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo "<td></td>";
|
||||
}
|
||||
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table><br>
|
||||
<h5 class="text-center"><?php echo $total; ?> <?php echo $w_server;?></h5>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
<script>
|
||||
// This function will be executed when the document is ready
|
||||
$(function() {
|
||||
// Add an event listener to both checkboxes
|
||||
$('#showAix, #showLinux').on('change', function() {
|
||||
// Get the current state of the checkboxes (checked or not)
|
||||
// '1' for checked, '0' for unchecked
|
||||
const showAix = $('#showAix').is(':checked') ? '1' : '0';
|
||||
const showLinux = $('#showLinux').is(':checked') ? '1' : '0';
|
||||
|
||||
// Create a URL object to easily manipulate query parameters
|
||||
const url = new URL(window.location.href);
|
||||
|
||||
// Set the parameters based on checkbox states
|
||||
url.searchParams.set('show_aix', showAix);
|
||||
url.searchParams.set('show_linux', showLinux);
|
||||
|
||||
// Reload the page with the new URL
|
||||
window.location.href = url.toString();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</HTML>
|
||||
<script src="/js/tableResize.js"></script>
|
||||
@@ -67,28 +67,16 @@
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<?php // DATA
|
||||
<?php
|
||||
$aix = $linux = $dun = $azt = $other = "Checked";
|
||||
$where = " and OS_TYPE IN (";
|
||||
if (isset($_GET['AIX'])) {
|
||||
if ($_GET['AIX'] == 1) {
|
||||
$where .= "'AIX',";
|
||||
} else {
|
||||
$aix = "Unchecked";
|
||||
}
|
||||
} else {
|
||||
$aix = "Unchecked";
|
||||
}
|
||||
if (isset($_GET['linux'])) {
|
||||
if ($_GET['linux'] == 1) {
|
||||
$where .= "'LINUX',";
|
||||
} else {
|
||||
$linux = "Unchecked";
|
||||
}
|
||||
} else {
|
||||
$linux = "Unchecked";
|
||||
}
|
||||
$where = rtrim($where, ',') . ")";
|
||||
$where = "";
|
||||
if (!isset($_GET['AIX'])){$aix = "Unchecked";}
|
||||
if (!isset($_GET['linux'])){$linux = "Unchecked";}
|
||||
|
||||
if($linux=="Unchecked" && $aix=="Unchecked"){ $where = " and 1=2 ";}
|
||||
if($linux=="Unchecked" && $aix=="Checked"){ $where = " and Type ='AIX' ";}
|
||||
if($linux=="Checked" && $aix=="Unchecked"){ $where = " and not Type ='AIX' ";}
|
||||
|
||||
$site = "";
|
||||
if (isset($_GET['DUN'])) {
|
||||
if ($_GET['DUN'] == 1) {
|
||||
@@ -120,43 +108,54 @@
|
||||
$site = " and (" . ltrim($site, ' or') . ") ";
|
||||
$where .= $site;
|
||||
|
||||
$sql = "select hostname, os_type from srvall where decomtime is null and (ucase(filter) not like 'X_%' or filter is null) $where order by hostname";
|
||||
$hosts = Invoke_aixcmdb($sql);
|
||||
$sql = "select HOSTNAME, Type, OSVersion from x_srvall where Decom is null $where order by hostname";
|
||||
$hosts = Invoke_Infra($sql);
|
||||
//print_r($hosts);exit;
|
||||
|
||||
$taix = $aixok = $aixko = $tlinux = $linuxok = $linuxko = 0;
|
||||
#print_r($hosts);
|
||||
$resultsByHost = [];
|
||||
if (!empty($hosts)) {
|
||||
$hostnames = array_map(function ($h) {
|
||||
return "'" . strtoupper($h['HOSTNAME']) . "'";
|
||||
}, $hosts);
|
||||
$hostnamesList = implode(',', $hostnames);
|
||||
|
||||
$sqlResults = "SELECT * FROM x_stdout WHERE cmd = '$script' AND host IN ($hostnamesList)";
|
||||
$allAnswers = Invoke_Infra($sqlResults);
|
||||
if (is_array($allAnswers)) {
|
||||
foreach ($allAnswers as $answer) {
|
||||
$resultsByHost[strtoupper($answer['host'])] = $answer;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<form class="row">
|
||||
<div class="col border rounded">
|
||||
<b>Filters : </b>
|
||||
<b><?php echo $w_filter;?> : </b>
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="AIX" <?php echo $aix; ?>
|
||||
name="AIX" value="1">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="AIX" <?php echo $aix; ?> name="AIX" value="1">
|
||||
<label class="form-check-label" for="AIX">AIX</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="linux" <?php echo $linux; ?>
|
||||
name="linux" value="1">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="linux" <?php echo $linux; ?> name="linux" value="1">
|
||||
<label class="form-check-label" for="linux">Linux</label>
|
||||
</div>
|
||||
|
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="DUN" <?php echo $dun; ?>
|
||||
name="DUN" value="1">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="DUN" <?php echo $dun; ?> name="DUN" value="1">
|
||||
<label class="form-check-label" for="DUN">DMV/DUN/MDK</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="AZT" <?php echo $azt; ?>
|
||||
name="AZT" value="1">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="AZT" <?php echo $azt; ?> name="AZT" value="1">
|
||||
<label class="form-check-label" for="AZT">Azure</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-check-inline form-switch">
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="other" <?php echo $other; ?>
|
||||
name="other" value="1">
|
||||
<label class="form-check-label" for="other">Other</label>
|
||||
<input class="form-check-input" type="checkbox" role="switch" id="other" <?php echo $other; ?> name="other" value="1">
|
||||
<label class="form-check-label" for="other"><?php echo $w_other;?></label>
|
||||
</div>
|
||||
<input type="hidden" name="s" value="<?php echo $script; ?>">
|
||||
<button type="submit" class="btn btn-success btn-small mb-2 mt-2">Apply</button>
|
||||
@@ -164,57 +163,55 @@
|
||||
</form>
|
||||
|
||||
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table"
|
||||
data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']"
|
||||
data-show-export="true" data-sortable="true" data-sort-name="vm">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='host' data-sortable='true'>Host</th>
|
||||
<th data-field='OS' data-sortable='true'>OS</th>
|
||||
<th data-field='TimeStamp' data-sortable='true'>TimeStamp</th>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="vm">
|
||||
<thead> <tr>
|
||||
<th data-field='host' data-sortable='true'><?php echo $w_host;?></th>
|
||||
<th data-field='OS' data-sortable='true'><?php echo $w_os;?></th>
|
||||
<th data-field='OSVer' data-sortable='true'>Distrib.</th>
|
||||
<th data-field='TimeStamp' data-sortable='true'>Date</th>
|
||||
<th data-field='RC' data-sortable='true'>RC</th>
|
||||
<th data-field='Result' data-sortable='true'>StdOut</th>
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
<tbody> <?php
|
||||
foreach ($hosts as $h) {
|
||||
$host = strtoupper($h['HOSTNAME']);
|
||||
$os = strtoupper($h['OS_TYPE']);
|
||||
if (strtoupper($h['OS_TYPE']) == "AIX") {
|
||||
$os = strtoupper($h['Type'] ?? "");
|
||||
$osver = strtoupper($h['OSVersion'] ?? "");
|
||||
|
||||
if ($os == "AIX") {
|
||||
$taix++;
|
||||
} else {
|
||||
$tlinux++;
|
||||
}
|
||||
$answer = Invoke_infra("SELECT * FROM x_stdout where cmd ='$script' and host ='$host'");
|
||||
if (is_array($answer)) {
|
||||
$rc = $answer[0]['rc'];
|
||||
$stdout = $answer[0]['stdout'];
|
||||
$ts = $answer[0]['ts'];
|
||||
if (strtoupper($h['OS_TYPE']) == "AIX") {
|
||||
|
||||
$answer = $resultsByHost[$host] ?? null;
|
||||
|
||||
if ($answer) {
|
||||
$rc = $answer['rc'];
|
||||
$stdout = $answer['stdout'];
|
||||
$ts = $answer['ts'];
|
||||
|
||||
if ($os == "AIX") {
|
||||
if ($rc == 0 && (string)$rc <> "") {
|
||||
$aixok++;
|
||||
} else {
|
||||
if ((string)$rc <> "") {
|
||||
$aixko++;
|
||||
}
|
||||
} elseif ((string)$rc <> "") {
|
||||
$aixko++;
|
||||
}
|
||||
} else {
|
||||
} else { // Linux
|
||||
if ($rc == 0 && (string)$rc <> "") {
|
||||
$linuxok++;
|
||||
} else {
|
||||
if ((string)$rc <> "") {
|
||||
$linuxko++;
|
||||
}
|
||||
} elseif ((string)$rc <> "") {
|
||||
$linuxko++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$rc = $stdout = $ts = "";
|
||||
}
|
||||
|
||||
echo "<tr><td><b>$host</b></td>";
|
||||
echo "<td>$os</td>";
|
||||
echo "<td>$osver</td>";
|
||||
echo "<td>" . $ts . "</td>";
|
||||
if ($rc == 0 && (string)$rc <> "") {
|
||||
echo "<td class='table-success'>" . $rc . "</td>";
|
||||
@@ -236,7 +233,8 @@
|
||||
echo "<div class='row'><div class='col text-center h4'><b>$taix AIX : </b>";
|
||||
echo "<span class='badge bg-success'>$aixok</span> <span class='badge bg-danger'>$aixko</span> <span class='badge bg-secondary'>$aixNO</span></div>";
|
||||
echo "<div class='col text-center h4'><b>$tlinux Linux : </b>";
|
||||
echo "<span class='badge bg-success'>$linuxok</span> <span class='badge bg-danger'>$linuxko</span> <span class='badge bg-secondary'>$linuxNO</span></div></div> "; ?>
|
||||
echo "<span class='badge bg-success'>$linuxok</span> <span class='badge bg-danger'>$linuxko</span> <span class='badge bg-secondary'>$linuxNO</span></div></div> ";
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
|
||||
24
X/StdOut.php
24
X/StdOut.php
@@ -40,7 +40,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Script Execution Follow-up</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_12;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -63,15 +63,21 @@
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<?php // DATA
|
||||
$answers = Invoke_infra("SELECT distinct(cmd),max(ts) from x_stdout group by cmd order by max(ts) desc");
|
||||
<?php
|
||||
$sql = "SELECT cmd, MIN(ts) AS debut, MAX(ts) AS fin FROM x_stdout GROUP BY cmd ORDER BY fin DESC";
|
||||
$results = Invoke_infra($sql);
|
||||
echo "<div class='row'>";
|
||||
foreach($answers as $cmd){
|
||||
$ts = Invoke_infra("SELECT max(ts) as fin, min(ts) as debut FROM x_stdout where cmd = '".$cmd['cmd']."'");
|
||||
echo "<div class='col-3 mb-3'><a href='StdOut-detail.php?s=".$cmd['cmd']."&AIX=1&linux=1&DUN=1' class='btn btn-primary btn-lg' role='button'>";
|
||||
echo "<b>".$cmd['cmd']."</b><br><small>".$ts[0]['debut']." --> ".$ts[0]['fin']."</small>";
|
||||
echo "</a></div> ";
|
||||
|
||||
if (is_array($results)) {
|
||||
foreach ($results as $script) {
|
||||
$scriptName = $script['cmd'];
|
||||
$startTime = $script['debut'];
|
||||
$endTime = $script['fin'];
|
||||
echo "<div class='col-3 mb-3'>";
|
||||
echo "<a href='StdOut-detail.php?s=$scriptName&AIX=1&linux=1&DUN=1' class='btn btn-primary btn-lg' role='button'>";
|
||||
echo "<b>$scriptName</b><br><small>$startTime --> $endTime</small>";
|
||||
echo "</a>";
|
||||
echo "</div>";
|
||||
}
|
||||
}
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
191
X/VIO.php
Normal file
191
X/VIO.php
Normal file
@@ -0,0 +1,191 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<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>
|
||||
|
||||
<style>
|
||||
.cell-multiline {
|
||||
white-space: nowrap;
|
||||
}
|
||||
/* Custom style for VIOErr badges */
|
||||
.badge-err {
|
||||
background-color: #dc3545 !important;
|
||||
color: white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?>
|
||||
|
||||
<?php
|
||||
// ==========================================
|
||||
// 1. DATA PROCESSING (PHP)
|
||||
// ==========================================
|
||||
|
||||
$rawRows = Invoke_Infra("SELECT * FROM x_cmdb_VIO");
|
||||
if (!$rawRows) $rawRows = [];
|
||||
|
||||
// Grouping
|
||||
$groupedData = [];
|
||||
foreach ($rawRows as $row) {
|
||||
$key = $row['clintname'];
|
||||
if (empty($key)) $key = "[No Client Name]";
|
||||
if (!isset($groupedData[$key])) $groupedData[$key] = [];
|
||||
$groupedData[$key][] = $row;
|
||||
}
|
||||
|
||||
// Flattening for Display (1 Row per Client)
|
||||
$displayRows = [];
|
||||
|
||||
foreach ($groupedData as $clientKey => $rows) {
|
||||
// 1. Sort by date desc
|
||||
usort($rows, function($a, $b) {
|
||||
return strcmp($b['ts'], $a['ts']);
|
||||
});
|
||||
|
||||
// 2. Keep max 2
|
||||
if (count($rows) > 2) {
|
||||
$rows = array_slice($rows, 0, 2);
|
||||
}
|
||||
|
||||
$names = []; $inerrs = []; $vfcs = []; $vios = [];
|
||||
$clintids = []; $fcnames = []; $tss = []; $vioerrs = [];
|
||||
|
||||
$hasError = false;
|
||||
$maxVioErr = 0;
|
||||
|
||||
foreach ($rows as $r) {
|
||||
if ($r['inerr'] != 0 && $r['inerr'] != '0') $hasError = true;
|
||||
|
||||
// Track VIOErr
|
||||
$errVal = (int)($r['VIOErr'] ?? 0);
|
||||
if ($errVal > $maxVioErr) $maxVioErr = $errVal;
|
||||
|
||||
// Format VIOErr for display (Red badge if > 0)
|
||||
$vioerrs[] = ($errVal > 0) ? "<span class='badge badge-err'>$errVal</span>" : $errVal;
|
||||
|
||||
$names[] = $r['name'] ?? '-';
|
||||
$inerrs[] = $r['inerr'] ?? '-';
|
||||
$vfcs[] = $r['vfcclientname'] ?? '-';
|
||||
$vios[] = $r['vio'] ?? '-';
|
||||
$clintids[] = $r['clintid'] ?? '-';
|
||||
$fcnames[] = $r['fcname'] ?? '-';
|
||||
$tss[] = $r['ts'] ?? '-';
|
||||
}
|
||||
|
||||
$displayRows[] = [
|
||||
'clintname' => $clientKey,
|
||||
'hasError' => $hasError,
|
||||
'maxVioErr' => $maxVioErr,
|
||||
'name' => implode('<br>', $names),
|
||||
'inerr' => implode('<br>', $inerrs),
|
||||
'vfc' => implode('<br>', $vfcs),
|
||||
'vio' => implode('<br>', $vios),
|
||||
'clintid' => implode('<br>', $clintids),
|
||||
'fcname' => implode('<br>', $fcnames),
|
||||
'ts' => implode('<br>', $tss),
|
||||
'vioerr' => implode('<br>', $vioerrs),
|
||||
];
|
||||
}
|
||||
|
||||
// 4. Final Sort: 1. Warning (inerr), 2. VIOErr > 0, 3. Alpha
|
||||
usort($displayRows, function($a, $b) {
|
||||
// Priority 1: InErr (table-warning)
|
||||
if ($a['hasError'] && !$b['hasError']) return -1;
|
||||
if (!$a['hasError'] && $b['hasError']) return 1;
|
||||
|
||||
// Priority 2: VIOErr count
|
||||
if ($a['maxVioErr'] > 0 && $b['maxVioErr'] == 0) return -1;
|
||||
if ($a['maxVioErr'] == 0 && $b['maxVioErr'] > 0) return 1;
|
||||
if ($a['maxVioErr'] != $b['maxVioErr']) return $b['maxVioErr'] - $a['maxVioErr'];
|
||||
|
||||
// Priority 3: Alphabetical
|
||||
return strcasecmp($a['clintname'], $b['clintname']);
|
||||
});
|
||||
?>
|
||||
|
||||
<div class="container-fluid" id="content">
|
||||
<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" style="flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary w-100"><?php echo $ti_13;?></span></h1>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1'
|
||||
data-toggle="table"
|
||||
data-search="true"
|
||||
data-show-columns="true"
|
||||
data-export-types="['xlsx','csv','json']"
|
||||
data-show-export="true"
|
||||
data-sortable="true"> <thead>
|
||||
<tr>
|
||||
<th data-field="clintname" data-sortable="true">Clint Name</th>
|
||||
<th data-field="name"><?php echo $w_name;?></th>
|
||||
<th data-field="vioerr">VIOErr</th>
|
||||
<th data-field="inerr">InErr</th>
|
||||
<th data-field="vfcclientname">VFC Client Name</th>
|
||||
<th data-field="vio">VIO</th>
|
||||
<th data-field="clintid">ClintID</th>
|
||||
<th data-field="fcname">FC Name</th>
|
||||
<th data-field="ts"><?php echo $w_lastUpdate;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php foreach ($displayRows as $row): ?>
|
||||
<?php $class = $row['hasError'] ? 'table-warning' : ''; ?>
|
||||
<tr class="<?php echo $class; ?>">
|
||||
<td class="fw-bold align-middle"><?php echo htmlspecialchars($row['clintname']); ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['name']; ?></td>
|
||||
<td class="cell-multiline text-center fw-bold"><?php echo $row['vioerr']; ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['inerr']; ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['vfc']; ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['vio']; ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['clintid']; ?></td>
|
||||
<td class="cell-multiline"><?php echo $row['fcname']; ?></td>
|
||||
<td class="cell-multiline small"><?php echo $row['ts']; ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
<script>
|
||||
var $table = $('#t1');
|
||||
function adjustTableHeight() {
|
||||
let height = $(window).height() - 170;
|
||||
$table.bootstrapTable('resetView', { height: height });
|
||||
}
|
||||
$(function () {
|
||||
adjustTableHeight();
|
||||
$(window).resize(function () { adjustTableHeight(); });
|
||||
});
|
||||
</script>
|
||||
</html>
|
||||
@@ -44,7 +44,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">SVA & SCU Accounts Attributes </span></h1><h6>Updated every hour</h6>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_10 ;?> </span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
@@ -70,16 +70,16 @@
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='account' data-sortable='true'>Account</th>
|
||||
<th data-field='Displayname' data-sortable='true'>Displayname</th>
|
||||
<th data-field='account' data-sortable='true'><?php echo $w_account;?></th>
|
||||
<th data-field='Displayname' data-sortable='true'><?php echo $w_name;?></th>
|
||||
<th data-field='Uid' data-sortable='true'>Uid</th>
|
||||
<th data-field='UidNumber' data-sortable='true'>UidNumber</th>
|
||||
<th data-field='UidNumber' data-sortable='true'>Uid #</th>
|
||||
<th data-field='Gecos' data-sortable='true'>Gecos</th>
|
||||
<th data-field='UnixHD' data-sortable='true'>Unix Home Directory</th>
|
||||
<th data-field='Login Shell' data-sortable='true'>Login Shell</th>
|
||||
<th data-field='GID Number' data-sortable='true'>GID Number</th>
|
||||
<th data-field='Enabled' data-sortable='true'>Enabled</th>
|
||||
<th data-field='LastLogon' data-sortable='true'>Last Logon</th>
|
||||
<th data-field='UnixHD' data-sortable='true'><?php echo $w_homeDirectory;?></th>
|
||||
<th data-field='Login Shell' data-sortable='true'><?php echo $w_loginShell;?></th>
|
||||
<th data-field='GID Number' data-sortable='true'>GID #</th>
|
||||
<th data-field='Enabled' data-sortable='true'><?php echo $w_enabled;?></th>
|
||||
<th data-field='LastLogon' data-sortable='true'><?php echo $w_lastLogon;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
@@ -1,29 +1,59 @@
|
||||
function dateDiffInDays(a) {
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
return Math.floor((Date.now() - new Date(a)) / _MS_PER_DAY);
|
||||
if (!a || a === 'Missing' || a === ' ') return 999; // Sécurité
|
||||
const _MS_PER_DAY = 1000 * 60 * 60 * 24;
|
||||
return Math.floor((Date.now() - new Date(a)) / _MS_PER_DAY);
|
||||
}
|
||||
|
||||
$(function() {
|
||||
$button.click(function () {
|
||||
$data = $table.bootstrapTable('getData')
|
||||
$dl = $data.length
|
||||
$nSCCM=0; $nAD=0; $nGLPI=0;$nEPO=0;$nNBU=0;$nOS=0;$nSCOM=0;$nZabbix=0;$nS1=0;
|
||||
for( $i=0 ; $i < $dl ; $i++ ){
|
||||
if ($data[$i]['AD'] !== 'Missing') { $nAD++ ; }
|
||||
if ((dateDiffInDays($data[$i]['ADlu'].split(" ")[0]) > 45 || $data[$i]['ADlu'] == 'Missing') && $data[$i]['AD'] !== 'Missing'){ $nAD-- ;}
|
||||
if ($data[$i]['SCCM'] !== 'Missing') { $nSCCM++ ; }
|
||||
if ((dateDiffInDays($data[$i]['SCCMlu'].split(" ")[0]) > 7 || $data[$i]['SCCMlu'] == 'Missing') && $data[$i]['SCCM'] !== 'Missing'){ $nSCCM-- ;}
|
||||
if ($data[$i]['GLPI'] !== 'Missing') { $nGLPI++ ; }
|
||||
if ((dateDiffInDays($data[$i]['GLPIlu'].split(" ")[0]) > 7 || $data[$i]['GLPIlu'] == 'Missing') && $data[$i]['GLPI'] !== 'Missing'){ $nGLPI-- ;}
|
||||
if ($data[$i]['NESSUS'] !== 'Missing') { $nEPO++ ; }
|
||||
if ($data[$i]['Backup'] !== 'Missing') { $nNBU++ ; }
|
||||
if ((dateDiffInDays($data[$i]['NBUlu'].split(" ")[0]) > 30 || $data[$i]['NBUlu'] == 'Missing') && $data[$i]['Backup'].split(" ")[0] !== 'Missing'){ $nNBU-- ;}
|
||||
if (($data[$i]['OS'].includes('XP') || $data[$i]['OS'].includes('2000') || $data[$i]['OS'].includes('2003') || $data[$i]['OS'].includes('2008') || $data[$i]['OS'].includes('2012') || $data[$i]['OS'].includes('7') || $data[$i]['OS'].includes('Windows NT')) == false && $data[$i]['OS'] !==' ') { $nOS++ ;}
|
||||
if ($data[$i]['SCOM'] !== 'Missing') { $nSCOM++ ; }
|
||||
if ($data[$i]['Zabbix'] !== 'Missing') { $nZabbix++ ; }
|
||||
if ($data[$i]['S1'] !== 'Missing') { $nS1++ ; }
|
||||
if ((dateDiffInDays($data[$i]['S1lu'].split(" ")[0]) > 7 || $data[$i]['S1lu'] == 'Missing') && $data[$i]['S1'] !== 'Missing'){ $nS1-- ;}
|
||||
}
|
||||
$('#button').click(function () {
|
||||
var $data = $('#t1').bootstrapTable('getData');
|
||||
var $dl = $data.length;
|
||||
if ($dl === 0) return;
|
||||
|
||||
var $nSCCM=0, $nAD=0, $nGLPI=0, $nEPO=0, $nNBU=0, $nOS=0, $nSCOM=0, $nZabbix=0, $nS1=0;
|
||||
|
||||
for(var $i=0 ; $i < $dl ; $i++ ){
|
||||
// Vérification AD
|
||||
if ($data[$i]['AD'] !== 'Missing') {
|
||||
$nAD++;
|
||||
var adDate = ($data[$i]['ADlu'] || '').split(" ")[0];
|
||||
if (dateDiffInDays(adDate) > 45 || adDate === '') { $nAD--; }
|
||||
}
|
||||
// Vérification SCCM
|
||||
if ($data[$i]['SCCM'] !== 'Missing') {
|
||||
$nSCCM++;
|
||||
var sccmDate = ($data[$i]['SCCMlu'] || '').split(" ")[0];
|
||||
if (dateDiffInDays(sccmDate) > 7 || sccmDate === '') { $nSCCM--; }
|
||||
}
|
||||
// Vérification GLPI
|
||||
if ($data[$i]['GLPI'] !== 'Missing') {
|
||||
$nGLPI++;
|
||||
var glpiDate = ($data[$i]['GLPIlu'] || '').split(" ")[0];
|
||||
if (dateDiffInDays(glpiDate) > 7 || glpiDate === '') { $nGLPI--; }
|
||||
}
|
||||
// NESSUS
|
||||
if ($data[$i]['NESSUS'] !== 'Missing' && $data[$i]['NESSUS'] !== ' ') { $nEPO++; }
|
||||
// BACKUP
|
||||
if ($data[$i]['Backup'] !== 'Missing') {
|
||||
$nNBU++;
|
||||
var nbuDate = ($data[$i]['NBUlu'] || '').split(" ")[0];
|
||||
if (dateDiffInDays(nbuDate) > 30 || nbuDate === '') { $nNBU--; }
|
||||
}
|
||||
// OS (Supporté)
|
||||
var os = $data[$i]['OS'] || '';
|
||||
if (!(os.includes('XP') || os.includes('2000') || os.includes('2003') || os.includes('2008') || os.includes('2012') || os.includes('7')) && os !== ' ') { $nOS++; }
|
||||
|
||||
// SCOM & Zabbix
|
||||
if ($data[$i]['SCOM'] !== 'Missing') { $nSCOM++; }
|
||||
if ($data[$i]['Zabbix'] !== 'Missing') { $nZabbix++; }
|
||||
|
||||
// S1
|
||||
if ($data[$i]['S1'] !== 'Missing') {
|
||||
$nS1++;
|
||||
var s1Date = ($data[$i]['S1lu'] || '').split(" ")[0];
|
||||
if (dateDiffInDays(s1Date) > 7 || s1Date === '') { $nS1--; }
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("KPIAD").innerHTML = Math.round($nAD/$dl*1000)/10 + "%";
|
||||
if(Math.round($nAD/$dl*100) >=90){
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -27,7 +27,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
@@ -84,7 +84,7 @@
|
||||
echo "</div><hr style='border-top: 3px solid black'>";
|
||||
|
||||
// Active Directory
|
||||
echo "<h3><span class='font-weight-bold'>Active Directory</span></h3>" ;
|
||||
echo "<h3><span class='font-weight-bold'>$w_ad</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['AD'])){
|
||||
if($row['AD']=="Y"){
|
||||
@@ -96,17 +96,17 @@
|
||||
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='AD' name ='AD' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
if(isset($row['ADlu'])){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Logon</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_adlu</b></div>";
|
||||
$date1=date_create($row['ADlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 60){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['ADlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['AD']) && $row['AD'] !=="Y")){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Logon</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_adlu</b></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
@@ -143,15 +143,15 @@
|
||||
$date1=date_create($row['GLPIlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if(isset($row['GLPIlu']) && $row['GLPIlu'] !== ''){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Inventory</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_filu</b></div>";
|
||||
if($diff->format("%R%a") > 7){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['GLPIlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['FI']) && $row['FI'] !=="Y")){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Inventory</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_filu</b></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
@@ -171,17 +171,17 @@
|
||||
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='SCCM' name ='SCCM' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
if(isset($row['SCCMlu'])){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Heartbeat</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_sccmlu</b></div>";
|
||||
$date1=date_create($row['SCCMlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 7){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['SCCMlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['SCCM']) && $row['SCCM'] !=="Y")){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Heartbeat</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_sccmlu</b></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-warning' disabled value='Missing'></div>";
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@
|
||||
echo "</div><br>";
|
||||
|
||||
// NBU
|
||||
echo "<h3><span class='font-weight-bold'>NetBackup</span></h3>" ;
|
||||
echo "<h3><span class='font-weight-bold'>$w_backup</span></h3>" ;
|
||||
echo "<div class='row'>";
|
||||
if(isset($row['NBU'])){
|
||||
if($row['NBU']=="Y"){
|
||||
@@ -216,13 +216,13 @@
|
||||
echo "<div class='col-md-3'><div class='input-group'><span class='input-group-text'><i class='bi bi-pencil-square text-primary'></i></span><input type='text' class='form-control' id='NBU' name ='NBU' placeholder='Missing' maxlength = '20'></div></div>";
|
||||
}
|
||||
if(isset($row['NBUlu'])){
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>Last Backup</b></div>";
|
||||
echo "<div class='col-md-2 text-end text-bottom'><b>$w_backuplu</b></div>";
|
||||
$date1=date_create($row['NBUlu']);
|
||||
$diff=date_diff($date1,date_create(date("Y-m-d")));
|
||||
if($diff->format("%R%a") > 30){
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-danger text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}else{
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." days)'></div>";
|
||||
echo "<div class='col-md-3'><input type='text' class='form-control bg-success text-white' disabled value='".$row['NBUlu']." (".abs($diff->format("%R%a"))." $w_days)'></div>";
|
||||
}
|
||||
}else{
|
||||
if(!(isset($row['NBU']) && $row['NBU'] !=="Y")){
|
||||
@@ -283,7 +283,7 @@
|
||||
?>
|
||||
<label for="server"></label><input type='text' class='form-control visually-hidden' name="server" id="server" value='<?php echo $_GET['server']; ?>'>
|
||||
<hr>
|
||||
<div style="text-align: center;"><button id="button" type="submit" class="btn btn-primary btn-lg"><i class="bi bi-arrow-clockwise"></i><b> Submit</b></button></div>
|
||||
<div style="text-align: center;"><button id="button" type="submit" class="btn btn-primary btn-lg"><i class="bi bi-arrow-clockwise"></i><b> <?php echo $w_submit; ?></b></button></div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -27,7 +27,7 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,450 +6,360 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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>
|
||||
<!-- test -->
|
||||
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/preloader.inc.html"; ?> <!-- Preloader -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/../../include/db_connect.php"; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?> <!-- Left Navbar -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?>
|
||||
<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" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<div class="col py-3">
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_3; ?></span></h1>
|
||||
|
||||
<div class="row" style="zoom: 80%">
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-toggle="table" data-search="true"
|
||||
data-show-columns="true" data-export-types="['xlsx','csv','json']"
|
||||
data-loading-template="loadingTemplate"
|
||||
data-show-export="true" data-sortable="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true"><?php echo $w_name; ?></th>
|
||||
<th data-field="OS" data-sortable="true"><?php echo $w_os; ?></th>
|
||||
<th data-field="Criticity" data-sortable="true"><?php echo $w_crit; ?></th>
|
||||
<th data-field="AD" data-sortable="true"><?php echo $w_ad; ?></th>
|
||||
<th data-field="ADlu" data-sortable="true" data-visible="false"><?php echo $w_adlu; ?></th>
|
||||
<th data-field="GLPI" data-sortable="true">GLPI</th>
|
||||
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI"><?php echo $w_filu; ?></th>
|
||||
<th data-field="SCCM" data-sortable="true">SCCM<br></th>
|
||||
<th data-field="SCCMlu" data-sortable="true" data-visible="false"><?php echo $w_sccmlu; ?></th>
|
||||
<th data-field="NESSUS" data-sortable="true">NESSUS</th>
|
||||
<th data-field="Backup" data-sortable="true"><?php echo $w_backup; ?></th>
|
||||
<th data-field="NBUlu" data-sortable="true" data-visible="false"><?php echo $w_backuplu; ?></th>
|
||||
<th data-field="SCOM" data-sortable="true">SCOM</th>
|
||||
<th data-field="Zabbix" data-sortable="true">Zabbix</th>
|
||||
<th data-field="S1" data-sortable="true">SentinelOne</th>
|
||||
<th data-field="S1lu" data-sortable="true" data-visible="false"><?php echo $w_s1lu; ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$conn = DB_ENTRY02();
|
||||
$sql = "SELECT * FROM GlobalCrossover";
|
||||
$whereClauses = ["server NOT LIKE 'WS%'"];
|
||||
|
||||
if (isset($_GET['filter'])) {
|
||||
$filter = $_GET['filter'];
|
||||
$filterTitle = "$w_filter : " . htmlspecialchars($filter) . " $w_nonCompliant";
|
||||
switch ($filter) {
|
||||
case "AD": $whereClauses[] = "AD IS NULL OR (ADlu IS NOT NULL AND DATEDIFF(now(), ADlu) > 45)"; break;
|
||||
case "OS": $whereClauses[] = "OS LIKE '%2003%' OR OS LIKE '%2008%'"; break;
|
||||
case "GLPI": $whereClauses[] = "GLPI IS NULL OR GLPIlu IS NULL OR DATEDIFF(now(), GLPIlu) > 7"; break;
|
||||
case "SCCM": $whereClauses[] = "SCCM IS NULL OR (SCCMlu IS NOT NULL AND DATEDIFF(now(), SCCMlu) > 7)"; break;
|
||||
case "NESSUS": $whereClauses[] = "EPO IS NULL"; break;
|
||||
case "NBU": $whereClauses[] = "NBU IS NULL OR (NBUlu IS NOT NULL AND DATEDIFF(now(), NBUlu) > 30)"; break;
|
||||
case "SCOM": $whereClauses[] = "SCOM IS NULL"; break;
|
||||
case "zabbix": $whereClauses[] = "zabbix IS NULL"; break;
|
||||
case "S1": $whereClauses[] = "S1 IS NULL OR (S1lu IS NOT NULL AND DATEDIFF(now(), S1lu) > 7)"; break;
|
||||
default: $filterTitle = null; break;
|
||||
}
|
||||
if ($filterTitle) {
|
||||
echo "<h2><div style=\"text-align: center;\"><span class='badge text-bg-danger font-weight-bold'>$filterTitle</span></div></h2>";
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($whereClauses)) { $sql .= " WHERE " . implode(' AND ', $whereClauses); }
|
||||
$sql .= " ORDER BY server";
|
||||
|
||||
$stmt = $conn->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
// --- PART 2: HELPER FUNCTIONS ---
|
||||
function renderStatusCellWithDate(?string $status, ?string $lastUpdate, int $daysThreshold, string $okText = 'OK'): string {
|
||||
$status = htmlspecialchars($status ?? '', ENT_QUOTES, 'UTF-8');
|
||||
$lastUpdate = htmlspecialchars($lastUpdate ?? '', ENT_QUOTES, 'UTF-8');
|
||||
$okText = htmlspecialchars($okText, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
if ($status === 'Y') {
|
||||
if (empty($lastUpdate)) {
|
||||
return "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(255,193,7,1) 100%);'>$okText</td><td class='bg-warning text-black'>Missing</td>";
|
||||
}
|
||||
try {
|
||||
$diff = date_diff(date_create($lastUpdate), date_create());
|
||||
$days = (int) $diff->format("%R%a");
|
||||
if ($days > $daysThreshold) {
|
||||
return "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>$okText</td><td class='bg-danger text-white'>$lastUpdate ($days days)</td>";
|
||||
} else {
|
||||
return "<td class='bg-success text-white'>$okText</td><td class='bg-success text-white'>$lastUpdate</td>";
|
||||
}
|
||||
} catch (Exception) {
|
||||
return "<td class='bg-danger text-white'>Invalid Date</td><td class='bg-danger text-white'>$lastUpdate</td>";
|
||||
}
|
||||
}
|
||||
if ($status !== '') {
|
||||
return "<td class='bg-secondary'><small>$status</small></td><td class='bg-secondary text-secondary'> </td>";
|
||||
}
|
||||
return "<td class='bg-warning text-black'>Missing</td><td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
|
||||
// --- PART 3: DATA PROCESSING & DISPLAY ---
|
||||
$counters = [
|
||||
'total' => 0, 'ok' => 0, 'nOS' => 0, 'nAD' => 0, 'nSCCM' => 0, 'nGLPI' => 0,
|
||||
'nFI' => 0, 'nNESSUS' => 0, 'nNBU' => 0, 'nDPM' => 0, 'nS1' => 0,
|
||||
'nzabbix' => 0, 'nSCOM' => 0
|
||||
];
|
||||
|
||||
$maxS1Win = "0"; $maxS1Lin = "0";
|
||||
$dataRows = [];
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$dataRows[] = $row;
|
||||
$currentV = $row['S1'] ?? '';
|
||||
$os = $row['OS'] ?? '';
|
||||
if (str_contains($currentV, '.')) {
|
||||
if (stripos($os, 'Windows') !== false) {
|
||||
if (version_compare($currentV, $maxS1Win, '>')) { $maxS1Win = $currentV; }
|
||||
} else {
|
||||
if (version_compare($currentV, $maxS1Lin, '>')) { $maxS1Lin = $currentV; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($dataRows as $row) {
|
||||
// KPI Calculation
|
||||
$counters['total']++;
|
||||
$isCompliant = isset($row['AD'], $row['GLPI'], $row['SCCM'], $row['EPO']) && (isset($row['NBU']) || isset($row['DPM'])) && isset($row['SCOM']);
|
||||
if ($isCompliant) { $counters['ok']++; }
|
||||
if (!empty($row['OS']) && !preg_match('(XP|2003|2000|2008|Windows 7|2012)', $row['OS'])) { $counters['nOS']++; }
|
||||
if (!isset($row['AD'])) $counters['nAD']++;
|
||||
if (!isset($row['SCCM'])) $counters['nSCCM']++;
|
||||
if (!isset($row['GLPI'])) $counters['nGLPI']++;
|
||||
if (!isset($row['EPO'])) $counters['nNESSUS']++;
|
||||
if (!isset($row['NBU']) && !isset($row['DPM'])) $counters['nNBU']++;
|
||||
if (!isset($row['SCOM'])) $counters['nSCOM']++;
|
||||
if (!isset($row['zabbix'])) $counters['nzabbix']++;
|
||||
if (!isset($row['S1'])) $counters['nS1']++;
|
||||
|
||||
// Row Rendering
|
||||
$serverName = htmlspecialchars($row['Server'] ?? '', ENT_QUOTES, 'UTF-8');
|
||||
$serverUrl = urlencode($row['Server'] ?? '');
|
||||
if ($isCompliant) {
|
||||
$serverCell = "<td class='bg-success text-white'><b><a href='/crossover/Detail.php?server=$serverUrl' target='_blank' class='link-light'>$serverName</a></b></td>";
|
||||
} else {
|
||||
$serverCell = "<td><b><a href='/crossover/Detail.php?server=$serverUrl' target='_blank'>$serverName</a></b></td>";
|
||||
}
|
||||
|
||||
$osCell = "<td class='bg-warning'> </td>";
|
||||
if (!empty($row['OS'])) {
|
||||
$os = htmlspecialchars($row['OS']);
|
||||
$osCell = preg_match('(XP|2003|2000|2008|Windows 7|2012)', $row['OS']) ? "<td class='bg-warning text-black'>$os</td>" : "<td>$os</td>";
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
echo $serverCell . $osCell;
|
||||
echo "<td>" . htmlspecialchars($row['crit'] ?? '') . "</td>";
|
||||
echo renderStatusCellWithDate($row['AD'], $row['ADlu'], 45);
|
||||
echo renderStatusCellWithDate($row['GLPI'], $row['GLPIlu'], 7);
|
||||
echo renderStatusCellWithDate($row['SCCM'], $row['SCCMlu'], 7);
|
||||
|
||||
// NESSUS
|
||||
if (str_contains($row['EPO'] ?? '', '.')) { echo "<td class='bg-success text-white'>".htmlspecialchars($row['EPO'])."</td>"; }
|
||||
elseif (isset($row['EPO']) && !in_array($row['EPO'], ['Y', 'N'])) { echo "<td class='bg-secondary'><small>".htmlspecialchars($row['EPO'])."</small></td>"; }
|
||||
else { echo "<td class='bg-warning text-black'>Missing</td>"; }
|
||||
|
||||
// BACKUP
|
||||
if (($row['NBU'] ?? '') === 'Y') { echo renderStatusCellWithDate($row['NBU'], $row['NBUlu'], 30, 'OK (NBU)'); }
|
||||
elseif (($row['DPM'] ?? '') === 'Y') { echo renderStatusCellWithDate($row['DPM'], $row['DPMlu'], 30, 'OK (DPM)'); }
|
||||
else { echo renderStatusCellWithDate($row['NBU'] ?? $row['DPM'] ?? null, null, 30); }
|
||||
|
||||
// SCOM
|
||||
if (($row['SCOM'] ?? '') === 'Y') { echo "<td class='bg-success text-white'>OK</td>"; }
|
||||
elseif (isset($row['SCOM'])) { echo "<td class='bg-secondary'><small>".htmlspecialchars($row['SCOM'])."</small></td>"; }
|
||||
else { echo "<td class='bg-warning text-black'>Missing</td>"; }
|
||||
|
||||
// Zabbix
|
||||
$zabbixStatus = $row['zabbix'] ?? '';
|
||||
if ($zabbixStatus === 'Y' || str_contains($zabbixStatus, '.')) { echo "<td class='bg-success text-white'>".htmlspecialchars(str_replace('Y', 'OK', $zabbixStatus))."</td>"; }
|
||||
elseif (isset($row['zabbix'])) { echo "<td class='bg-secondary'><small>".htmlspecialchars($zabbixStatus)."</small></td>"; }
|
||||
else { echo "<td class='bg-warning text-black'>Missing</td>"; }
|
||||
|
||||
// S1 (Comparison)
|
||||
$s1Status = $row['S1'] ?? '';
|
||||
$osRaw = $row['OS'] ?? '';
|
||||
$targetMax = (stripos($osRaw, 'Windows') !== false) ? $maxS1Win : $maxS1Lin;
|
||||
|
||||
if (!empty($s1Status) && $s1Status === $targetMax && $targetMax !== "0") {
|
||||
echo "<td class='bg-success text-white'>" . htmlspecialchars($s1Status) . " <i class='bi bi-check-all'></i></td>";
|
||||
} elseif (str_contains($s1Status, '.')) {
|
||||
echo "<td class='bg-warning text-black'>" . htmlspecialchars($s1Status) . "</td>";
|
||||
} else {
|
||||
echo renderStatusCellWithDate($s1Status, $row['S1lu'] ?? null, 7, ($s1Status === 'Y' ? 'OK' : $s1Status));
|
||||
}
|
||||
echo "</tr>";
|
||||
}
|
||||
//echo "<script>let kpiData = " . json_encode($counters) . ";</script>";
|
||||
$stmt->close(); $conn->close();
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Global Crossover <small>(Updated every 15mn)</small></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row" style="zoom: 80%">
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-toggle="table" data-search="true"
|
||||
data-show-columns="true" data-pagination="true" data-export-types="['xlsx','csv','json']"
|
||||
data-loading-template="loadingTemplate" data-page-list="[20, 50, 100, All]" data-page-size="Tout"
|
||||
data-show-export="true" data-sortable="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true">Name</th>
|
||||
<th data-field="OS" data-sortable="true">Operating System</th>
|
||||
<th data-field="Criticity" data-sortable="true">Criticity</th>
|
||||
<th data-field="Departement" data-sortable="true" data-visible="false">Departement</th>
|
||||
<th data-field="AD" data-sortable="true">AD</th>
|
||||
<th data-field="ADlu" data-sortable="true" data-visible="false">AD Last Logon</th>
|
||||
<th data-field="GLPI" data-sortable="true">GLPI</th>
|
||||
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI">Last FI
|
||||
Inventory</th>
|
||||
<th data-field="SCCM" data-sortable="true">SCCM<br></th>
|
||||
<th data-field="SCCMlu" data-sortable="true" data-visible="false">SCCM Last Heartbeat</th>
|
||||
<th data-field="NESSUS" data-sortable="true">NESSUS</th>
|
||||
<th data-field="Backup" data-sortable="true">Backup</th>
|
||||
<th data-field="NBUlu" data-sortable="true" data-visible="false">Last Backup</th>
|
||||
<th data-field="SCOM" data-sortable="true">SCOM</th>
|
||||
<th data-field="Zabbix" data-sortable="true">Zabbix</th>
|
||||
<th data-field="S1" data-sortable="true">SentinelOne</th>
|
||||
<th data-field="S1lu" data-sortable="true" data-visible="false">S1 Last Update</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<button id="button" type="button" class="btn btn-primary btn-sm invisible"><i class="bi bi-arrow-clockwise"></i><b> Generate KPI</b></button>
|
||||
|
||||
<tbody>
|
||||
<!-- Display DATAs -->
|
||||
<?php
|
||||
$conn = DB_ENTRY02();
|
||||
// Base query
|
||||
$sql = "SELECT * FROM GlobalCrossover";
|
||||
$whereClauses = ["server NOT LIKE 'WS%'"];
|
||||
$params = [];
|
||||
$types = "";
|
||||
|
||||
// Handle filters securely using prepared statements
|
||||
if (isset($_GET['filter'])) {
|
||||
$filter = $_GET['filter'];
|
||||
$filterTitle = "Filter : " . htmlspecialchars($filter) . " non compliant";
|
||||
|
||||
switch ($filter) {
|
||||
case "AD":
|
||||
$whereClauses[] = "AD IS NULL OR (ADlu IS NOT NULL AND DATEDIFF(now(), ADlu) > 45)";
|
||||
break;
|
||||
case "OS":
|
||||
$whereClauses[] = "OS LIKE '%2003%' OR OS LIKE '%2008%'";
|
||||
break;
|
||||
case "GLPI":
|
||||
$whereClauses[] = "GLPI IS NULL OR GLPIlu IS NULL OR DATEDIFF(now(), GLPIlu) > 7";
|
||||
break;
|
||||
case "SCCM":
|
||||
$whereClauses[] = "SCCM IS NULL OR (SCCMlu IS NOT NULL AND DATEDIFF(now(), SCCMlu) > 7)";
|
||||
break;
|
||||
case "NESSUS":
|
||||
$whereClauses[] = "EPO IS NULL";
|
||||
break;
|
||||
case "NBU":
|
||||
$whereClauses[] = "NBU IS NULL OR (NBUlu IS NOT NULL AND DATEDIFF(now(), NBUlu) > 30)";
|
||||
break;
|
||||
case "SCOM":
|
||||
$whereClauses[] = "SCOM IS NULL";
|
||||
break;
|
||||
case "zabbix":
|
||||
$whereClauses[] = "zabbix IS NULL";
|
||||
break;
|
||||
case "S1":
|
||||
$whereClauses[] = "S1 IS NULL OR (S1lu IS NOT NULL AND DATEDIFF(now(), S1lu) > 7)";
|
||||
break;
|
||||
default:
|
||||
$filterTitle = null; // No valid filter
|
||||
break;
|
||||
}
|
||||
|
||||
if ($filterTitle) {
|
||||
echo "<h2><div style=\"text-align: center;\"><span class='badge text-bg-danger font-weight-bold'>$filterTitle</span></div></h2>";
|
||||
}
|
||||
}
|
||||
|
||||
// Combine all WHERE clauses
|
||||
if (!empty($whereClauses)) {
|
||||
$sql .= " WHERE " . implode(' AND ', $whereClauses);
|
||||
}
|
||||
|
||||
$sql .= " ORDER BY server";
|
||||
|
||||
// Prepare and execute the query
|
||||
$stmt = $conn->prepare($sql);
|
||||
// Note: If you had parameters, you would bind them here, e.g., $stmt->bind_param($types, ...$params);
|
||||
$stmt->execute();
|
||||
$result = $stmt->get_result();
|
||||
|
||||
|
||||
// --- PART 2: HELPER FUNCTIONS FOR RENDERING ---
|
||||
|
||||
/**
|
||||
* Renders a standard status cell based on a value and its last update date.
|
||||
* @param string|null $status The status value (e.g., 'Y', 'N').
|
||||
* @param string|null $lastUpdate The date of the last update.
|
||||
* @param int $daysThreshold The number of days to be considered "out of date".
|
||||
* @param string $okText Text to display for OK status (e.g., "OK", "OK (NBU)").
|
||||
* @return string The generated HTML for two <td> cells.
|
||||
*/
|
||||
function renderStatusCellWithDate(?string $status, ?string $lastUpdate, int $daysThreshold, string $okText = 'OK'): string {
|
||||
// Sanitize output to prevent XSS
|
||||
$status = htmlspecialchars($status ?? '', ENT_QUOTES, 'UTF-8');
|
||||
$lastUpdate = htmlspecialchars($lastUpdate ?? '', ENT_QUOTES, 'UTF-8');
|
||||
$okText = htmlspecialchars($okText, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
if ($status === 'Y') {
|
||||
if (empty($lastUpdate)) {
|
||||
// Status is OK, but date is missing
|
||||
return "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(255,193,7,1) 100%);'>$okText</td>"
|
||||
. "<td class='bg-warning text-black'>Missing</td>";
|
||||
}
|
||||
|
||||
try {
|
||||
$diff = date_diff(date_create($lastUpdate), date_create());
|
||||
$days = (int) $diff->format("%R%a");
|
||||
|
||||
if ($days > $daysThreshold) {
|
||||
// Out of date
|
||||
return "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>$okText</td>"
|
||||
. "<td class='bg-danger text-white'>$lastUpdate ($days days)</td>";
|
||||
} else {
|
||||
// Compliant
|
||||
return "<td class='bg-success text-white'>$okText</td>"
|
||||
. "<td class='bg-success text-white'>$lastUpdate</td>";
|
||||
}
|
||||
} catch (Exception) {
|
||||
// Handle invalid date format gracefully
|
||||
return "<td class='bg-danger text-white'>Invalid Date</td><td class='bg-danger text-white'>$lastUpdate</td>";
|
||||
}
|
||||
}
|
||||
|
||||
if ($status !== '') {
|
||||
// Not applicable, non-supported, etc.
|
||||
return "<td class='bg-secondary'><small>$status</small></td><td class='bg-secondary text-secondary'> </td>";
|
||||
}
|
||||
|
||||
// Missing
|
||||
return "<td class='bg-warning text-black'>Missing</td><td class='bg-warning text-warning'> </td>";
|
||||
}
|
||||
|
||||
// --- PART 3: CLEAN DATA DISPLAY LOOP ---
|
||||
|
||||
// Initialize counters
|
||||
$counters = [
|
||||
'total' => 0, 'ok' => 0, 'nOS' => 0, 'nAD' => 0, 'nSCCM' => 0, 'nGLPI' => 0,
|
||||
'nFI' => 0, 'nNESSUS' => 0, 'nNBU' => 0, 'nDPM' => 0, 'nS1' => 0
|
||||
];
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$counters['total']++;
|
||||
// Sanitize server name for URL and display
|
||||
$serverName = htmlspecialchars($row['Server'], ENT_QUOTES, 'UTF-8');
|
||||
$serverUrl = urlencode($row['Server']);
|
||||
|
||||
// Determine overall row status
|
||||
$isCompliant = isset($row['AD'], $row['GLPI'], $row['SCCM'], $row['EPO']) && (isset($row['NBU']) || isset($row['DPM'])) && isset($row['SCOM']);
|
||||
if ($isCompliant) {
|
||||
$counters['ok']++;
|
||||
$serverCell = "<td class='bg-success text-white'><b><a href='/crossover/Detail.php?server=$serverUrl' target='_blank' class='link-light'>$serverName</a></b></td>";
|
||||
} else {
|
||||
$serverCell = "<td><b><a href='/crossover/Detail.php?server=$serverUrl' target='_blank'>$serverName</a></b></td>";
|
||||
}
|
||||
|
||||
// OS Cell
|
||||
$osCell = "<td class='bg-warning'> </td>";
|
||||
if (!empty($row['OS'])) {
|
||||
$os = htmlspecialchars($row['OS']);
|
||||
if (preg_match('(XP|2003|2000|2008|Windows 7|2012)', $row['OS'])) {
|
||||
$osCell = "<td class='bg-warning text-black'>$os</td>";
|
||||
} else {
|
||||
$counters['nOS']++;
|
||||
$osCell = "<td>$os</td>";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<tr>";
|
||||
echo $serverCell;
|
||||
echo $osCell;
|
||||
echo "<td>" . htmlspecialchars($row['crit'] ?? '') . "</td>";
|
||||
echo "<td>" . htmlspecialchars($row['dpt'] ?? '') . "</td>";
|
||||
|
||||
// Use helper function for status columns
|
||||
echo renderStatusCellWithDate($row['AD'], $row['ADlu'], 45);
|
||||
echo renderStatusCellWithDate($row['GLPI'], $row['GLPIlu'], 7);
|
||||
echo renderStatusCellWithDate($row['SCCM'], $row['SCCMlu'], 7);
|
||||
|
||||
// NESSUS (EPO) Cell - Custom logic
|
||||
if (str_contains($row['EPO'] ?? '', '.')) {
|
||||
echo "<td class='bg-success text-white'>" . htmlspecialchars($row['EPO']) . "</td>";
|
||||
} elseif (isset($row['EPO']) && !in_array($row['EPO'], ['Y', 'N'])) {
|
||||
echo "<td class='bg-secondary'><small>" . htmlspecialchars($row['EPO']) . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-black'>Missing</td>";
|
||||
$counters['nNESSUS']++;
|
||||
}
|
||||
|
||||
// BACKUP Cell - Custom logic for NBU/DPM
|
||||
if ($row['NBU'] === 'Y') {
|
||||
echo renderStatusCellWithDate($row['NBU'], $row['NBUlu'], 30, 'OK (NBU)');
|
||||
} elseif ($row['DPM'] === 'Y') {
|
||||
echo renderStatusCellWithDate($row['DPM'], $row['DPMlu'], 30, 'OK (DPM)');
|
||||
} else {
|
||||
// Handle non-Y cases for NBU or DPM, or missing
|
||||
$backupStatus = $row['NBU'] ?? $row['DPM'] ?? null;
|
||||
echo renderStatusCellWithDate($backupStatus, null, 30);
|
||||
}
|
||||
|
||||
// SCOM Cell - Simple logic
|
||||
if ($row['SCOM'] === 'Y') {
|
||||
echo "<td class='bg-success text-white'>OK</td>";
|
||||
} elseif (isset($row['SCOM'])) {
|
||||
echo "<td class='bg-secondary'><small>" . htmlspecialchars($row['SCOM']) . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-black'>Missing</td>";
|
||||
}
|
||||
|
||||
// Zabbix Cell - Simple logic
|
||||
$zabbixStatus = $row['zabbix'] ?? '';
|
||||
if ($zabbixStatus === 'Y' || str_contains($zabbixStatus, '.')) {
|
||||
echo "<td class='bg-success text-white'>" . htmlspecialchars(str_replace('Y', 'OK', $zabbixStatus)) . "</td>";
|
||||
} elseif (isset($row['zabbix'])) {
|
||||
echo "<td class='bg-secondary'><small>" . htmlspecialchars($zabbixStatus) . "</small></td>";
|
||||
} else {
|
||||
echo "<td class='bg-warning text-black'>Missing</td>";
|
||||
}
|
||||
|
||||
// S1 Cell
|
||||
$s1Status = $row['S1'] ?? '';
|
||||
$s1Text = ($s1Status === 'Y' || str_contains($s1Status, '.')) ? str_replace('Y', 'OK', $s1Status) : 'OK';
|
||||
echo renderStatusCellWithDate($s1Status, $row['S1lu'], 7, $s1Text);
|
||||
|
||||
echo "</tr>";
|
||||
}
|
||||
// You can now use the $counters array to pass data to your JS for the KPIs
|
||||
// For example:
|
||||
echo "<script>let kpiData = " . json_encode($counters) . ";</script>";
|
||||
|
||||
$stmt->close();
|
||||
$conn->close();
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<button id="button" type="button" class="btn btn-primary btn-sm invisible"><i
|
||||
class="bi bi-arrow-clockwise"></i><b> Generate KPI</b></button>
|
||||
<div class="row flex-nowrap text-center" style="zoom: 80%">
|
||||
<div class="col"> <!-- CARTE Devices -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>All Devices</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-primary font-weight-bold" id="KPIDEVICE"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE OS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Supported OS</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=OS">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIOS"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>AD</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=AD">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIAD"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE GLPI/FI -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>GLPI/FI</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=GLPI">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIGLPI"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCCM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCCM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCCM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCCM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE EPO -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>NESSUS</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=NESSUS">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIEPO"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Backup (NBU + DPM) -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Backup</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=NBU">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPINBU"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCOM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCOM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCOM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCOM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Zabbix -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Zabbix</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=zabbix">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIzabbix"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SentinelOne -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SentinelOne</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=S1">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIS1"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="row flex-nowrap text-center" style="zoom: 80%">
|
||||
<div class="col"> <!-- CARTE Devices -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b><?php echo $w_allDevice; ?></b></div>
|
||||
<a href="/crossover/GlobalCrossover.php">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-primary font-weight-bold" id="KPIDEVICE"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE OS -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b><?php echo $w_supportedOS; ?></b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=OS">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIOS"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>AD</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=AD">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIAD"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE GLPI/FI -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>GLPI/FI</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=GLPI">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIGLPI"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCCM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCCM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCCM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCCM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE EPO -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>NESSUS</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=NESSUS">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIEPO"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Backup (NBU + DPM) -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b><?php echo $w_backup; ?></b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=NBU">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPINBU"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SCOM -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SCOM</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=SCOM">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPISCOM"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE Zabbix -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>Zabbix</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=zabbix">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIzabbix"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col"> <!-- CARTE SentinelOne -->
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><b>SentinelOne</b></div>
|
||||
<a href="/crossover/GlobalCrossover.php?filter=S1">
|
||||
<div class="card-body">
|
||||
<h2><span class="badge text-bg-secondary font-weight-bold" id="KPIS1"></span></h2>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
<script src="/crossover/Crossover-KPI.js"></script>
|
||||
|
||||
<script>
|
||||
let $table = $('#t1');
|
||||
const $button = $('#button');
|
||||
|
||||
$table.on('search.bs.table', function () {
|
||||
let $button = $('#button');
|
||||
$button.click();
|
||||
})
|
||||
|
||||
$(window).on('load', function () {
|
||||
$('.preloader').addClass('preloader-deactivate');
|
||||
});
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () { setTimeout(function () { $('#button').click(); }, 1000); });
|
||||
</script>
|
||||
|
||||
<SCRIPT>
|
||||
|
||||
$(function() {
|
||||
// Exécution initiale pour définir la hauteur
|
||||
adjustTableHeight();
|
||||
|
||||
// Événement de redimensionnement
|
||||
$(window).on('resize', function() {
|
||||
adjustTableHeight();
|
||||
});
|
||||
// 1. Déclenchement du calcul
|
||||
setTimeout(function () {
|
||||
$('#button').trigger('click');
|
||||
}, 500);
|
||||
|
||||
// 2. Gestion du redimensionnement
|
||||
function adjustTableHeight() {
|
||||
const table = $('#t1');
|
||||
const windowHeight = $(window).height();
|
||||
const tableTop = table.offset().top;
|
||||
const footerHeight = -50; // Hauteur estimée pour d'éventuels éléments en bas
|
||||
let availableHeight = windowHeight - tableTop - footerHeight;
|
||||
|
||||
// Définir une hauteur minimale
|
||||
availableHeight = Math.max(availableHeight, 400);
|
||||
|
||||
table.bootstrapTable('refreshOptions', {
|
||||
height: availableHeight
|
||||
});
|
||||
const $table = $('#t1');
|
||||
if ($table.length && $table.offset()) {
|
||||
const windowHeight = $(window).height();
|
||||
const tableTop = $table.offset().top;
|
||||
$table.bootstrapTable('refreshOptions', { height: Math.max(windowHeight - tableTop - 50, 400) });
|
||||
}
|
||||
}
|
||||
|
||||
$table = $('#t1');
|
||||
$table.on('search.bs.table', function () { $('#button').trigger('click'); });
|
||||
|
||||
adjustTableHeight();
|
||||
$(window).on('resize', adjustTableHeight);
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</HTML>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,8 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/../../include/db_connect.php"; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?>
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
@@ -37,7 +36,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Active Directory</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $w_ad;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row">
|
||||
@@ -55,10 +54,10 @@
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true">Name</th>
|
||||
<th data-field="OS" data-sortable="true">OS</th>
|
||||
<th data-field="Enabled" data-sortable="true">Enabled</th>
|
||||
<th data-field="LasLogon" data-sortable="true">Last Logon</th>
|
||||
<th data-field="Name" data-sortable="true"><?php echo $w_name;?></th>
|
||||
<th data-field="OS" data-sortable="true"><?php echo $w_os;?></th>
|
||||
<th data-field="Enabled" data-sortable="true"><?php echo $w_enabled;?></th>
|
||||
<th data-field="LasLogon" data-sortable="true"><?php echo $w_lastLogon;?></th>
|
||||
<th data-field="OU" data-visible="false">OU</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,7 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,7 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,8 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,7 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,7 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -26,8 +26,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php //include $_SERVER['DOCUMENT_ROOT']."/include/functions.inc.php" ; ?> <!-- Functions -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
|
||||
BIN
favicon.ico
Normal file
BIN
favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 MiB |
297
include/all.php
297
include/all.php
@@ -1,10 +1,21 @@
|
||||
<?php
|
||||
|
||||
// LANGUAGE MANAGEMENT
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
$lang = $_GET['lang'] ?? $_SESSION['lang'] ?? 'fr'; // "en" as default
|
||||
$allowed_langs = ['en', 'fr'];
|
||||
if (!in_array($lang, $allowed_langs)) {
|
||||
$lang = 'fr'; // DEFAULT failback
|
||||
}
|
||||
$_SESSION['lang'] = $lang;
|
||||
include $_SERVER['DOCUMENT_ROOT'] . "/include/" . $lang . ".php";
|
||||
|
||||
// CONSTANTS //
|
||||
$BaseUrl = "http://".$_SERVER['SERVER_NAME'];
|
||||
$BaseUrl = "https://".$_SERVER['SERVER_NAME'];
|
||||
$root = $_SERVER['DOCUMENT_ROOT'];
|
||||
$bdnuss = "http://web-bdnuss-sys-dev.appliarmony.net";
|
||||
$opwsinf = "https://wsopinf.appliarmony.net";
|
||||
|
||||
// FUNCTIONS //
|
||||
//tools//
|
||||
@@ -212,9 +223,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//DB Conn//
|
||||
function DB_SCCM(){
|
||||
$user = "infra";
|
||||
@@ -264,8 +272,282 @@
|
||||
return $pdo;
|
||||
}
|
||||
|
||||
//Cookie//
|
||||
function Set_Cookie() {
|
||||
// --- paramètres ---
|
||||
$cookieName = 'UserInfo';
|
||||
$cookieLife = 86400 * 365; // 1 an
|
||||
$cookieDomain = '.appliarmony.net';
|
||||
$secureFlag = true;
|
||||
$httpOnly = true;
|
||||
$sameSite = 'Lax';
|
||||
|
||||
// --- helpers ---
|
||||
$now = date('Y-m-d H:i:s');
|
||||
|
||||
// IP client: XFF (première IP) -> fallback REMOTE_ADDR
|
||||
$ip = '';
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$parts = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
$cand = trim($parts[0]);
|
||||
if (filter_var($cand, FILTER_VALIDATE_IP)) $ip = $cand;
|
||||
}
|
||||
if (!$ip && !empty($_SERVER['REMOTE_ADDR'])) $ip = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
// User Windows (SSO)
|
||||
$user = $_SERVER['REMOTE_USER'] ?? null;
|
||||
$hasUser = !empty($user);
|
||||
|
||||
// --- lecture éventuelle du cookie existant ---
|
||||
$cookie = [];
|
||||
if (!empty($_COOKIE[$cookieName])) {
|
||||
$decoded = json_decode($_COOKIE[$cookieName], true);
|
||||
if (is_array($decoded)) $cookie = $decoded;
|
||||
}
|
||||
|
||||
// --- écriture/MAJ SEULEMENT si on a un REMOTE_USER ---
|
||||
if ($hasUser) {
|
||||
if (empty($cookie) || ($cookie['user'] ?? null) !== $user) {
|
||||
// Nouveau cookie ou changement d’utilisateur → reset
|
||||
$cookie = [
|
||||
'user' => $user,
|
||||
'ip' => $ip,
|
||||
'created' => $now,
|
||||
'last' => $now
|
||||
];
|
||||
} else {
|
||||
// Même user → on rafraîchit last + IP
|
||||
$cookie['ip'] = $ip ?: ($cookie['ip'] ?? '');
|
||||
$cookie['last'] = $now;
|
||||
}
|
||||
|
||||
// Écrire le cookie (évite d’écrire si headers déjà envoyés)
|
||||
if (!headers_sent()) {
|
||||
setcookie($cookieName, json_encode($cookie), [
|
||||
'expires' => time() + $cookieLife,
|
||||
'path' => '/',
|
||||
'domain' => $cookieDomain,
|
||||
'secure' => $secureFlag,
|
||||
'httponly' => $httpOnly,
|
||||
'samesite' => $sameSite
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// --- exposer des constantes pour le reste du code ---
|
||||
// Priorité: si on a REMOTE_USER, on l’utilise; sinon on retombe sur le cookie existant; sinon vide/anonyme.
|
||||
$currentUser = $hasUser ? $user : ($cookie['user'] ?? 'Anonymous');
|
||||
$currentIp = $hasUser ? $ip : ($cookie['ip'] ?? ($_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'] ?? ''));
|
||||
|
||||
if (!defined('CURRENT_USER')) define('CURRENT_USER', $currentUser);
|
||||
if (!defined('CURRENT_IP')) define('CURRENT_IP', $currentIp);
|
||||
if (!defined('COOKIE_INFO')) define('COOKIE_INFO', $cookie);
|
||||
}
|
||||
Set_Cookie();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<style>
|
||||
/* 1. CONFIGURATION DES COULEURS */
|
||||
:root {
|
||||
/* Par défaut (Mode Clair / bg-light) : Gris visible sur blanc */
|
||||
--snow-color: rgba(160, 160, 160, 0.9);
|
||||
}
|
||||
|
||||
/* 2. DÉTECTION DU MODE SOMBRE BASÉE SUR TON SCRIPT */
|
||||
/* Ton script ajoute la classe 'bg-dark' au body, on s'en sert ici */
|
||||
body.bg-dark {
|
||||
--snow-color: rgba(255, 255, 255, 0.9) !important;
|
||||
}
|
||||
|
||||
/* Gestion des préférences système (OS) au cas où le script JS n'a pas encore chargé */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body:not(.bg-light) { /* Sauf si l'utilisateur a forcé le mode clair */
|
||||
--snow-color: rgba(255, 255, 255, 0.9);
|
||||
}
|
||||
}
|
||||
|
||||
/* 3. STYLES DU CANVAS ET DU BOUTON */
|
||||
#snow-canvas {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
z-index: 9999; /* Au-dessus de tout */
|
||||
pointer-events: none; /* LAISSE PASSER LES CLICS (Vital !) */
|
||||
}
|
||||
|
||||
#snow-toggle-btn {
|
||||
position: fixed;
|
||||
/* Positionné un peu au-dessus du bas pour ne pas gêner d'autres footers */
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
z-index: 10000;
|
||||
background: transparent;
|
||||
color: var(--snow-color); /* Le bouton prend aussi la couleur du thème */
|
||||
border: 1px solid var(--snow-color);
|
||||
border-radius: 50%;
|
||||
width: 35px;
|
||||
height: 35px;
|
||||
cursor: pointer;
|
||||
font-size: 18px;
|
||||
transition: all 0.3s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0.5; /* Discret par défaut */
|
||||
}
|
||||
|
||||
#snow-toggle-btn:hover {
|
||||
opacity: 1;
|
||||
background: rgba(128, 128, 128, 0.2);
|
||||
}
|
||||
</style>
|
||||
|
||||
<canvas id="snow-canvas"></canvas>
|
||||
<button id="snow-toggle-btn" title="Activer/Désactiver la neige">❄️</button>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
// --- 1. GESTION DES DATES (15 Déc au 5 Jan) ---
|
||||
const now = new Date();
|
||||
const month = now.getMonth() + 1; // JS compte les mois de 0 à 11, donc on ajoute 1
|
||||
const day = now.getDate();
|
||||
|
||||
// La condition : (Mois = 12 ET Jour >= 15) OU (Mois = 1 ET Jour ≤ 5)
|
||||
const isSeason = (month === 12 && day >= 15) || (month === 1 && day <= 5);
|
||||
|
||||
const canvas = document.getElementById('snow-canvas');
|
||||
const toggleBtn = document.getElementById('snow-toggle-btn');
|
||||
|
||||
// Si on n'est pas dans la période, on cache tout et on arrête le script.
|
||||
if (!isSeason) {
|
||||
if (canvas) canvas.style.display = 'none';
|
||||
if (toggleBtn) toggleBtn.style.display = 'none';
|
||||
return; // Arrêt immédiat du script
|
||||
}
|
||||
|
||||
// --- 2. CONFIGURATION ---
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
let width = window.innerWidth;
|
||||
let height = window.innerHeight;
|
||||
|
||||
const maxFlakes = 80;
|
||||
let flakes = [];
|
||||
let animationId;
|
||||
let isSnowing = false;
|
||||
|
||||
// Gestion du redimensionnement
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
window.addEventListener('resize', () => {
|
||||
width = window.innerWidth;
|
||||
height = window.innerHeight;
|
||||
canvas.width = width;
|
||||
canvas.height = height;
|
||||
});
|
||||
|
||||
// --- 3. CLASSE FLOCON ---
|
||||
class Snowflake {
|
||||
constructor() {
|
||||
this.reset(true);
|
||||
}
|
||||
|
||||
reset(initial = false) {
|
||||
this.x = Math.random() * width;
|
||||
this.y = initial ? Math.random() * height : -10;
|
||||
this.radius = Math.random() * 3 + 1;
|
||||
this.speed = Math.random() * 1.5 + 0.5;
|
||||
this.drift = Math.random() * 2 - 1;
|
||||
}
|
||||
|
||||
update() {
|
||||
this.y += this.speed;
|
||||
this.x += this.drift;
|
||||
|
||||
if (this.y > height || this.x > width || this.x < 0) {
|
||||
this.reset();
|
||||
}
|
||||
}
|
||||
|
||||
draw(color) {
|
||||
ctx.beginPath();
|
||||
ctx.fillStyle = color;
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
|
||||
// --- 4. ANIMATION ---
|
||||
function initFlakes() {
|
||||
flakes = [];
|
||||
for (let i = 0; i < maxFlakes; i++) {
|
||||
flakes.push(new Snowflake());
|
||||
}
|
||||
}
|
||||
|
||||
function animate() {
|
||||
if (!isSnowing) {
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
|
||||
// Récupération dynamique de la couleur (compatible avec ton script Light Switch)
|
||||
const style = getComputedStyle(document.body);
|
||||
const currentColor = style.getPropertyValue('--snow-color').trim();
|
||||
|
||||
flakes.forEach(flake => {
|
||||
flake.update();
|
||||
flake.draw(currentColor);
|
||||
});
|
||||
|
||||
animationId = requestAnimationFrame(animate);
|
||||
}
|
||||
|
||||
// --- 5. BOUTON & INIT ---
|
||||
function toggleSnow() {
|
||||
isSnowing = !isSnowing;
|
||||
updateButtonState();
|
||||
|
||||
if (isSnowing) {
|
||||
initFlakes();
|
||||
animate();
|
||||
localStorage.setItem('snow-preference', 'on');
|
||||
} else {
|
||||
cancelAnimationFrame(animationId);
|
||||
ctx.clearRect(0, 0, width, height);
|
||||
localStorage.setItem('snow-preference', 'off');
|
||||
}
|
||||
}
|
||||
|
||||
function updateButtonState() {
|
||||
if(isSnowing) {
|
||||
toggleBtn.style.opacity = "1";
|
||||
toggleBtn.style.background = "rgba(128, 128, 128, 0.3)";
|
||||
} else {
|
||||
toggleBtn.style.opacity = "0.5";
|
||||
toggleBtn.style.background = "transparent";
|
||||
}
|
||||
}
|
||||
|
||||
toggleBtn.addEventListener('click', toggleSnow);
|
||||
|
||||
const savedPref = localStorage.getItem('snow-preference');
|
||||
|
||||
if (savedPref !== 'off') {
|
||||
isSnowing = true;
|
||||
initFlakes();
|
||||
animate();
|
||||
updateButtonState();
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
@@ -283,3 +565,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
159
include/en.php
Normal file
159
include/en.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
// navbar
|
||||
$nav_home = "Home";
|
||||
$nav_1 = "Active Directory";
|
||||
$nav_1_1 = "Group Review";
|
||||
$nav_1_2 = "Group Membership";
|
||||
|
||||
$nav_2 = "Global Crossover";
|
||||
|
||||
$nav_3 = "Hyper-V";
|
||||
$nav_3_1 = "Clusters";
|
||||
$nav_3_2 = "VMs Backup";
|
||||
$nav_3_3 = "VMs Mem hunt";
|
||||
$nav_3_4 = "Hosts Mem hunt";
|
||||
$nav_3_5 = "VMs List";
|
||||
|
||||
|
||||
$nav_4 = "Shared Folders";
|
||||
$nav_4_1 = "Projects & Teams";
|
||||
$nav_4_2 = "HomeDirectories";
|
||||
|
||||
$nav_5_1 = "Inventory";
|
||||
$nav_5_2 = "SVA/SCU Accounts";
|
||||
$nav_5_3 = "Autoremediation Logs";
|
||||
$nav_5_4 = "Script results";
|
||||
|
||||
$nav_6 = "Rollups";
|
||||
$nav_6_1 = "Yearly Calendar";
|
||||
|
||||
$nav_7 = "Storage";
|
||||
$nav_7_1 = "Dashboard";
|
||||
$nav_7_2 = "Switchs FC";
|
||||
|
||||
$nav_8 = "Workstations";
|
||||
|
||||
$nav_9 = "Clusters";
|
||||
$nav_9_1 ="Resources";
|
||||
|
||||
$nav_10 = "SecureBoot";
|
||||
$nav_10_1 = "Servers";
|
||||
$nav_10_2 = "Workstations";
|
||||
|
||||
$nav_links = "Links";
|
||||
$nav_search = "Server Search...";
|
||||
|
||||
// titles
|
||||
$ti_1 = "Group Review";
|
||||
$ti_2 = "Group Membership";
|
||||
$ti_3 = "Global Crossover";
|
||||
$ti_4 = "Hyper-V Clusters";
|
||||
$ti_5 = "Memory Hunt - Hyper-V Only";
|
||||
$ti_6 = "Memory Hunt - All but Hyper-V";
|
||||
$ti_7 = "Project and Team folders";
|
||||
$ti_8 = "Home Directories";
|
||||
$ti_9 = "AIX / Linux inventory";
|
||||
$ti_10 = "SVA & SCU Accounts Attributes";
|
||||
$ti_11 = "Autoremediation Logs";
|
||||
$ti_12 = "Script Execution Follow-up";
|
||||
$ti_13 = "VIO Monitoring";
|
||||
$ti_14 = "Rollup Yearly Calendar";
|
||||
$ti_15 = "SVC Storage Dashboard";
|
||||
$ti_16 = "Workstation Global Crossover";
|
||||
$ti_17 = "HeartBeat Map for servers NOT in maintenance";
|
||||
$ti_18 = "Cluster Resources";
|
||||
$ti_19 = "Virtual Machines";
|
||||
|
||||
// words
|
||||
$w_server = "Server";
|
||||
$w_name = "Name";
|
||||
$w_groupMembership = "Group Membership";
|
||||
$w_groupSearch = "Find group in Active Directory";
|
||||
$w_startToType = "Start to type ...";
|
||||
$w_seeMembers = "See Members";
|
||||
$w_os = "Operating System";
|
||||
$w_crit = "Criticality";
|
||||
$w_ad = "Active Directory";
|
||||
$w_adlu = "AD last update";
|
||||
$w_filu = "FI last update";
|
||||
$w_sccmlu = "SCCM last update";
|
||||
$w_backup = "Backup";
|
||||
$w_backuplu = "Last Backup";
|
||||
$w_s1lu = "S1 last update";
|
||||
$w_allDevice = "All Devices";
|
||||
$w_supportedOS = "Supported OS";
|
||||
$w_nonCompliant = "Non-compliant";
|
||||
$w_filter ="Filter";
|
||||
$w_submit = "Submit";
|
||||
$w_days = "days";
|
||||
$w_devices = "Devices";
|
||||
$w_inactives = "Inactives";
|
||||
$w_enabled = "Enabled";
|
||||
$w_lastLogon = "Last Logon";
|
||||
$w_VMleft = "VMs left";
|
||||
$w_VMs = "VMs";
|
||||
$w_nodes = "Nodes";
|
||||
$w_freeMem = "Free Mem";
|
||||
$w_freeCSV = "Free CSV";
|
||||
$w_unclustered = "Unclustered";
|
||||
$w_wrongOwner = "Wrong Owner";
|
||||
$w_worstScenario = "Worst Failover scenario available memory";
|
||||
$w_lastResult = "Last Result";
|
||||
$w_lastGoodBackup = "Last Good Backup";
|
||||
$w_size = "Size";
|
||||
$w_host = "Host";
|
||||
$w_policy = "Policy";
|
||||
$w_vmBackup = "VMs Backup";
|
||||
$w_success = "Success";
|
||||
$w_issues = "Issues";
|
||||
$w_outdated = "Outdated";
|
||||
$w_excluded = "Excluded";
|
||||
$w_vmAssignedGB = "VMs assigned GB";
|
||||
$w_vmMaxUsedGB = "VMs max used GB";
|
||||
$w_potentialSavingsGB = "Potential Savings GB";
|
||||
$w_assignedGB = "Assigned GB";
|
||||
$w_minUsedGB = "Min Used GB";
|
||||
$w_maxUsedGB = "Max Used GB";
|
||||
$w_avgUsedGB = "Avg Used GB";
|
||||
$w_hardware = "Hardware";
|
||||
$w_entries = "Entries";
|
||||
$w_folder = "Folder";
|
||||
$w_users = "Users";
|
||||
$w_inAD = "In AD";
|
||||
$w_accountEnabled = "Account Enabled";
|
||||
$w_heartbeat = "Heartbeat";
|
||||
$w_lastReboot = "Last Reboot";
|
||||
$w_account = "Account";
|
||||
$w_homeDirectory = "Home Directory";
|
||||
$w_loginShell = "Login Shell";
|
||||
$w_command = "Command";
|
||||
$w_other = "Other";
|
||||
$w_all = "All";
|
||||
$w_location = "Location";
|
||||
$w_physicalCapacity = "Physical Capacity";
|
||||
$w_volumeCapacity = "Volume Capacity";
|
||||
$w_capacityGain = "Capacity Gain";
|
||||
$w_thin ="Thin Provisioning";
|
||||
$w_unassignedLUNs = "Unassigned LUNs";
|
||||
$w_hostsWoLUNs = "Hosts w/o LUNs";
|
||||
$w_resource = "Resource";
|
||||
$w_owner = "Owner";
|
||||
$w_state = "State";
|
||||
$w_memory = "Memory";
|
||||
$w_lastUpdate = "Last Update";
|
||||
$w_nextRollup = "Next Rollup";
|
||||
$w_storageTotalGB = "Storage Total GB";
|
||||
$w_storageUsedGB = "Storage Used GB";
|
||||
$w_network = "Network";
|
||||
$w_start = "Start";
|
||||
$w_end = "End";
|
||||
$w_mask = "Mask";
|
||||
$w_scopeOptions = "Scope Options";
|
||||
$w_reservations = "Reservations";
|
||||
$w_globalOptionValues = "Global Options Values";
|
||||
$w_prefferedNode = "Preffered Node";
|
||||
$w_VMOnWrongOwner = "VM(s) on Wrong Owner";
|
||||
$w_unclusteredVMs = "Unclustered VM(s)";
|
||||
$w_vmCpuChecked = "VM(s) With 'CPU Compatibility' checked";
|
||||
$w_vmDynamicVHD = "VM(s) with dynamic VHD";
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 3.2 MiB |
158
include/fr.php
Normal file
158
include/fr.php
Normal file
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
|
||||
// navbar
|
||||
$nav_home = "Accueil";
|
||||
$nav_1 = "Service d'annuaire";
|
||||
$nav_1_1 = "Revue des Groupes";
|
||||
$nav_1_2 = "Membres des Groupes";
|
||||
|
||||
$nav_2 = "<small>Consolid. Multiple</small>";
|
||||
|
||||
$nav_3 = "Hyper-V";
|
||||
$nav_3_1 = "Grappes de Serveurs";
|
||||
$nav_3_2 = "Sauvegardes MVs";
|
||||
$nav_3_3 = "Chasse Mem MVs";
|
||||
$nav_3_4 = "Chasse Mem Hôtes";
|
||||
$nav_3_5 = "Liste des MVs";
|
||||
|
||||
$nav_4 = "Dossiers Partagés";
|
||||
$nav_4_1 = "Projets & Equipes";
|
||||
$nav_4_2 = "Dossiers Personnels";
|
||||
|
||||
$nav_5_1 = "Inventaire";
|
||||
$nav_5_2 = "Comptes SVA/SCU";
|
||||
$nav_5_3 = "Journaux d'autorépar.";
|
||||
$nav_5_4 = "Résultat des Scripts";
|
||||
|
||||
$nav_6 = "Cumulatifs";
|
||||
$nav_6_1 = "Calendrier annuel";
|
||||
|
||||
$nav_7 = "Disques Réseau";
|
||||
$nav_7_1 = "Tableau de Bord";
|
||||
$nav_7_2 = "Commutateurs FC";
|
||||
|
||||
$nav_8 = "Postes de travail";
|
||||
|
||||
$nav_9 = "Grappes de Serveurs";
|
||||
$nav_9_1 ="Ressources";
|
||||
|
||||
$nav_10 = "Démarrage Sécurisé";
|
||||
$nav_10_1 = "Serveurs";
|
||||
$nav_10_2 = "Postes de Travail";
|
||||
|
||||
$nav_links = "Liens";
|
||||
$nav_search = "Recherche Serveur...";
|
||||
|
||||
// titles
|
||||
$ti_1 = "Revue des Groupes";
|
||||
$ti_2 = "Membres des Groupes";
|
||||
$ti_3 = "Consolidation Multisources";
|
||||
$ti_4 = "Grappes de Serveurs Hyper-V";
|
||||
$ti_5 = "Chasse à la mémoire - Hôtes Hyper-V";
|
||||
$ti_6 = "Chasse à la mémoire - Tout sauf les Hyper-V";
|
||||
$ti_7 = "Dossiers Projets et Equipes";
|
||||
$ti_8 = "Dossiers Utilisateurs";
|
||||
$ti_9 = "Inventaire AIX / Linux";
|
||||
$ti_10 = "Détails des comptes SVA & SCU";
|
||||
$ti_11 = "Journaux de remédiation automatique";
|
||||
$ti_12 = "Suivi d'exécution des Scripts";
|
||||
$ti_13 = "Surveillance VIO";
|
||||
$ti_14 = "Calendrier Annuel des Cumulatifs";
|
||||
$ti_15 = "Tableau de Bord SVC";
|
||||
$ti_16 = "Consolidation Multisources des Postes de Travail";
|
||||
$ti_17 = "Carte des signes de présence pour les Serveurs qui ne sont pas en maintenance";
|
||||
$ti_18 = "Ressources des Grappes de Serveurs";
|
||||
$ti_19 = "Machines Virtuelles";
|
||||
|
||||
// words
|
||||
$w_server = "Serveur";
|
||||
$w_name = "Nom";
|
||||
$w_groupMembership = "Membres du groupe";
|
||||
$w_groupSearch = "Trouver un groupe dans le Service d'Annuaire";
|
||||
$w_startToType = "Commencez à taper ...";
|
||||
$w_seeMembers = "Voir les membres";
|
||||
$w_os = "Système d'Exploitation";
|
||||
$w_crit = "Criticité";
|
||||
$w_ad = "Service d'annuaire";
|
||||
$w_adlu = "Dernière connexion à l'Annuaire";
|
||||
$w_filu = "Dernier inventaire FI";
|
||||
$w_sccmlu = "Dernier inventaire SCCM";
|
||||
$w_backup = "Sauvegarde";
|
||||
$w_backuplu = "Dernière Sauvegarde";
|
||||
$w_s1lu = "Dernier inventaire S1";
|
||||
$w_allDevice = "Tous les appareils";
|
||||
$w_supportedOS = "Systèmes supportés";
|
||||
$w_nonCompliant ="Non-conforme";
|
||||
$w_filter = "Filtre";
|
||||
$w_submit = "Soumettre";
|
||||
$w_days = "jours";
|
||||
$w_devices = "Appareils";
|
||||
$w_inactives = "Inactifs";
|
||||
$w_enabled = "Actif";
|
||||
$w_lastLogon = "Dernière connexion";
|
||||
$w_VMleft = "MVs restantes";
|
||||
$w_VMs = "MVs";
|
||||
$w_nodes = "Nœuds";
|
||||
$w_freeMem = "Mém. libre";
|
||||
$w_freeCSV = "CSV libre";
|
||||
$w_unclustered = "Pas en ressource";
|
||||
$w_wrongOwner = "Mauvais Nœud";
|
||||
$w_worstScenario = "Mémoire disponible en cas de pire basculement";
|
||||
$w_lastResult = "Dernier Résultat";
|
||||
$w_lastGoodBackup = "Dernière Sauvegarde Réussie";
|
||||
$w_size = "Taille";
|
||||
$w_host = "Hôte";
|
||||
$w_policy = "Politique";
|
||||
$w_vmBackup = "Sauvegarde des MVs";
|
||||
$w_success = "Succès";
|
||||
$w_issues = "Problème";
|
||||
$w_outdated = "En retard";
|
||||
$w_excluded = "Exclusion";
|
||||
$w_vmAssignedGB = "GB Assignés aux MVs";
|
||||
$w_vmMaxUsedGB = "GB Max utilisés par MVs";
|
||||
$w_potentialSavingsGB = "Gain de GB potentiel";
|
||||
$w_assignedGB = "GB assignés";
|
||||
$w_minUsedGB = "Utilisation Min GB";
|
||||
$w_maxUsedGB = "Utilisation Max GB";
|
||||
$w_avgUsedGB = "Utilisation Moyenne GB";
|
||||
$w_hardware = "Matériel";
|
||||
$w_entries = "Entrées";
|
||||
$w_folder = "Dossier";
|
||||
$w_users = "Utilisateurs";
|
||||
$w_inAD = "Dans l'annuaire";
|
||||
$w_accountEnabled = "Compte Actif";
|
||||
$w_heartbeat = "Signe de Présence";
|
||||
$w_lastReboot = "Dernier Redémarrage";
|
||||
$w_account = "Compte";
|
||||
$w_homeDirectory = "Dossier Personnel";
|
||||
$w_loginShell = "Interpéteur de connexion";
|
||||
$w_command = "Commande";
|
||||
$w_other = "Autre";
|
||||
$w_all = "Tous";
|
||||
$w_location = "Emplacement";
|
||||
$w_physicalCapacity = "Capacité Physique";
|
||||
$w_volumeCapacity = "Capacité du Volume";
|
||||
$w_capacityGain = "Gain de Capacité";
|
||||
$w_thin = "Provisionnement dynamique";
|
||||
$w_unassignedLUNs = "LUNs non assignées";
|
||||
$w_hostsWoLUNs = "Hôtes sans LUNs";
|
||||
$w_resource = "Ressource";
|
||||
$w_owner = "Propriétaire";
|
||||
$w_state = "Etat";
|
||||
$w_memory = "Mémoire";
|
||||
$w_lastUpdate = "Dernière Mise à Jour";
|
||||
$w_nextRollup = "Prochain Cumulatif";
|
||||
$w_storageTotalGB = "Stockage Total GB";
|
||||
$w_storageUsedGB = "Stockage Utilisé GB";
|
||||
$w_network = "Réseau";
|
||||
$w_start = "Début";
|
||||
$w_end = "Fin";
|
||||
$w_mask = "Masque";
|
||||
$w_scopeOptions = "Options de portée";
|
||||
$w_reservations = "Réservations";
|
||||
$w_globalOptionValues = "Valeurs des Options Globales";
|
||||
$w_prefferedNode = "Noeud préféré";
|
||||
$w_VMOnWrongOwner = "MV(s) sur le mauvais noeud";
|
||||
$w_unclusteredVMs = "MV(s) non en ressource";
|
||||
$w_vmCpuChecked = "MV(s) avec 'Compatibilité CPU' coché";
|
||||
$w_vmDynamicVHD = "MV(s) avec VHD dynamique";
|
||||
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
// Temporarily enable all error reporting to catch details from odbc_connect
|
||||
// error_reporting(E_ALL); // Uncomment this line if you still don't get enough info
|
||||
|
||||
$conn_string = "DRIVER={IBM DB2 ODBC DRIVER - F_DB2_clidriver};" .
|
||||
"DATABASE=AIXCMDB; " .
|
||||
"HOSTNAME=db2_aixcmdb.appliarmony.net;" .
|
||||
"PORT=50000; " .
|
||||
"PROTOCOL=TCPIP; " .
|
||||
"UID=aixcmdb;" .
|
||||
"AUTHENTICATION=SERVER;" .
|
||||
"PWD=aixcmdb;";
|
||||
|
||||
$conn = odbc_connect($conn_string, "", "");
|
||||
|
||||
if (!$conn) {
|
||||
// --- IMPORTANT: Récupérer le message d'erreur ODBC détaillé ---
|
||||
$error_message = "ODBC Connect Error: " . odbc_errormsg() . " (" . odbc_error() . ")";
|
||||
echo "Pas de connexion : " . $error_message . "<br>";
|
||||
// Pour débogage, tu peux aussi loguer cette erreur dans un fichier
|
||||
// error_log($error_message);
|
||||
return "ERROR: Could not connect to DB2. Check connection string and ODBC setup."; // Retourne une erreur pour éviter l'appel à odbc_exec
|
||||
}
|
||||
|
||||
$rs = odbc_exec($conn, $request);
|
||||
|
||||
// Ton code existant après la connexion
|
||||
if (strpos(strtoupper($request), "SELECT") !== false) { // strpos est plus robuste que instr ici en PHP
|
||||
$answer = []; // Initialize array to prevent undefined variable warning
|
||||
while ($row = odbc_fetch_array($rs)) {
|
||||
$answer[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($answer)) {
|
||||
return $answer;
|
||||
} else {
|
||||
if ($rs) {
|
||||
return "OK";
|
||||
} else {
|
||||
// If odbc_exec failed
|
||||
error_reporting(E_ALL); // Re-enable for this specific error if needed
|
||||
return "ERROR : " . odbc_errormsg($conn);
|
||||
}
|
||||
}
|
||||
|
||||
30
index.php
30
index.php
@@ -6,7 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -25,7 +25,7 @@
|
||||
</head>
|
||||
|
||||
<body class="bg-light text-dark">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/../../include/db_connect.php" ; ?> <!-- Database connexion -->
|
||||
<?php include $_SERVER['DOCUMENT_ROOT']."/include/all.php" ; ?> <!-- Database connexion -->
|
||||
<div class="container-fluid">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
@@ -35,7 +35,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">HOME</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $nav_home; ?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
@@ -69,7 +69,7 @@
|
||||
<div class="row flex-nowrap text-center">
|
||||
<div class="col"> <!-- CARTE AD -->
|
||||
<div class="card border-primary mb-3">
|
||||
<div class="card-header text-dark"><h5><i class="fs-4 bi-pc text-primary"></i> ActiveDirectory</h5></div>
|
||||
<div class="card-header text-dark"><h5><i class="fs-4 bi-pc text-primary"></i> <?php echo $w_ad; ?></h5></div>
|
||||
<div class="card-body">
|
||||
<?php
|
||||
DB_ENTRY02();
|
||||
@@ -78,7 +78,7 @@
|
||||
$result = $conn->query("SELECT count(*) as nbADinactive FROM adcomputers WHERE enabled = 'False'");
|
||||
$nbADinactive = mysqli_fetch_array($result)['nbADinactive'];
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/AD-Detail.php""><?php echo $nbADactive; ?></b> Devices <small>(<?php echo $nbADinactive; ?> inactifs)</small></a></p>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/AD-Detail.php""><?php echo $nbADactive; ?></b> <?php echo $w_devices; ?> <small>(<?php echo $nbADinactive; ?> <?php echo $w_inactives; ?>)</small></a></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -93,7 +93,7 @@
|
||||
$nbglpi = mysqli_fetch_array($result)['nbglpi'];
|
||||
mysqli_close($conn);
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/GLPI-Detail.php"><?php echo $nbglpi; ?></b> Devices</a></p>
|
||||
<p class="card-text text-center text-dark"><b><?php echo $nbglpi; ?></b> <?php echo $w_devices; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@
|
||||
$rs=odbc_exec($conn,$sql);
|
||||
$nbsccm = odbc_result($rs,"nbsccm");
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/SCCM-Detail.php"><?php echo $nbsccm; ?></b> Agents</a></p>
|
||||
<p class="card-text text-center text-dark"><b><?php echo $nbsccm; ?></b> Agents</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -122,7 +122,7 @@
|
||||
$result = $conn->query("SELECT count(*) as nbnessus FROM GlobalCrossover where epo like '%.%'");
|
||||
$nbnessus = mysqli_fetch_array($result)['nbnessus'];
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/Nessus-Detail.php"><?php echo $nbnessus; ?></b> Agents</a></p>
|
||||
<p class="card-text text-center text-dark"><b><?php echo $nbnessus; ?></b> Agents</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -135,7 +135,7 @@
|
||||
$result = $conn->query("SELECT count(*) as nbS1 FROM GlobalCrossover where S1 like '%.%'");
|
||||
$nbS1 = mysqli_fetch_array($result)['nbS1'];
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/S1-Detail.php"><?php echo $nbS1; ?></b> Agents</a></p>
|
||||
<p class="card-text text-center text-dark"><b><?php echo $nbS1; ?></b> Agents</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -150,7 +150,7 @@
|
||||
$nbnbu = mysqli_fetch_array($result)['nbnbu'];
|
||||
mysqli_close($conn);
|
||||
?>
|
||||
<p class="card-text text-center"><b><a href="/dashboard/NBU-Detail.php"><?php echo $nbnbu; ?></b> Clients</a></p>
|
||||
<p class="card-text text-center text-dark"><b><?php echo $nbnbu; ?></b> Clients</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -161,7 +161,7 @@
|
||||
<div class="row flex-nowrap text-center">
|
||||
<div class="col">
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><h3>OS Windows INFRA</h3></div>
|
||||
<div class="card-header text-dark"><h3>Windows INFRA</h3></div>
|
||||
<div class="card-body">
|
||||
<canvas id="ChartServer" ></canvas>
|
||||
</div>
|
||||
@@ -169,7 +169,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><h3>OS Windows APPLI</h3></div>
|
||||
<div class="card-header text-dark"><h3>Windows APPLI</h3></div>
|
||||
<div class="card-body">
|
||||
<canvas id="ChartServerA" ></canvas>
|
||||
</div>
|
||||
@@ -177,7 +177,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><h3>OS Linux/AIX</h3></div>
|
||||
<div class="card-header text-dark"><h3>Linux/AIX</h3></div>
|
||||
<div class="card-body">
|
||||
<canvas id="ChartLinux"></canvas>
|
||||
</div>
|
||||
@@ -185,7 +185,7 @@
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="card border-secondary mb-3">
|
||||
<div class="card-header text-dark"><h3>Device Type</h3></div>
|
||||
<div class="card-header text-dark"><h3>Type</h3></div>
|
||||
<div class="card-body">
|
||||
<canvas id="ChartType"></canvas>
|
||||
</div>
|
||||
@@ -240,7 +240,7 @@
|
||||
});
|
||||
|
||||
let dataType = document.getElementById("dataType").innerHTML.split(",");
|
||||
let labelsType = ['Physical', 'Virtual'];
|
||||
let labelsType = ['Phys.', 'Virt.'];
|
||||
new Chart("ChartType", {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
|
||||
148
navbar.html
148
navbar.html
@@ -3,38 +3,70 @@
|
||||
<script src="/js/JQueryUI.js"></script>
|
||||
|
||||
<div class="d-flex flex-column align-items-center align-items-sm-start px-3 pt-2 text-white min-vh-100 border-end border-primary">
|
||||
<a href="/" class="d-flex align-items-center pb-3 mb-md-0 me-md-auto text-white text-decoration-none">
|
||||
<span class="fs-5 d-none d-sm-inline text-primary h3">INFRA REPORTS IT</span>
|
||||
</a>
|
||||
<span class="badge bg-primary fs-6">INFRA REPORTS <b>IT</b></span>
|
||||
|
||||
<div class="d-flex align-items-center ms-auto">
|
||||
|
||||
<?php
|
||||
$allowedUsers = array(
|
||||
'armony\c08816',
|
||||
'armony\e025532',
|
||||
'armony\e028005',
|
||||
'armony\e034710',
|
||||
'armony\p035262',
|
||||
'armony\u005852',
|
||||
'armony\u010166',
|
||||
'armony\u016841',
|
||||
'armony\u016842',
|
||||
'armony\u037059',
|
||||
'armony\u049761',
|
||||
'armony\u049762',
|
||||
'armony\A0884805'
|
||||
);
|
||||
$currentUser = isset($_SERVER['REMOTE_USER']) ? strtolower($_SERVER['REMOTE_USER']) : '';
|
||||
if (in_array($currentUser, $allowedUsers)) :
|
||||
?>
|
||||
<div class="form-check form-switch mt-2 me-3">
|
||||
<input class="form-check-input" type="checkbox" id="langSwitch" <?php echo ($lang == 'fr') ? 'checked' : ''; ?> onchange="toggleLanguage()">
|
||||
<label class="form-check-label text-white" style="font-size: 0.8rem;" for="langSwitch">
|
||||
<?php echo ($lang == 'fr') ? "🇺🇸-<b>FR</b>" : "<b>US</b>-🇫🇷"; ?>
|
||||
</label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-check form-switch mt-2 me-3">
|
||||
<input class="form-check-input" type="checkbox" id="lightSwitch" />
|
||||
<label class="form-check-label text-white" style="font-size: 0.8rem;" for="lightSwitch">
|
||||
<i class="bi bi-sun"></i>/<i class="bi bi-moon"></i>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch ms-auto mt-3 me-3">
|
||||
<label class="form-check-label ms-3" for="lightSwitch">
|
||||
<i class="bi bi-sun"></i>/<i class="bi bi-moon"></i>
|
||||
</label>
|
||||
<input class="form-check-input" type="checkbox" id="lightSwitch" />
|
||||
</div>
|
||||
|
||||
|
||||
<div class="position-relative bottom-0 start-0 p-3">
|
||||
<input type="text" id="searchServer" class="form-control" placeholder="Server Search..." style="font-size: 0.75rem !important">
|
||||
<input type="text" id="searchServer" class="form-control" placeholder="<?php echo $nav_search; ?>" style="font-size: 0.75rem !important">
|
||||
</div>
|
||||
|
||||
<hr class="w-100">
|
||||
|
||||
<ul class="nav nav-pills flex-column mb-sm-auto mb-0 align-items-center align-items-sm-start" id="menu">
|
||||
<li class="nav-item">
|
||||
<a href="/index.php" class="nav-link align-middle px-0">
|
||||
<i class="fs-6 bi-house text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Home</span>
|
||||
<i class="fs-6 bi-house text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_home; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="/crossover/GlobalCrossover.php" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi-table text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">DB Crossover</span></a>
|
||||
<i class="fs-6 bi-table text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_2; ?></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#SharedFolders" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-folder-symlink-fill text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Shared Folders</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-folder-symlink-fill text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_4; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="SharedFolders" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/shared-folders/eqp-prj.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- PRJ & EQP Folders</span></a>
|
||||
<a href="/shared-folders/homedirectories.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- HomeDirectories</span></a>
|
||||
<a href="/Shared-Folders/eqp-prj.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_4_1; ?></span></a>
|
||||
<a href="/Shared-Folders/HomeDirectories.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_4_2; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -43,78 +75,119 @@
|
||||
<i class="fs-6 bi bi-pc text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Unix/Linux</span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="Unix" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/X/inventory.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Server Inventory</span></a>
|
||||
<a href="/X/SVA-SCU.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- SVA/SCU Accounts</span></a>
|
||||
<a href="/X/autoremediationlog.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- AutoRemediation Logs</span></a>
|
||||
<a href="/X/stdout.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Scripts Result</span></a>
|
||||
<a href="/X/inventory.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_5_1; ?></span></a>
|
||||
<a href="/X/SVA-SCU.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_5_2; ?></span></a>
|
||||
<a href="/X/autoremediationlog.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_5_3; ?></span></a>
|
||||
<a href="/X/stdout.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_5_4; ?></span></a>
|
||||
<a href="/X/backups.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $w_backup; ?></span></a>
|
||||
<a href="/X/VIO.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- VIO</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#rollup" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-calendar text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Rollups</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-calendar text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_6; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="rollup" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/Rollups/rollup-calendar.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Full Calendar</span></a>
|
||||
<a href="/Rollups/rollup-calendar.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_6_1; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#HyperV" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-pc text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Hyper-V</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-pc text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_3;?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="HyperV" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/Hyper-V/clusters.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Hyper-V Clusters</span></a>
|
||||
<a href="/Hyper-V/VMs-Backups.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- VMs Backups</span></a>
|
||||
<a href="/Hyper-V/Clusters.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_3_1 ;?></span></a>
|
||||
<a href="/Hyper-V/VMs-Backups.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_3_2 ;?></span></a>
|
||||
<!--
|
||||
<a href="/Hyper-V/SYN-VMList.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Synergy VMs</span></a>
|
||||
<a href="/Hyper-V/Legacy-VMList.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Legacy Hyper-V VMs</span></a>
|
||||
<a href="/Hyper-V/migration.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Migration FollowUp</span></a>
|
||||
-->
|
||||
<a href="/Hyper-V/memory-hunt-vms.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_3_3 ;?></span></a>
|
||||
<a href="/Hyper-V/memory-hunt-HV.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_3_4 ;?></span></a>
|
||||
<a href="/Hyper-V/VMs.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_3_5 ;?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Storage" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-server text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Storage</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-server text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_7; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="Storage" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/Storage/Dashboard.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Dashboard IBM SAN</span></a>
|
||||
<a href="/Storage/orphanluns.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- SVC Orphan LUNs</span></a>
|
||||
<a href="/Storage/Dashboard.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_7_1; ?></span></a>
|
||||
<a href="/Storage/switchssan.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_7_2; ?></span></a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Workstation" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-pc-display-horizontal text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Workstations</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-pc-display-horizontal text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_8; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="Workstation" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/workstation/globalcrossover.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- Crossover</span></a>
|
||||
<a href="/workstation/globalcrossover.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_2; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#Heartbeat" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-activity text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Heartbeat</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-activity text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $w_heartbeat;?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="Heartbeat" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/reports/heartbeat.php" class="nav-link px-0" target="_blank"> <span class="d-none d-sm-inline text-white h7">- Heartbeat Map</span></a>
|
||||
<a href="/reports/heartbeat.php" class="nav-link px-0" > <span class="d-none d-sm-inline text-white h7">- <?php echo $w_heartbeat;?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#AD" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-people text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">ActiveDirectory</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-people text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_1; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="AD" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/AD/GroupReview.php" class="nav-link px-0" target="_blank"> <span class="d-none d-sm-inline text-white h7">- Group Review</span></a>
|
||||
<a href="/AD/GroupSearch.php" class="nav-link px-0" target="_blank"> <span class="d-none d-sm-inline text-white h7">- Group Membership</span></a>
|
||||
<a href="/AD/GroupReview.php" class="nav-link px-0" > <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_1_1; ?></span></a>
|
||||
<a href="/AD/GroupSearch.php" class="nav-link px-0" > <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_1_2; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#cluster" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-hdd-network text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><small><?php echo $nav_9; ?></small></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="cluster" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/Inventory/ClusterResource.php" class="nav-link px-0" > <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_9_1; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#network" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-diagram-3 text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><small><?php echo $w_network; ?></small></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="network" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/Network/dhcp_servers.php" class="nav-link px-0" > <span class="d-none d-sm-inline text-white h7">- DHCP</span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#secureboot" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-shield-lock text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><small><?php echo $nav_10; ?></small></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="secureboot" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="/SecureBoot/SecureBoot-SRV.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_10_1; ?></span></a>
|
||||
<a href="/SecureBoot/SecureBoot-WS.php" class="nav-link px-0"> <span class="d-none d-sm-inline text-white h7">- <?php echo $nav_10_2; ?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<br>
|
||||
<br>
|
||||
<li class="nav-item">
|
||||
<a href="http://infra-tools.appliarmony.net/index.php" class="nav-link align-middle px-0" target="_blank">
|
||||
<i class="fs-5 bi-link text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h6">Infra-Tools</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#link" data-bs-toggle="collapse" class="nav-link px-0 align-middle">
|
||||
<i class="fs-6 bi bi-link text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7">Links</span><i class="bi bi-caret-down"></i> </a>
|
||||
<i class="fs-6 bi bi-link text-white"></i> <span class="ms-1 d-none d-sm-inline text-white h7"><?php echo $nav_links; ?></span><i class="bi bi-caret-down"></i> </a>
|
||||
<ul class="collapse nav flex-column ms-1" id="link" data-bs-parent="#menu">
|
||||
<li class="w-100">
|
||||
<a href="http://dash-dtd-systemdk.appliarmony.net/index-it-dark.html" class="nav-link px-0" target="_blank"> <span class="d-none d-sm-inline text-white h7">- Dashboard IT</span></a>
|
||||
@@ -127,6 +200,13 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleLanguage() {
|
||||
let searchParams = new URLSearchParams(window.location.search);
|
||||
let currentLang = '<?php echo $lang; ?>';
|
||||
let newLang = (currentLang === 'en') ? 'fr' : 'en';
|
||||
searchParams.set('lang', newLang);
|
||||
window.location.search = searchParams.toString();
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$("#searchServer").autocomplete({
|
||||
source: "/Inventory/search_servers.php",
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
$folders = Invoke_Infra("select * from fls_and_prs f
|
||||
left join ad_all_users u on u.cn = f.folder
|
||||
where typ = 'HomeDirectory'
|
||||
and (enabled <> 'True' or acl not like 'ARMONY%' or o365 <> 'N')
|
||||
order by [server],folder");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Home Directories with issues <small><small>(<?php echo count($folders); ?> entries) </small></small><br><h6>Updated every day at 07:00:00</h6></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mb-1 text-dark text-uppercase">
|
||||
<center><i class="bi bi-hourglass-split"></i><br> Work in progress ...</center>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-secondary progress-bar-striped progress-bar-animated" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<th data-field="Server" data-sortable="true">Server</th>
|
||||
<th data-field="Folder" data-sortable="true">Folder</th>
|
||||
<th data-field="ACL" data-sortable="true">ACL</th>
|
||||
<th data-field="AD" data-sortable="true">in AD</th>
|
||||
<th data-field="Enabled" data-sortable="true">Account Enabled</th>
|
||||
<th data-field="o365" data-sortable="true">o365</th>
|
||||
<th data-field="Quota" data-sortable="true">Quota</th>
|
||||
<th data-field="Size" data-sortable="true">Size</th>
|
||||
<th data-field="LastLogon" data-sortable="true">Last Logon</th>
|
||||
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($folders as $answer) {
|
||||
if(str_contains($answer['acl'],"S-1-5")){$acl="<td class='table-warning'>?</td>";}else{$acl="<td>".$answer['acl']."</td>";}
|
||||
if($answer['enabled'] != 'True'){$enabled="<td class='table-warning'><b>N</b></td>";}else{$enabled="<td>Y</td>";}
|
||||
if($answer['cn'] == ''){$inAD="<td class='table-warning'><b>N</b></td>";}else{$inAD="<td>Y</td>";}
|
||||
if($answer['o365'] != 'N'){$o365="<td class='table-warning'><b>".$answer['o365']."</b></td>";}else{$o365="<td>N</td>";}
|
||||
|
||||
echo "<td class='text-nowrap'>".$answer['server']."</td>";
|
||||
echo "<td>".$answer['folder']."</td>";
|
||||
echo $acl;
|
||||
echo $inAD;
|
||||
echo $enabled;
|
||||
echo $o365;
|
||||
echo "<td>".$answer['quota']."</td>";
|
||||
echo "<td>".$answer['size']."</td>";
|
||||
echo "<td class='text-nowrap'>".$answer['lastlogon']."</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
$(document).ready(function() {
|
||||
$('#t1').DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
var options = $('#t1').bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
$('#t1').bootstrapTable('refreshOptions',options);
|
||||
});
|
||||
|
||||
function tableresize() {
|
||||
var options = $('#t1').bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
$('#t1').bootstrapTable('refreshOptions',options);
|
||||
};
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</SCRIPT>
|
||||
@@ -85,7 +85,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">HeartBeat Map for servers NOT in maintenance</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_17;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container">
|
||||
@@ -95,7 +95,7 @@
|
||||
<?php if($wcount){$color = "DarkOrange";$msg = "<b> --> ".$wcount." issue(s)</b>";}else{$color = "green";$msg = "OK";} ?>
|
||||
<div class="card" style='background-color:<?php echo $color ?>;'>
|
||||
<h4 class="card-header">
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#windows"><b>Windows : <?php echo count($windows)." Devices ". $msg; ?></b></a>
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#windows"><b>Windows : <?php echo count($windows)." $w_devices ". $msg; ?></b></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="windows" class="collapse" data-bs-parent="#accordion">
|
||||
@@ -106,7 +106,7 @@
|
||||
<?php if($lcount){$color = "DarkOrange";$msg = "<b> --> ".$lcount." issue(s)</b>";}else{$color = "green";$msg = "OK";} ?>
|
||||
<div class="card" style='background-color:<?php echo $color ?>;'>
|
||||
<h4 class="card-header">
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#linux"><b>Linux : <?php echo count($linux)." Devices ". $msg; ?></b></a>
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#linux"><b>Linux : <?php echo count($linux)." $w_devices ". $msg; ?></b></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="linux" class="collapse" data-bs-parent="#accordion">
|
||||
@@ -117,7 +117,7 @@
|
||||
<?php if($acount){$color = "DarkOrange";$msg = "<b> --> ".$acount." issue(s)</b>";}else{$color = "green";$msg = "OK";} ?>
|
||||
<div class="card" style='background-color:<?php echo $color ?>;'>
|
||||
<h4 class="card-header text-white">
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#aix"><b>AIX : <?php echo count($aix)." Devices ". $msg; ?></b></a>
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#aix"><b>AIX : <?php echo count($aix)." $w_devices ". $msg; ?></b></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="aix" class="collapse" data-bs-parent="#accordion">
|
||||
@@ -128,7 +128,7 @@
|
||||
<?php if($ocount){$color = "DarkOrange";$msg = "<b> --> ".$ocount." issue(s)</b>";}else{$color = "green";$msg = "OK";} ?>
|
||||
<div class="card" style='background-color:<?php echo $color ?>;'>
|
||||
<h4 class="card-header text-white">
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#other"><b>Other : <?php echo count($other)." Devices ". $msg; ?></b></a>
|
||||
<a class="btn text-white fs-3" data-bs-toggle="collapse" href="#other"><b>Other : <?php echo count($other)." $w_devices ". $msg; ?></b></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="other" class="collapse" data-bs-parent="#accordion">
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
<script src="/js/jquery-3.6.1.min.js"></script>
|
||||
<!-- Bootstrap -->
|
||||
<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>
|
||||
<!-- Bootstrap-tables -->
|
||||
<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">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/include/all.php"; ?> <!-- Include All -->
|
||||
<?php // DATA
|
||||
$answers = Invoke_WebInfraTools("SELECT * FROM sva_attributes order by sva");
|
||||
?>
|
||||
|
||||
<!-- HTML -->
|
||||
<div class="container-fluid" id="content">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark vh-100 position-sticky top-0" style="-ms-flex: 0 0 230px;flex: 0 0 230px;">
|
||||
<?php include $_SERVER['DOCUMENT_ROOT'] . "/navbar.html"; ?>
|
||||
</div>
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">SVA & SCU Accounts Attributes </span></h1><h6>Updated every hour</h6>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="container-fluid">
|
||||
<!-- MODAL WAIT -->
|
||||
<div class="modal fade bs-example-modal-sm" id="wait" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="padding-top: 15%;">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h4 class="modal-title mb-1 text-dark text-uppercase">
|
||||
<center><i class="bi bi-hourglass-split"></i><br> Work in progress ...</center>
|
||||
</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="progress">
|
||||
<div class="progress-bar progress-bar-secondary progress-bar-striped progress-bar-animated" style="width: 100%"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- TABLE -->
|
||||
<div>
|
||||
<table class='table table-bordered table-hover table-sm' id='t1' data-height="620" data-toggle="table" data-search="true" data-show-columns="true" data-export-types="['xlsx','csv','json']" data-show-export="true" data-sortable="true" data-sort-name="VM">
|
||||
<thead> <!-- Header -->
|
||||
<tr>
|
||||
<th data-field='account' data-sortable='true'>Account</th>
|
||||
<th data-field='Displayname' data-sortable='true'>Displayname</th>
|
||||
<th data-field='Uid' data-sortable='true'>Uid</th>
|
||||
<th data-field='UidNumber' data-sortable='true'>UidNumber</th>
|
||||
<th data-field='Gecos' data-sortable='true'>Gecos</th>
|
||||
<th data-field='UnixHD' data-sortable='true'>Unix Home Directory</th>
|
||||
<th data-field='Login Shell' data-sortable='true'>Login Shell</th>
|
||||
<th data-field='GID Number' data-sortable='true'>GID Number</th>
|
||||
<th data-field='Enabled' data-sortable='true'>Enabled</th>
|
||||
<th data-field='LastLogon' data-sortable='true'>Last Logon</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody> <!-- Body -->
|
||||
<?php
|
||||
foreach ($answers as $row) {
|
||||
if ($row['enabled'] != 'True') {echo '<tr class="table-danger">';}else{echo '<tr>';}
|
||||
echo '<td class="text-nowrap"><b>'.$row['SVA'].'</b></td>';
|
||||
echo '<td><small>'.$row['displayname'].'</small></td>';
|
||||
echo '<td><small>'.$row['uid'].'</small></td>';
|
||||
echo '<td><small>'.$row['uidnumber'].'</small></td>';
|
||||
echo '<td><small>'.$row['gecos'].'</small></td>';
|
||||
echo '<td><small>'.$row['unixHD'].'</small></td>';
|
||||
echo '<td><small>'.$row['loginshell'].'</small></td>';
|
||||
echo '<td><small>'.$row['gidnumber'].'</small></td>';
|
||||
echo '<td><small>'.$row['enabled'].'</small></td>';
|
||||
if($row['lastlogon'] == ""){
|
||||
echo '<td class="table-warning"><small><b>NEVER</b></small></td>';
|
||||
}else{
|
||||
echo '<td class="text-nowrap"><small>'.date_format(date_create($row['lastlogon']),"Y-m-d H:i:s").'</small></td>';
|
||||
}
|
||||
echo '</tr>' ;
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
<script src="/js/switch.js"></script>
|
||||
</HTML>
|
||||
|
||||
<SCRIPT>
|
||||
let table = $('#t1');
|
||||
$(document).ready(function() {
|
||||
table.DataTable({
|
||||
scrollY: '50vh',
|
||||
scrollCollapse: true,
|
||||
paging: false,
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
});
|
||||
|
||||
function tableresize() {
|
||||
let options = table.bootstrapTable('getOptions');
|
||||
options.height= document.getElementById('content').clientHeight-170;
|
||||
table.bootstrapTable('refreshOptions',options);
|
||||
}
|
||||
|
||||
window.addEventListener("resize", tableresize);
|
||||
</SCRIPT>
|
||||
@@ -7,7 +7,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Page Title -->
|
||||
<title>Web Infra Reports</title>
|
||||
<title>Web Infra Reports IT</title>
|
||||
<link rel="shortcut icon" type="image/png" href="/include/favicon-32x32.png">
|
||||
|
||||
<!-- JQuery -->
|
||||
@@ -39,7 +39,7 @@
|
||||
<!-- Display -->
|
||||
<div class="col py-3">
|
||||
<!-- Page Title -->
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;">Workstations Crossover</span></h1>
|
||||
<h1><span class="badge text-bg-secondary font-weight-bold" style="width:100%;"><?php echo $ti_16;?></span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<div class="row" style="zoom: 80%">
|
||||
@@ -54,17 +54,16 @@
|
||||
data-height="620" data-show-export="true" data-sortable="true">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-field="Name" data-sortable="true">Name</th>
|
||||
<th data-field="OS" data-sortable="true">Operating System</th>
|
||||
<th data-field="AD" data-sortable="true">AD</th>
|
||||
<th data-field="ADlu" data-sortable="true" data-visible="false">AD Last Logon</th>
|
||||
<th data-field="Name" data-sortable="true"><?php echo $w_name;?></th>
|
||||
<th data-field="OS" data-sortable="true"><?php echo $w_os;?></th>
|
||||
<th data-field="AD" data-sortable="true"><?php echo $w_ad;?></th>
|
||||
<th data-field="ADlu" data-sortable="true" data-visible="false"><?php echo $w_adlu;?></th>
|
||||
<th data-field="GLPI" data-sortable="true">GLPI</th>
|
||||
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI">Last FI
|
||||
Inventory</th>
|
||||
<th data-field="GLPIlu" data-sortable="true" data-visible="false" data-footer-formatter="FI"><?php echo $w_filu;?></th>
|
||||
<th data-field="SCCM" data-sortable="true">SCCM<br></th>
|
||||
<th data-field="SCCMlu" data-sortable="true" data-visible="false">SCCM Last Heartbeat</th>
|
||||
<th data-field="SCCMlu" data-sortable="true" data-visible="false"><?php echo $w_sccmlu;?></th>
|
||||
<th data-field="S1" data-sortable="true">SentinelOne<br></th>
|
||||
<th data-field="S1lu" data-sortable="true" data-visible="false">SentinelOne Last Heartbeat</th>
|
||||
<th data-field="S1lu" data-sortable="true" data-visible="false"><?php echo $w_s1lu;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user