ecriture en PHP
This commit is contained in:
54
servers/linux/monitoring/conf/monitoring.conf.php
Normal file
54
servers/linux/monitoring/conf/monitoring.conf.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
/**
|
||||
* Configuration globale par défaut
|
||||
* Copyright (C) 2026 Cédric Abonnel
|
||||
* License: GNU Affero General Public License v3
|
||||
* NE PAS ÉDITER - Utilisez monitoring.local.conf.php pour vos surcharges
|
||||
* RISQUE D'ECRASEMENT - RISQUE D'EFFACEMENT
|
||||
*/
|
||||
|
||||
// Détection dynamique du hostname (équivalent de $(hostname -f))
|
||||
$hostname_fqdn = getenv('HOSTNAME_FQDN') ?: (gethostname() ?: 'localhost');
|
||||
|
||||
// On définit les répertoires de base
|
||||
$monitoring_base = '/opt/monitoring';
|
||||
$monitoring_log_dir = '/var/log/monitoring';
|
||||
$monitoring_state_dir = '/var/lib/monitoring';
|
||||
$monitoring_lock_dir = '/var/lock/monitoring';
|
||||
|
||||
// Initialisation automatique des répertoires (équivalent du mkdir -p à la fin du bash)
|
||||
foreach ([$monitoring_log_dir, $monitoring_state_dir, $monitoring_lock_dir] as $dir) {
|
||||
if (!is_dir($dir)) {
|
||||
@mkdir($dir, 0755, true);
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
// --- Chemins ---
|
||||
'MONITORING_BASE' => $monitoring_base,
|
||||
'MONITORING_LOG_DIR' => $monitoring_log_dir,
|
||||
'MONITORING_STATE_DIR' => $monitoring_state_dir,
|
||||
'MONITORING_LOCK_DIR' => $monitoring_lock_dir,
|
||||
'LOG_FILE' => $monitoring_log_dir . '/events.jsonl',
|
||||
|
||||
// --- Identification ---
|
||||
'HOSTNAME_FQDN' => $hostname_fqdn,
|
||||
'DEST' => 'root',
|
||||
|
||||
// --- ntfy ---
|
||||
'NTFY_SERVER' => 'https://ntfy.sh', // Correction du nfy.sh en ntfy.sh
|
||||
'NTFY_TOPIC' => 'TPOSOB84sBJ6HTZ7',
|
||||
'NTFY_TOKEN' => '',
|
||||
|
||||
// --- Mises à jour (Update) ---
|
||||
'UPDATE_ENABLED' => true,
|
||||
'UPDATE_BASE_URL' => 'https://git.abonnel.fr/cedricAbonnel/scripts-bash/raw/branch/main/servers/linux/monitoring',
|
||||
'UPDATE_MANIFEST_URL' => 'https://git.abonnel.fr/cedricAbonnel/scripts-bash/raw/branch/main/servers/linux/monitoring/manifest.txt',
|
||||
'UPDATE_TIMEOUT_CONNECT' => 3,
|
||||
'UPDATE_TIMEOUT_TOTAL' => 15,
|
||||
'UPDATE_TMP_DIR' => '/tmp/monitoring-update',
|
||||
'UPDATE_ALLOW_DELETE' => false,
|
||||
|
||||
// --- Logs ---
|
||||
'LOG_LEVEL' => 'INFO', // DEBUG, INFO, NOTICE, WARNING, ERROR, CRITICAL
|
||||
];
|
||||
Reference in New Issue
Block a user