This commit is contained in:
Gilles Soulier
2026-01-05 16:08:01 +01:00
parent dcba044cd6
commit c67befc549
2215 changed files with 26743 additions and 329 deletions

View File

@@ -762,15 +762,15 @@ run_benchmarks() {
log_warn "fio non disponible - Disk bench ignoré"
fi
# Network Benchmark vers le serveur 10.0.1.97
# Network Benchmark vers le serveur 10.0.0.50
local net_bench="null"
if command -v iperf3 &> /dev/null; then
log_info "Benchmark Réseau en cours (vers 10.0.1.97)..."
log_info "Benchmark Réseau en cours (vers 10.0.0.50)..."
# Test de connectivité d'abord
if ping -c 1 -W 2 10.0.1.97 &> /dev/null; then
if ping -c 1 -W 2 10.0.0.50 &> /dev/null; then
# Test upload (client → serveur)
local upload_result=$(iperf3 -c 10.0.1.97 -t 10 -J 2>/dev/null || echo '{}')
local upload_result=$(iperf3 -c 10.0.0.50 -t 10 -J 2>/dev/null || echo '{}')
local upload_mbps="0"
local download_mbps="0"
@@ -782,14 +782,14 @@ run_benchmarks() {
upload_mbps=$(echo "scale=2; $upload_bps / 1000000" | bc)
# Test download (serveur → client avec -R)
local download_result=$(iperf3 -c 10.0.1.97 -t 10 -R -J 2>/dev/null || echo '{}')
local download_result=$(iperf3 -c 10.0.0.50 -t 10 -R -J 2>/dev/null || echo '{}')
if [[ "$download_result" != "{}" ]]; then
local download_bps=$(echo "$download_result" | jq '.end.sum_received.bits_per_second // 0')
download_mbps=$(echo "scale=2; $download_bps / 1000000" | bc)
fi
# Mesurer le ping
local ping_output=$(ping -c 5 10.0.1.97 2>/dev/null | grep 'avg' || echo "")
local ping_output=$(ping -c 5 10.0.0.50 2>/dev/null | grep 'avg' || echo "")
if [[ -n "$ping_output" ]]; then
ping_ms=$(echo "$ping_output" | awk -F'/' '{print $5}')
fi
@@ -806,10 +806,10 @@ run_benchmarks() {
log_info "Réseau: ↑${upload_mbps}Mbps ↓${download_mbps}Mbps (ping: ${ping_ms}ms, score: ${net_score})"
else
log_warn "Serveur iperf3 sur 10.0.1.97 non accessible (assurez-vous que 'iperf3 -s' tourne)"
log_warn "Serveur iperf3 sur 10.0.0.50 non accessible (assurez-vous que 'iperf3 -s' tourne)"
fi
else
log_warn "Serveur 10.0.1.97 non joignable - Network bench ignoré"
log_warn "Serveur 10.0.0.50 non joignable - Network bench ignoré"
fi
else
log_warn "iperf3 non disponible - Network bench ignoré"