Objectif : inventorier une machine et exécuter des tests matériels clés en un run structuré : rapide d’abord, puis long uniquement si le test rapide passe (RAM, disques, CPU, GPU). Internet est requis uniquement pour l’installation/mise à jour ; l’exécution peut se faire en LAN.
Date : 2025-08-09
- install.sh — Installe les prérequis APT + GLPI Agent, initialise les capteurs (best‑effort).
- script.sh — Orchestrateur : saisie inventaire → fast tests → longs si PASS → envoi GLPI → exports → résumé.
- mem.sh — RAM (memtester fast/long).
- smart.sh — Stockage SMART short/long + hdparm -Tt.
- cpu.sh — CPU (stress‑ng fast/long, contrôle thermique optionnel via sensors).
- gpu.sh — GPU (glmark2 off‑screen fast/long, inventaire glxinfo/nvidia‑smi si dispo).
- utils.sh — utilitaires communs.
- main.conf — configuration centrale.
- templates/inventory.dumb — modèle JSON pour GLPI.
- CHANGELOG.md, README.md — docs.
- Debian/Ubuntu (ou dérivées) avec apt-get.
- root requis pour installer et pour les tests matériels.
- Internet requis lors du install.sh (APT + téléchargement GLPI Agent). Exécution ensuite possible sans Internet public si GLPI est en LAN.
sudo bash install.sh
- Met à jour les dépôts et installe :
curl wget perl ca-certificates lsb-release smartmontools nvme-cli hdparm dmidecode pciutils usbutils memtester nfs-common stress-ng lm-sensors mesa-utils glmark2 - Télécharge et installe GLPI Agent depuis
glpiagentinstallurl(vérifie SHA256 si fourni). - Met à jour
/etc/glpi-agent/agent.cfgavecserver/user/passwordsi définis. - Lance
sensors-detect --autobest‑effort pour activer les sondes.
bash script.sh # tests rapides puis longs conditionnels
bash script.sh --fast-only # tests rapides uniquement
bash script.sh --server=https://glpi.intra.local # override GLPI pour ce run
Orchestration :
- saisie du numéro d’inventaire (validation regex),
- création du dossier
{{logpath}}/{{INVENTAIRE}}/{{YYYYmmdd-HHMMSS}}/, - FAST : RAM (memtester), Disques (SMART short + hdparm), CPU (stress‑ng), GPU (glmark2 off‑screen),
- LONG si PASS des tests rapides correspondants,
- génération
inventory.json+ envoi GLPI (log dédié), - exports NFS/FTP (optionnels),
- résumé (
SUMMARY.txt).
glpiserver(requis) — ex :https://glpi.intra.localhttpuser,httppassword— auth basique éventuelleglpiagentinstallurl(requis) — installeur GLPI Agent (Perl “with snap”)glpiagent_sha256(optionnel) — vérification d’intégritédownloadsource(optionnel) — base pour auto‑update manuel (si vous l’ajoutez)
logpath(def./var/log/cobot)nfspath,nfsmount— export NFS optionnelftphost,ftpuser,ftppassword,ftpdirectory— export FTP optionnel
mem_fast_size_mb(def.64),mem_fast_passes(def.1)mem_long_size_mb(def. vide : auto min(512, MemAvailable/4), min 128)mem_long_passes(def.2)
smart_short_extra_s(def.30) — marge ajoutée au temps recommandésmart_long_extra_s(def.60) — marge ajoutéesmart_nvme(yes/no, def.yes)smart_sata(yes/no, def.yes)hdparm_enabled(yes/no, def.yes) — bench lecture non destructif
cpu_fast_timeout_s(def.60) — durée du stress rapidecpu_long_timeout_s(def.300) — durée du stress longcpu_temp_max_c(vide par défaut) — si défini etsensorsdispo → FAIL si température CPU > seuil
gpu_short_duration_s(def.30) — durée du test court (glmark2 --off-screen -b build)gpu_long_timeout_s(def.300) — fenêtre du test long (--run-forever, timeout considéré PASS)
inventory_regex(def.^[A-Za-z0-9._-]{{3,64}}$) — contrainte de saisie
bash mem.sh fast <run_dir>
bash mem.sh long <run_dir>
→ écrit MEM_fast.status / MEM_long.status (PASS/FAIL/SKIP) + logs.
bash smart.sh short <run_dir>
bash smart.sh long <run_dir>
→ détecte NVMe+SATA/SCSI, attend temps recommandé + marge, collecte SMART, produit statuts + hdparm (en mode short).
bash cpu.sh fast <run_dir>
bash cpu.sh long <run_dir>
→ stress-ng, sensors avant/après (si dispo), seuil cpu_temp_max_c optionnel.
bash gpu.sh fast <run_dir>
bash gpu.sh long <run_dir>
→ glmark2 off‑screen; collecte glxinfo -B/nvidia-smi -L si disponibles.
Dans {{logpath}}/{{INVENTAIRE}}/{{YYYYmmdd-HHMMSS}}/ :
inventory.json, system_info.txt, memtester_*.log, MEM_*.status, smart_*, SMART_*.status, hdparm_*.txt, cpu_*, CPU_*.status, gpu_*, GPU_*.status, glpi-agent.log, SUMMARY.txt.
Un exemple prêt à l’emploi est fourni : main.conf.example (à copier/adapter).
Remarque : si besoin, faites chmod +x *.sh après extraction.