modification envoi mail

This commit is contained in:
2026-03-08 22:59:20 +01:00
parent a972af5946
commit 52f3c2ee6a
2 changed files with 64 additions and 20 deletions

View File

@@ -111,6 +111,9 @@ if [ -n "$SWAP_TOTAL" ] && [ "$SWAP_TOTAL" -gt 0 ]; then
fi
fi
add_to_report "---"
# 3. CHECK CHARGE CPU
CPU_LOAD=$(uptime | awk -F'load average:' '{ print $2 }' | cut -d',' -f1 | tr -d ' ' | tr ',' '.')
if (( $(echo "$CPU_LOAD > $LOAD_THRESHOLD" | bc -l) )); then
@@ -126,6 +129,9 @@ for SVC in "ssh" "fail2ban"; do
fi
done
add_to_report "---"
# ------------------------------------------------
# 5. NOMBRE DE PROCESSUS
# ------------------------------------------------
@@ -136,6 +142,9 @@ if [ "$PROC_COUNT" -gt "$PROC_THRESHOLD" ]; then
ALERT=true
fi
add_to_report "---"
# ------------------------------------------------
# 6. ESPACE /tmp
# ------------------------------------------------
@@ -146,6 +155,10 @@ if [ "$TMP_USAGE" -gt "$TMP_THRESHOLD" ]; then
ALERT=true
fi
add_to_report "---"
# ------------------------------------------------
# 7. PROCESSUS ZOMBIES
# ------------------------------------------------
@@ -174,6 +187,7 @@ if (( DELETED_COUNT > 0 )); then
ALERT=true
fi
add_to_report "---"
# ------------------------------------------------
@@ -186,6 +200,8 @@ if [ "$CONN_COUNT" -gt "$CONN_THRESHOLD" ]; then
ALERT=true
fi
add_to_report "---"
# ------------------------------------------------
# 10. ERREURS CRITIQUES (Dernière heure)
@@ -202,6 +218,8 @@ if (( LOG_COUNT > 0 )); then
ALERT=true
fi
add_to_report "---"
# ------------------------------------------------
# ENVOI MAIL