Browse Source

ajounte un peu de détails

master
vince vince 3 years ago
parent
commit
6751e46ee2
2 changed files with 61 additions and 1 deletions
  1. +4
    -1
      Makefile
  2. +57
    -0
      index.php

+ 4
- 1
Makefile View File

@ -165,4 +165,7 @@ $(BUILD_DIR)/disk-daily$(EXTENSION): disk.rrd
AREA:MBfsused#$(DANGER):MBfsused:STACK \
AREA:MBfsfree#$(SUCCESS):MBfsfree:STACK
graph: $(BUILD_DIR)/cpu-daily$(EXTENSION) $(BUILD_DIR)/load-daily$(EXTENSION) $(BUILD_DIR)/mem-daily$(EXTENSION) $(BUILD_DIR)/net-daily$(EXTENSION) $(BUILD_DIR)/disk-daily$(EXTENSION)
$(BUILD_DIR)/%.html: %.php
php $< >$@
graph: $(BUILD_DIR)/cpu-daily$(EXTENSION) $(BUILD_DIR)/load-daily$(EXTENSION) $(BUILD_DIR)/mem-daily$(EXTENSION) $(BUILD_DIR)/net-daily$(EXTENSION) $(BUILD_DIR)/disk-daily$(EXTENSION) $(BUILD_DIR)/index.html

+ 57
- 0
index.php View File

@ -0,0 +1,57 @@
<?php
$now = new \DateTimeImmutable('now');
$formatter = new \IntlDateFormatter('fr_FR.UTF8', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Paris');
?><!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Monitoring</title>
</head>
<body>
<h1>
Monitoring
<small><?php echo $formatter->format($now); ?></small>
</h1>
<h2>Processeur</h2>
<details>
<summary>Détails</summary>
<pre><?php $output = ''; exec('cat /proc/cpuinfo', $output); echo implode(PHP_EOL, $output); ?></pre>
</details>
<p>
<img src="cpu-daily.svg" />
</p>
<p>
<img src="load-daily.svg" />
</p>
<h2>Mémoire</h2>
<details>
<summary>Détails</summary>
<pre><?php $output = ''; exec('cat /proc/meminfo', $output); echo implode(PHP_EOL, $output); ?></pre>
</details><p>
<img src="mem-daily.svg" />
</p>
<h2>Réseau</h2>
<details>
<summary>Détails</summary>
<pre><?php $output = ''; exec('cat /proc/net/dev', $output); echo implode(PHP_EOL, $output); ?></pre>
</details><p>
<img src="net-daily.svg" />
</p>
<h2>Disque</h2>
<details>
<summary>Détails</summary>
<pre><?php $output = ''; exec('df -hlT -x tmpfs -x devtmpfs --total 2>/dev/null', $output); echo implode(PHP_EOL, $output); ?></pre>
</details><p>
<img src="disk-daily.svg" />
</p>
</body>
</html>

Loading…
Cancel
Save