Remove unused PHP files related to Hyper-V and Storage dashboards
- Deleted `cluster-detail2.php`, `constants.inc copy.php`, `D.php`, and `Dashboard2.php`. These files were no longer in use and contributed to unnecessary clutter in the codebase. - Cleaned up references to removed files.
This commit is contained in:
@@ -24,32 +24,32 @@
|
||||
<script src="/js/chart.min.js"></script>
|
||||
<script src="/js/apexcharts.min.js"></script>
|
||||
<!-- Gauge -->
|
||||
<link rel="stylesheet" href="/css/gauge.css">
|
||||
<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">
|
||||
<div class="row flex-nowrap">
|
||||
<!-- Left NAVBAR -->
|
||||
<div class="col-auto col-md-2 col-xl-2 px-sm-2 px-0 bg-dark" 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%;">Hyper-V Clusters</span></h1>
|
||||
<?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" 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%;">Hyper-V Clusters</span></h1>
|
||||
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
<!-- Main content -->
|
||||
<?php
|
||||
$clusters = Invoke_Infra("select distinct cluster from cmdb_HyperV_Hosts where cluster <> '' and cluster not like '%-WM%' and cluster not like '%-C1MAS%' and cluster not like '%-vrs%' and (cluster like 'DUN%' or cluster like 'DMV%') order by cluster");
|
||||
?>
|
||||
<div class="container-fluid" style="zoom:90%">
|
||||
<div class="row">
|
||||
?>
|
||||
<div class="container-fluid" style="zoom:90%">
|
||||
<div class="row">
|
||||
|
||||
<?php
|
||||
<?php
|
||||
$count = 0;
|
||||
$totalleft = 0;
|
||||
foreach ($clusters as $cluster) {
|
||||
@@ -65,14 +65,15 @@
|
||||
$vm_mem = 0;
|
||||
$disk = 0;
|
||||
$io = 0;
|
||||
$node_mem = 0;
|
||||
$capacity = 0; $free = 0;
|
||||
foreach ($data as $d) {
|
||||
$vms += $d['vm_count'];
|
||||
$vm_mem += $d['vm_memory'];
|
||||
$node_mem = 0 + (int) $d['node_ram'];
|
||||
$node_mem = (int) $d['node_ram'];
|
||||
foreach (explode("|", $d['csvs']) as $csv) {
|
||||
if (instr($csv, ';')) {
|
||||
$free += explode(";", $csv)[1] - explode(";", $csv)[2];
|
||||
$free += intval(explode(";", $csv)[1]) - intval(explode(";", $csv)[2]);
|
||||
$disk = max($disk, $free);
|
||||
$capacity += (int) explode(";", $csv)[1];
|
||||
}
|
||||
@@ -97,30 +98,30 @@
|
||||
?>
|
||||
|
||||
<div class='col-3'>
|
||||
<a href="Cluster-detail.php?cluster=<?php echo $cluster['cluster']; ?>" class="text-decoration-none" target="_blank">
|
||||
<div class='card border-secondary mb-3'>
|
||||
<div class='card-header text-white bg-dark border-secondary'>
|
||||
<h4>
|
||||
<center><?php echo $cluster['cluster']; ?></center>
|
||||
</h4>
|
||||
<h6>
|
||||
<center><b><?php echo $nodes; ?></b> Nodes / <b><?php echo $vms; ?></b> VMs <?php echo $vleft; ?></center>
|
||||
</h6>
|
||||
<?php
|
||||
if((int)$nodes == 2 && $vms > 0){
|
||||
$Repart = Invoke_Infra("select Owner, count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and decomtime is null group by Owner order by Owner");
|
||||
$vmCountNode1 = $vmCountNode2 = 0;
|
||||
$node1_name = $node2_name = "";
|
||||
if(count($Repart) == 1 ){
|
||||
$node1_name = $Repart[0]['Owner']; $vmCountNode1 = $Repart[0]['nbvm'];
|
||||
}else{
|
||||
$node1_name = 'DUN'; $vmCountNode1 = $Repart[0]['nbvm'];
|
||||
$node2_name = 'MDK'; $vmCountNode2 = $Repart[1]['nbvm'];
|
||||
}
|
||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||
<a href="cluster-detail.php?cluster=<?php echo $cluster['cluster']; ?>" class="text-decoration-none" target="_blank">
|
||||
<div class='card border-secondary mb-3'>
|
||||
<div class='card-header text-white bg-dark border-secondary'>
|
||||
<h4 class="text-center">
|
||||
<?php echo $cluster['cluster']; ?>
|
||||
</h4>
|
||||
<h6 class="text-center">
|
||||
<b><?php echo $nodes; ?></b> Nodes / <b><?php echo $vms; ?></b> VMs <?php echo $vleft; ?>
|
||||
</h6>
|
||||
<?php
|
||||
if($nodes == 2 && $vms > 0){
|
||||
$Repart = Invoke_Infra("select Owner, count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and decomtime is null group by Owner order by Owner");
|
||||
$vmCountNode1 = $vmCountNode2 = 0;
|
||||
$node1_name = $node2_name = "";
|
||||
if(count($Repart) == 1 ){
|
||||
$node1_name = $Repart[0]['Owner']; $vmCountNode1 = $Repart[0]['nbvm'];
|
||||
}else{
|
||||
$node1_name = 'DUN'; $vmCountNode1 = $Repart[0]['nbvm'];
|
||||
$node2_name = 'MDK'; $vmCountNode2 = $Repart[1]['nbvm'];
|
||||
}
|
||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||
<div class='progress-bar text-white' role='progressbar' style='width:$percentageNode1%' aria-valuenow='$percentageNode1' aria-valuemin='0' aria-valuemax='100'>
|
||||
<b>$node1_name : $vmCountNode1 VMs</b>
|
||||
</div>
|
||||
@@ -128,16 +129,16 @@
|
||||
<b>$node2_name : $vmCountNode2 VMs</b>
|
||||
</div>
|
||||
</div>";
|
||||
}elseif((int)$nodes == 4){
|
||||
$RepartD = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'DUN%' and decomtime is null");
|
||||
$RepartM = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'MDK%' and decomtime is null");
|
||||
$vmCountNode1 = $vmCountNode2 = 0;
|
||||
$node1_name = 'DUN'; $vmCountNode1 = $RepartD[0]['nbvm'];
|
||||
$node2_name = 'MDK'; $vmCountNode2 = $RepartM[0]['nbvm'];
|
||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||
}elseif($nodes == 4){
|
||||
$RepartD = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'DUN%' and decomtime is null");
|
||||
$RepartM = Invoke_Infra("select count(owner) as nbvm from cmdb_vms where Cluster ='".$cluster['cluster']."' and Owner like 'MDK%' and decomtime is null");
|
||||
$vmCountNode1 = $vmCountNode2 = 0;
|
||||
$node1_name = 'DUN'; $vmCountNode1 = $RepartD[0]['nbvm'];
|
||||
$node2_name = 'MDK'; $vmCountNode2 = $RepartM[0]['nbvm'];
|
||||
$totalVMs = $vmCountNode1 + $vmCountNode2;
|
||||
$percentageNode1 = ($totalVMs > 0) ? ($vmCountNode1 / $totalVMs) * 100 : 0;
|
||||
$percentageNode2 = ($totalVMs > 0) ? ($vmCountNode2 / $totalVMs) * 100 : 0;
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px;'>
|
||||
<div class='progress-bar text-white' role='progressbar' style='width:$percentageNode1%' aria-valuenow='$percentageNode1' aria-valuemin='0' aria-valuemax='100'>
|
||||
<b>$node1_name : $vmCountNode1 VMs</b>
|
||||
</div>
|
||||
@@ -146,17 +147,17 @@
|
||||
</div>
|
||||
</div>";
|
||||
|
||||
}else{
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px; background-Color: transparent;'>
|
||||
<div class='progress-bar' style='width: 0%; background-color: transparent;'></div>
|
||||
}else{
|
||||
echo "<div class='progress' style='border: 2px solid grey; height: 20px; background-Color: transparent;'>
|
||||
<div class='progress-bar' style='width: 0; background-color: transparent;'></div>
|
||||
</div>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class='card-body text-white bg-dark'>
|
||||
<?php
|
||||
//Memory
|
||||
echo "<div class='row'>";
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class='card-body text-white bg-dark'>
|
||||
<?php
|
||||
//Memory
|
||||
echo "<div class='row'>";
|
||||
echo "<div class='col-7'>";
|
||||
echo "<b>Free Mem : </b>".($clmem - $vm_mem). " / " .$clmem. " GB";
|
||||
echo "</div><div class='col-5'>";
|
||||
@@ -176,9 +177,9 @@
|
||||
<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></div>";
|
||||
//DISK
|
||||
echo "<div class='row'>";
|
||||
echo "</div></div>";
|
||||
//DISK
|
||||
echo "<div class='row'>";
|
||||
echo "<div class='col-7'>";
|
||||
$unit="GB";
|
||||
if($capacity > 10000){
|
||||
@@ -188,7 +189,7 @@
|
||||
$used = $capacity - $free;
|
||||
echo "<b>Free CSV : </b>".$free. " / " .$capacity. " $unit";
|
||||
echo "</div><div class='col-5'>";
|
||||
$pcent = round(($free)/$capacity*100);
|
||||
$pcent = ($clmem > 0) ? round(($clmem - $vm_mem) / $clmem * 100) : 0;
|
||||
$pcent_restant = 100 - $pcent;
|
||||
if($pcent <= 5){
|
||||
$color = "bg-danger"; $border = "red";
|
||||
@@ -204,28 +205,25 @@
|
||||
<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></div>";
|
||||
echo "<div class='row'><div class='col-7'><b>CSV I/O</b> R/W (24h) :</div><div class='col-5'><b> $io KB/s</b></div></div>";
|
||||
echo "</div></div>";
|
||||
echo "<div class='row'><div class='col-7'><b>CSV I/O</b> R/W (24h) :</div><div class='col-5'><b> $io KB/s</b></div></div>";
|
||||
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$count++; }
|
||||
?>
|
||||
<br><br><h3><center>Total VM Left : <?php echo $totalleft;?> </center></h3>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
$count++; }
|
||||
?>
|
||||
<br><br><h3 class ="text-center">Total VM Left : <?php echo $totalleft;?> </h3>
|
||||
</div>
|
||||
<!-- End of main content -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/js/switch.js"></script>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
|
||||
Reference in New Issue
Block a user