c390addadb
- template machine-metrics (loadavg/nproc, /proc/meminfo, df -B1) non destructif - parseMetrics (TDD) → cpu load/cores, mémoire kB→B + %, filesystems, warnings >=90% - collectMetrics (SSH léger) persiste machine_metrics_latest ; getLatestMetrics (sans SSH) - routes GET /machines/:id/metrics + POST /metrics/collect ; api latestMetrics/collectMetrics - section Hardware : bloc métriques live (CPU/RAM/disques + alertes) + bouton Collecter → comble le gap « Health » de la tâche 3 tsc 0 · 108 tests · build OK. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
13 lines
448 B
Smarty
13 lines
448 B
Smarty
#!/bin/sh
|
|
# Métriques légères CPU/RAM/disque. Non destructif, rapide, sans installation.
|
|
export LC_ALL=C
|
|
echo "===SU:METRICS_CPU==="
|
|
cat /proc/loadavg 2>/dev/null
|
|
nproc 2>/dev/null
|
|
echo "===SU:METRICS_MEM==="
|
|
grep -E '^(MemTotal|MemAvailable):' /proc/meminfo 2>/dev/null
|
|
echo "===SU:METRICS_FS==="
|
|
df -B1 -T -x tmpfs -x devtmpfs -x overlay -x squashfs 2>/dev/null \
|
|
| awk 'NR>1 {print "FS\t"$7"\t"$2"\t"$3"\t"$4"\t"$6}'
|
|
echo "===SU:EXIT=0==="
|