mod +x
This commit is contained in:
0
servers/linux/monitoring/bin/alert-engine.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/alert-engine.sh
Normal file → Executable file
11
servers/linux/monitoring/bin/check_disk.sh
Normal file → Executable file
11
servers/linux/monitoring/bin/check_disk.sh
Normal file → Executable file
@@ -20,6 +20,11 @@ CRITICAL=95
|
|||||||
MOUNTS=("/" "/var" "/home")
|
MOUNTS=("/" "/var" "/home")
|
||||||
|
|
||||||
for mount in "${MOUNTS[@]}"; do
|
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}')"
|
used_pct="$(df -P "$mount" 2>/dev/null | awk 'NR==2 {gsub("%","",$5); print $5}')"
|
||||||
|
|
||||||
if [[ ! "$used_pct" =~ ^[0-9]+$ ]]; then
|
if [[ ! "$used_pct" =~ ^[0-9]+$ ]]; then
|
||||||
@@ -31,15 +36,15 @@ for mount in "${MOUNTS[@]}"; do
|
|||||||
|
|
||||||
case "$level" in
|
case "$level" in
|
||||||
INFO)
|
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"
|
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$CRITICAL"
|
||||||
;;
|
;;
|
||||||
WARNING)
|
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"
|
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$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"
|
"mount=$mount" "used_pct=$used_pct" "warning=$WARNING" "critical=$CRITICAL"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
0
servers/linux/monitoring/bin/install-monitoring.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/install-monitoring.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/monitoring-update.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/monitoring-update.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/monitoring.sh
Normal file → Executable file
0
servers/linux/monitoring/bin/monitoring.sh
Normal file → Executable file
@@ -24,9 +24,9 @@ ALERT_MAIL_BIN="/usr/sbin/sendmail"
|
|||||||
ALERT_MAIL_SUBJECT_PREFIX="[monitoring]"
|
ALERT_MAIL_SUBJECT_PREFIX="[monitoring]"
|
||||||
|
|
||||||
# ntfy
|
# ntfy
|
||||||
NTFY_SERVER="https://ntfy.a5l.fr"
|
NTFY_SERVER="https://ntfy.sh"
|
||||||
NTFY_TOPIC="TPOSOB84sBJ6HTZ7"
|
NTFY_TOPIC="TPOSOB84sBJ6HTZ7"
|
||||||
NTFY_TOKEN="VOTRE_TOKEN_ICI"
|
NTFY_TOKEN=""
|
||||||
|
|
||||||
# Déduplication en secondes
|
# Déduplication en secondes
|
||||||
ALERT_DEDUP_WINDOW=3600
|
ALERT_DEDUP_WINDOW=3600
|
||||||
|
|||||||
@@ -22,12 +22,12 @@ HOSTNAME_FQDN="$(hostname -f 2>/dev/null || hostname)"
|
|||||||
|
|
||||||
DEST="root"
|
DEST="root"
|
||||||
|
|
||||||
NTFY_SERVER=""
|
NTFY_SERVER="nfy.sh"
|
||||||
NTFY_TOPIC=""
|
NTFY_TOPIC="TPOSOB84sBJ6HTZ7"
|
||||||
NTFY_TOKEN=""
|
NTFY_TOKEN=""
|
||||||
|
|
||||||
UPDATE_ENABLED="true"
|
UPDATE_ENABLED="true"
|
||||||
UPDATE_BASE_URL="https://git.abonnel.fr/cedricAbonnel/scripts-bash/raw/branch/main/servers/linux"
|
UPDATE_BASE_URL="https://git.abonnel.fr/cedricAbonnel/scripts-bash/raw/branch/main/servers/linux/monitoring"
|
||||||
UPDATE_MANIFEST_URL="${UPDATE_BASE_URL}/manifest.txt"
|
UPDATE_MANIFEST_URL="${UPDATE_BASE_URL}/manifest.txt"
|
||||||
UPDATE_TIMEOUT_CONNECT=3
|
UPDATE_TIMEOUT_CONNECT=3
|
||||||
UPDATE_TIMEOUT_TOTAL=15
|
UPDATE_TIMEOUT_TOTAL=15
|
||||||
|
|||||||
Reference in New Issue
Block a user