This commit is contained in:
e025532
2024-11-26 09:37:10 +01:00
parent d339cb10d8
commit d1f7f5f313
11 changed files with 320 additions and 117 deletions

View File

@@ -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%;">Global Crossover</span></h1>
<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%">
@@ -66,9 +66,9 @@
$result = $conn->query("select * from GlobalCrossover where SCCM is null or (SCCMlu is not null and DATEDIFF(now(),SCCMlu) > 7) order by server");
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : SCCM non compliant</span></center></h2>";
break;
case "EPO":
$result = $conn->query("select * from GlobalCrossover where EPO is null or (EPOlu is not null and DATEDIFF(now(),EPOlu) > 7) order by server");
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : EPO non compliant</span></center></h2>";
case "NESSUS":
$result = $conn->query("select * from GlobalCrossover where EPO is null order by server");
echo "<h2><center><span class='badge text-bg-danger font-weight-bold'>Filter : NESSUS non compliant</span></center></h2>";
break;
case "NBU":
$result = $conn->query("select * from GlobalCrossover where NBU is null or (NBUlu is not null and DATEDIFF(now(),NBUlu) > 30) order by server");
@@ -107,8 +107,7 @@
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="EPO" data-sortable="true">EPO</th>
<th data-field="EPOlu" data-sortable="true" data-visible="false">EPO Last Update</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>
@@ -128,7 +127,7 @@
$nSCCM = 0;
$nGLPI = 0;
$nFI = 0;
$nEPO = 0;
$nNESSUS = 0;
$nNBU = 0;
$nDPM = 0;
$nS1 = 0;
@@ -148,7 +147,7 @@
$nOS++;
echo "<td>" . $row['OS'] . "</td>";
} else {
echo "<td class='bg-warning'>" . $row['OS'] . "</td>";
echo "<td class='bg-warning text-black'>" . $row['OS'] . "</td>";
}
} else {
echo "<td class='bg-warning'>&nbsp;</td>";
@@ -176,7 +175,7 @@
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nSCCM++;
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
}
}
@@ -195,7 +194,7 @@
echo "<td class='bg-success text-white'>" . $row['GLPIlu'] . "</td>";
} else {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(255,193,7,1) 100%);'>OK</td>";
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
}
}
$nGLPI++;
@@ -205,7 +204,7 @@
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nGLPI++;
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
}
}
@@ -228,31 +227,20 @@
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nSCCM++;
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
}
}
// EPO
if ($row['EPO'] == 'Y') {
$date1 = date_create($row['EPOlu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 7) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='bg-danger text-white'>" . $row['EPOlu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
echo "<td class='bg-success text-white'>OK</td>";
echo "<td class='bg-success text-white'>" . $row['EPOlu'] . "</td>";
$nEPO++;
}
// NESSUS
if (strpos($row['EPO'], '.') !== false ) {
echo "<td class='bg-success text-white'>".$row['EPO']."</td>";
} else {
if (isset($row['EPO'])) {
if (isset($row['EPO']) && $row['EPO'] != 'Y' && $row['EPO'] != 'N') {
echo "<td class='bg-secondary'><small>" . $row['EPO'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nEPO++;
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
$nNESSUS++;
}
}
@@ -289,7 +277,7 @@
echo "<td class='bg-secondary'><small>" . $row['DPM'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
}
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
}
}
@@ -302,41 +290,42 @@
if (isset($row['SCOM'])) {
echo "<td class='bg-secondary'><small>" . $row['SCOM'] . "</small></td>";
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
}
}
// zabbix
if ($row['zabbix'] == 'Y') {
echo "<td class='bg-success text-white'>OK</td>";
if ($row['zabbix'] == 'Y' || strpos($row['zabbix'], '.') !== false ) {
echo "<td class='bg-success text-white'>".str_replace('Y','OK',$row['zabbix'])."</td>";
} else {
if (isset($row['zabbix'])) {
echo "<td class='bg-secondary'><small>" . $row['zabbix'] . "</small></td>";
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
}
}
// S1
if ($row['S1'] == 'Y') {
if ($row['S1'] == 'Y' || strpos($row['S1'], '.') !== false) {
$date1 = date_create($row['S1lu']);
$diff = date_diff($date1, date_create(date("Y-m-d")));
if ($diff->format("%R%a") > 7) {
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>OK</td>";
echo "<td class='text-white' style='background: linear-gradient(90deg, rgba(25,135,84,1) 50%, rgba(220,53,69,1) 100%);'>".str_replace('Y','OK',$row['S1'])."</td>";
echo "<td class='bg-danger text-white'>" . $row['S1lu'] . " (" . $diff->format("%R%a") . " days)</td>";
} else {
echo "<td class='bg-success text-white'>OK</td>";
echo "<td class='bg-success text-white'>".str_replace('Y','OK',$row['S1'])."</td>";
echo "<td class='bg-success text-white'>" . $row['S1lu'] . "</td>";
$nS1++;
}
} else {
if (isset($row['S1'])) {
if($row['S1'] == "N"){$row['S1'] = "Non Supported OS";}
echo "<td class='bg-secondary'><small>" . $row['S1'] . "</small></td>";
echo "<td class='bg-secondary text-secondary'>&nbsp;</td>";
$nS1++;
} else {
echo "<td class='bg-warning text-warning'>Missing</td>";
echo "<td class='bg-warning text-warning'>&nbsp;</td>";
echo "<td class='bg-warning text-black'>Missing</td>";
echo "<td class='bg-warning text-black'>&nbsp;</td>";
}
}
echo "</tr>";
@@ -401,8 +390,8 @@
</div>
<div class="col"> <!-- CARTE EPO -->
<div class="card border-secondary mb-3">
<div class="card-header text-dark"><b>EPO</b></div>
<a href="/crossover/GlobalCrossover.php?filter=EPO">
<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>