simplificaiton config
This commit is contained in:
65
servers/linux/monitoring/old-bin/alert-engine.conf
Normal file
65
servers/linux/monitoring/old-bin/alert-engine.conf
Normal file
@@ -0,0 +1,65 @@
|
||||
#!/bin/bash
|
||||
# Copyright (C) 2026 Cédric Abonnel
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
|
||||
# Fichiers d'état
|
||||
ALERT_STATE_FILE="${MONITORING_STATE_DIR}/alert-engine.offset"
|
||||
ALERT_DEDUP_FILE="${MONITORING_STATE_DIR}/alert-engine.dedup"
|
||||
|
||||
# Activation des canaux
|
||||
ALERT_NTFY_ENABLED="true"
|
||||
ALERT_MAIL_ENABLED="true"
|
||||
|
||||
# Mail
|
||||
ALERT_MAIL_BIN="/usr/sbin/sendmail"
|
||||
ALERT_MAIL_SUBJECT_PREFIX="[monitoring]"
|
||||
|
||||
# ntfy
|
||||
NTFY_SERVER="https://ntfy.sh"
|
||||
NTFY_TOPIC="TPOSOB84sBJ6HTZ7"
|
||||
NTFY_TOKEN=""
|
||||
|
||||
# Déduplication en secondes
|
||||
ALERT_DEDUP_WINDOW=3600
|
||||
|
||||
# Événements à ignorer
|
||||
ALERT_IGNORE_EVENTS="update_not_needed alert_sent_ntfy alert_sent_mail"
|
||||
|
||||
# Règles par défaut selon le niveau
|
||||
ALERT_DEFAULT_CHANNELS_WARNING="ntfy"
|
||||
ALERT_DEFAULT_CHANNELS_ERROR="ntfy,mail"
|
||||
ALERT_DEFAULT_CHANNELS_CRITICAL="ntfy,mail"
|
||||
|
||||
# Règles spécifiques par événement
|
||||
ALERT_RULE_disk_usage_high="ntfy"
|
||||
ALERT_RULE_disk_usage_critical="ntfy,mail"
|
||||
ALERT_RULE_check_failed="ntfy,mail"
|
||||
ALERT_RULE_internal_error="ntfy,mail"
|
||||
|
||||
ALERT_RULE_update_hash_unavailable="ntfy"
|
||||
ALERT_RULE_update_download_failed="ntfy,mail"
|
||||
ALERT_RULE_update_hash_mismatch="ntfy,mail"
|
||||
ALERT_RULE_manifest_download_failed="ntfy,mail"
|
||||
ALERT_RULE_manifest_invalid="ntfy,mail"
|
||||
ALERT_RULE_update_finished_with_errors="ntfy,mail"
|
||||
|
||||
# Optionnel : certains événements peuvent être forcés en ntfy uniquement
|
||||
# ALERT_RULE_disk_ok=""
|
||||
# ALERT_RULE_update_finished=""
|
||||
|
||||
# Optionnel : URL ouverte quand on clique sur la notif ntfy
|
||||
NTFY_CLICK_URL=""
|
||||
|
||||
# Optionnel : tags par niveau pour ntfy
|
||||
NTFY_TAGS_WARNING="warning"
|
||||
NTFY_TAGS_ERROR="warning,rotating_light"
|
||||
NTFY_TAGS_CRITICAL="skull,warning"
|
||||
27
servers/linux/monitoring/old-bin/monitoring.conf
Normal file
27
servers/linux/monitoring/old-bin/monitoring.conf
Normal file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# Configuration globale par défaut - NE PAS ÉDITER (Utilisez .local.conf)
|
||||
|
||||
MONITORING_BASE="/opt/monitoring"
|
||||
MONITORING_LOG_DIR="/var/log/monitoring"
|
||||
MONITORING_STATE_DIR="/var/lib/monitoring"
|
||||
MONITORING_LOCK_DIR="/var/lock/monitoring"
|
||||
|
||||
LOG_FILE="${MONITORING_LOG_DIR}/events.jsonl"
|
||||
|
||||
HOSTNAME_FQDN="$(hostname -f 2>/dev/null || hostname)"
|
||||
|
||||
DEST="root"
|
||||
|
||||
NTFY_SERVER="nfy.sh"
|
||||
NTFY_TOPIC="TPOSOB84sBJ6HTZ7"
|
||||
NTFY_TOKEN=""
|
||||
|
||||
UPDATE_ENABLED="true"
|
||||
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_TIMEOUT_CONNECT=3
|
||||
UPDATE_TIMEOUT_TOTAL=15
|
||||
UPDATE_TMP_DIR="/tmp/monitoring-update"
|
||||
UPDATE_ALLOW_DELETE="false"
|
||||
|
||||
mkdir -p "$MONITORING_LOG_DIR" "$MONITORING_STATE_DIR" "$MONITORING_LOCK_DIR" 2>/dev/null || true
|
||||
Reference in New Issue
Block a user