37 lines
1.2 KiB
Bash
37 lines
1.2 KiB
Bash
#!/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.
|
|
|
|
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=""
|
|
NTFY_TOPIC=""
|
|
NTFY_TOKEN=""
|
|
|
|
UPDATE_ENABLED="true"
|
|
UPDATE_BASE_URL="https://git.abonnel.fr/cedricAbonnel/scripts-bash/raw/branch/main/servers/linux"
|
|
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 |