You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.8 KiB

  1. <?php
  2. $now = new \DateTimeImmutable('now');
  3. $formatter = new \IntlDateFormatter('fr_FR.UTF8', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Paris');
  4. ?><!DOCTYPE html>
  5. <html lang="fr">
  6. <head>
  7. <meta charset="utf-8" />
  8. <meta name="viewport" content="width=device-width, initial-scale=1" />
  9. <title>Monitoring</title>
  10. <style type="text/css" media="screen">img { width: 100%; height: auto; }</style>
  11. </head>
  12. <body>
  13. <h1 id="top">
  14. Monitoring
  15. <small><?php echo $formatter->format($now); ?></small>
  16. </h1>
  17. <nav>
  18. <a href="#cpu">Processeur</a>
  19. <a href="#mem">Mémoire</a>
  20. <a href="#net">Réseau</a>
  21. <a href="#disk">Disque</a>
  22. </nav>
  23. <h2 id="cpu">Processeur</h2>
  24. <details>
  25. <summary>Détails</summary>
  26. <pre><?php $output = ''; exec('cat /proc/cpuinfo', $output); echo implode(PHP_EOL, $output); ?></pre>
  27. </details>
  28. <p>
  29. <img src="cpu-daily.svg" />
  30. </p>
  31. <p>
  32. <img src="load-daily.svg" />
  33. </p>
  34. <h2 id="mem">Mémoire</h2>
  35. <details>
  36. <summary>Détails</summary>
  37. <pre><?php $output = ''; exec('cat /proc/meminfo', $output); echo implode(PHP_EOL, $output); ?></pre>
  38. </details><p>
  39. <img src="mem-daily.svg" />
  40. </p>
  41. <h2 id="net">Réseau</h2>
  42. <details>
  43. <summary>Détails</summary>
  44. <pre><?php $output = ''; exec('cat /proc/net/dev', $output); echo implode(PHP_EOL, $output); ?></pre>
  45. </details><p>
  46. <img src="net-daily.svg" />
  47. <img src="net-weekly.svg" />
  48. <img src="net-monthly.svg" />
  49. </p>
  50. <h2 id="disk">Disque</h2>
  51. <details>
  52. <summary>Détails</summary>
  53. <pre><?php $output = ''; exec('df -hlT -x tmpfs -x devtmpfs --total 2>/dev/null', $output); echo implode(PHP_EOL, $output); ?></pre>
  54. </details>
  55. <p>
  56. <img src="disk-daily.svg" />
  57. <img src="disk-weekly.svg" />
  58. <img src="disk-monthly.svg" />
  59. </p>
  60. </body>
  61. </html>