From 4abf19722bf1bf3fac32c0699775614b0e08c072 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Fri, 22 Feb 2019 18:12:01 +0100 Subject: [PATCH] Minor fixes and improvements. Discovery Former-commit-id: d4410ddca6aec18ed28b7b0236ee16a3e8a6d2b8 --- .../include/class/ConsoleSupervisor.php | 43 +++++++++++++++++++ pandora_console/include/functions_config.php | 2 +- pandora_server/lib/PandoraFMS/DB.pm | 2 + 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index c0a91480cc..ddce4b7e87 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -141,6 +141,48 @@ class ConsoleSupervisor } + /** + * Manage scheduled tasks (basic). + * + * @return void + */ + public function runBasic() + { + global $config; + + /* + * Check license. + * NOTIF.LICENSE.EXPIRATION + */ + + $this->checkLicense(); + + /* + * Check component statuses (servers down - frozen). + * NOTIF.SERVER.STATUS.ID_SERVER + */ + + $this->checkPandoraServers(); + + /* + * Check at least 1 server running in master mode. + * NOTIF.SERVER.MASTER + */ + + $this->checkPandoraServerMasterAvailable(); + + /* + * Check if CRON is running. + * NOTIF.CRON.CONFIGURED + */ + + if (enterprise_installed()) { + $this->checkCronRunning(); + } + + } + + /** * Manage scheduled tasks. * @@ -344,6 +386,7 @@ class ConsoleSupervisor * Check if CRON is running. * NOTIF.CRON.CONFIGURED */ + if (enterprise_installed()) { $this->checkCronRunning(); } diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index 2a301affd9..475ef2db79 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -2680,7 +2680,7 @@ function config_check() || (get_system_time() - $config['cron_last_run']) > 3600 ) { $supervisor = new ConsoleSupervisor(false); - $supervisor->checkCronRunning(); + $supervisor->runBasic(); } } diff --git a/pandora_server/lib/PandoraFMS/DB.pm b/pandora_server/lib/PandoraFMS/DB.pm index 20bece94e6..a257d5df07 100644 --- a/pandora_server/lib/PandoraFMS/DB.pm +++ b/pandora_server/lib/PandoraFMS/DB.pm @@ -20,6 +20,8 @@ package PandoraFMS::DB; use strict; use warnings; use DBI; + +use lib '/usr/lib/perl5'; use PandoraFMS::Tools; #use Data::Dumper;