diff --git a/Hyper-V/VMs-Backups.php b/Hyper-V/VMs-Backups.php index 28577a3..db21a56 100644 --- a/Hyper-V/VMs-Backups.php +++ b/Hyper-V/VMs-Backups.php @@ -145,7 +145,7 @@ // 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 ){ diff --git a/Hyper-V/clusters.php b/Hyper-V/clusters.php index 8e92781..bcc3a48 100644 --- a/Hyper-V/clusters.php +++ b/Hyper-V/clusters.php @@ -45,7 +45,7 @@
0) ? ($owner2_count / $total_vms) * 100 : 0; $vm_dist_html = "
-
$owner1_name: $owner1_count
-
$owner2_name: $owner2_count
+
$owner1_name
+
$owner2_name
"; } } diff --git a/Inventory/ClusterResource.php b/Inventory/ClusterResource.php index a63113a..2802e53 100644 --- a/Inventory/ClusterResource.php +++ b/Inventory/ClusterResource.php @@ -117,3 +117,4 @@ + \ No newline at end of file diff --git a/X/StdOut-detail.php b/X/StdOut-detail.php index a67deb9..f60d11d 100644 --- a/X/StdOut-detail.php +++ b/X/StdOut-detail.php @@ -67,7 +67,10 @@
- +
Filters :
- - name="AIX" value="1"> + name="AIX" value="1">
 
- - name="linux" value="1"> + name="linux" value="1">
  |  
- - name="DUN" value="1"> + name="DUN" value="1">
 
- - name="AZT" value="1"> + name="AZT" value="1">
 
- - name="other" value="1"> + name="other" value="1">
@@ -164,55 +190,58 @@ - - - +
+ - - - - "") { $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 { + // Si aucun résultat n'a été trouvé pour ce host $rc = $stdout = $ts = ""; } + + // Affichage du tableau HTML (inchangé) echo ""; echo ""; echo ""; @@ -231,12 +260,14 @@
$taix AIX : "; echo "$aixok $aixko $aixNO
"; echo "
$tlinux Linux : "; - echo "$linuxok $linuxko $linuxNO
"; ?> + echo "$linuxok $linuxko $linuxNO "; + ?> diff --git a/X/StdOut.php b/X/StdOut.php index 6a750a4..5afd46d 100644 --- a/X/StdOut.php +++ b/X/StdOut.php @@ -63,16 +63,29 @@
- "; - foreach($answers as $cmd){ - $ts = Invoke_infra("SELECT max(ts) as fin, min(ts) as debut FROM x_stdout where cmd = '".$cmd['cmd']."'"); - echo " "; + "; + + // Loop through the results (now very fast, no more queries inside) + if (is_array($results)) { + foreach ($results as $script) { + $scriptName = $script['cmd']; + $startTime = $script['debut']; + $endTime = $script['fin']; + + echo ""; + } } + echo "
"; ?> diff --git a/navbar.html b/navbar.html index 87b9b79..6056082 100644 --- a/navbar.html +++ b/navbar.html @@ -115,7 +115,7 @@ Clusters
Host OS TimeStamp RC StdOut
$host$os" . $ts . "