This commit is contained in:
2026-03-16 14:02:00 +01:00
parent 8a84be4f5a
commit 0ee29bf356
7 changed files with 13 additions and 8 deletions

0
servers/linux/monitoring/bin/alert-engine.sh Normal file → Executable file
View File

11
servers/linux/monitoring/bin/check_disk.sh Normal file → Executable file
View File

@@ -20,6 +20,11 @@ CRITICAL=95
MOUNTS=("/" "/var" "/home")
for mount in "${MOUNTS[@]}"; do
# On vérifie si le point de montage existe avant de tester
if ! mountpoint -q "$mount"; then
continue
fi
used_pct="$(df -P "$mount" 2>/dev/null | awk 'NR==2 {gsub("%","",$5); print $5}')"
if [[ ! "$used_pct" =~ ^[0-9]+$ ]]; then
@@ -31,15 +36,15 @@ for mount in "${MOUNTS[@]}"; do
case "$level" in
INFO)
log_info "disk_ok" "Utilisation disque normale" \
log_info "disk_ok" "Utilisation disque normale" \
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$CRITICAL"
;;
WARNING)
log_warning "disk_usage_high" "Utilisation disque élevée" \
log_warning "disk_usage_high" "Utilisation disque élevée" \
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$CRITICAL"
;;
CRITICAL)
log_critical "disk_usage_critical" "Utilisation disque critique" \
log_critical "disk_usage_critical" "Utilisation disque critique" \
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$CRITICAL"
;;
esac

0
servers/linux/monitoring/bin/install-monitoring.sh Normal file → Executable file
View File

0
servers/linux/monitoring/bin/monitoring-update.sh Normal file → Executable file
View File

0
servers/linux/monitoring/bin/monitoring.sh Normal file → Executable file
View File