#!/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"