rep.php 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <?php
  2. $getcltqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND section = 'Server'");
  3. while($row = mysqli_fetch_array($getcltqry)){
  4. $servername = $row['data1'];
  5. $repdate = $row['data2'];
  6. }
  7. ?>
  8. <div class="repcollumn">
  9. <a class="reptitle"><?php echo $servername; ?> <?php echo $repdate; ?></a>
  10. <a class="reptitle2">Performance</a>
  11. <table class="reptable">
  12. <tr>
  13. <th>CPU / Utilisation</th>
  14. <th>RAM / Utilisation</th>
  15. <th>Disques / Espace Disponible</th>
  16. </tr>
  17. <?php
  18. $getappqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'SystemInfo'");
  19. while($row = mysqli_fetch_array($getappqry)){
  20. echo "
  21. <tr>
  22. <th>".$row['data2']."</th>
  23. <th>".$row['data3']."</th>
  24. <th>".$row['data4']."</th>
  25. </tr>
  26. ";
  27. }
  28. ?>
  29. <a class="reptitle2">Applications</a>
  30. <table class="reptable">
  31. <tr>
  32. <th>Nom</th>
  33. <th>Emplacement</th>
  34. <th>Désinstallé</th>
  35. </tr>
  36. <?php
  37. $getappqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'Apps'");
  38. while($row = mysqli_fetch_array($getappqry)){
  39. echo "
  40. <tr>
  41. <th>".$row['data1']."</th>
  42. <th>".$row['data2']."</th>
  43. <th>".$row['data3']."</th>
  44. </tr>
  45. ";
  46. }
  47. ?>
  48. </table>
  49. <a class="reptitle2">Event Log</a>
  50. <table class="reptable">
  51. <tr>
  52. <th>Log</th>
  53. <th>Sévérité</th>
  54. <th>Source</th>
  55. <th>Dernière Occurence</th>
  56. <th>EventID</th>
  57. <th>Occurence</th>
  58. </tr>
  59. <?php
  60. $getevntqry = mysqli_query($link, "SELECT *,COUNT(*) from entries where repportid = $rep AND servername = '$servername' AND section = 'eventvwr' GROUP BY data2");
  61. while($row = mysqli_fetch_array($getevntqry)){
  62. $style = "";
  63. $style2 = "";
  64. if($row['COUNT(*)'] > 50 && $row['COUNT(*)'] < 150){
  65. $style = "style='background-color:yellow;'";
  66. }elseif($row['COUNT(*)'] > 149 && $row['COUNT(*)'] < 500){
  67. $style = "style='background-color:red;'";
  68. }elseif($row['COUNT(*)'] > 499){
  69. $style = "style='background-color:darkred;'";
  70. $style2 = "style='background-color:darkred;'";
  71. }elseif($row['COUNT(*)'] < 5){
  72. continue;
  73. }
  74. echo "
  75. <tr>
  76. <th $style2>".$row['data3']."</th>
  77. <th $style2>".$row['data4']."</th>
  78. <th $style2 class='tooltip'>".$row['data2']."
  79. <span class='tooltiptext'>".$row['data6']."</span>
  80. </th>
  81. <th $style2>".$row['data5']."</th>
  82. <th $style2>".$row['data1']."</th>
  83. <th $style>".$row['COUNT(*)']."</th>
  84. </tr>
  85. ";
  86. }
  87. ?>
  88. </table>
  89. </table>
  90. <a class="reptitle2">Certificats</a>
  91. <table class="reptable">
  92. <tr>
  93. <th>Nom Commun</th>
  94. <th>Expiration</th>
  95. <th>Thmubprint</th>
  96. </tr>
  97. <?php
  98. $getevntqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'Certificates'");
  99. while($row = mysqli_fetch_array($getevntqry)){
  100. echo "
  101. <tr>
  102. <th>".$row['data1']."</th>
  103. <th>".$row['data2']."</th>
  104. <th>".$row['data3']."</th>
  105. </tr>
  106. ";
  107. }
  108. echo "</table>";
  109. $getveeamqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'Veeam'");
  110. if (mysqli_num_rows($getveeamqry) > 0){
  111. echo "<a class='reptitle2'>État Veeam</a>
  112. <table class='reptable'>
  113. <tr>
  114. <th>Nom de la tâche</th>
  115. <th>Erreurs dans le dernier mois</th>
  116. <th>Avertissements dans le dernier mois</th>
  117. <th>Dernière exécution</th>
  118. <th>Type de repo</th>
  119. <th>Dernier résultat</th>
  120. </tr>";
  121. while($row = mysqli_fetch_array($getveeamqry)){
  122. echo "
  123. <tr>
  124. <th>".$row['data1']."</th>
  125. <th>".$row['data2']."</th>
  126. <th>".$row['data3']."</th>
  127. <th>".$row['data4']."</th>
  128. <th>".$row['data5']."</th>
  129. <th>".$row['data6']."</th>
  130. </tr>
  131. ";
  132. }
  133. echo "</table>";
  134. }
  135. $getveeamqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'VMwareHosts'");
  136. if (mysqli_num_rows($getveeamqry) > 0){
  137. echo "<a class='reptitle2'>Hôtes VMware</a>
  138. <table class='reptable'>
  139. <tr>
  140. <th>Nom d'hôte</th>
  141. <th>Utilisation du CPU</th>
  142. <th>Utilisation de la RAM</th>
  143. <th>Version</th>
  144. </tr>";
  145. while($row = mysqli_fetch_array($getveeamqry)){
  146. echo "
  147. <tr>
  148. <th>".$row['data1']."</th>
  149. <th>".$row['data2']."</th>
  150. <th>".$row['data3']."</th>
  151. <th>".$row['data4']."</th>
  152. </tr>
  153. ";
  154. }
  155. echo "</table>";
  156. }
  157. $getveeamqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'VMwareVMs'");
  158. if (mysqli_num_rows($getveeamqry) > 0){
  159. echo "<a class='reptitle2'>VM sans démarrage automatique</a>
  160. <table class='reptable'>
  161. <tr>
  162. <th>Nom</th>
  163. <th>Démarrage</th>
  164. </tr>";
  165. while($row = mysqli_fetch_array($getveeamqry)){
  166. echo "
  167. <tr>
  168. <th>".$row['data1']."</th>
  169. <th>".$row['data2']."</th>
  170. </tr>
  171. ";
  172. }
  173. echo "</table>";
  174. }
  175. $getveeamqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'VMwareDatastores'");
  176. if (mysqli_num_rows($getveeamqry) > 0){
  177. echo "<a class='reptitle2'>Datastores VMware</a>
  178. <table class='reptable'>
  179. <tr>
  180. <th>Nom</th>
  181. <th>Espace libre</th>
  182. <th>Espace total</th>
  183. </tr>";
  184. while($row = mysqli_fetch_array($getveeamqry)){
  185. echo "
  186. <tr>
  187. <th>".$row['data1']."</th>
  188. <th>".$row['data2']."</th>
  189. <th>".$row['data3']."</th>
  190. </tr>
  191. ";
  192. }
  193. echo "</table>";
  194. }
  195. $getveeamqry = mysqli_query($link, "SELECT * from entries where repportid = $rep AND servername = '$servername' AND section = 'VMwareAlerts'");
  196. if (mysqli_num_rows($getveeamqry) > 0){
  197. echo "<a class='reptitle2'>Alertes VMware</a>
  198. <table class='reptable'>
  199. <tr>
  200. <th>Titre</th>
  201. <th>Description</th>
  202. <th>Temps</th>
  203. </tr>";
  204. while($row = mysqli_fetch_array($getveeamqry)){
  205. echo "
  206. <tr>
  207. <th>".$row['data1']."</th>
  208. <th>".$row['data2']."</th>
  209. <th>".$row['data3']."</th>
  210. </tr>
  211. ";
  212. }
  213. echo "</table>";
  214. }
  215. ?>
  216. </table>
  217. </div>