Pandora HA verified

This commit is contained in:
fbsanchez 2021-06-14 19:18:45 +02:00
parent 94cd4c96dd
commit 04a9b10904
1 changed files with 19 additions and 2 deletions

View File

@ -12,7 +12,6 @@ use Getopt::Std;
use POSIX qw(setsid strftime :sys_wait_h); use POSIX qw(setsid strftime :sys_wait_h);
use threads; use threads;
use threads::shared; use threads::shared;
use Storable;
use File::Path qw(rmtree); use File::Path qw(rmtree);
# Default lib dir for Pandora FMS RPM and DEB packages. # Default lib dir for Pandora FMS RPM and DEB packages.
@ -296,6 +295,21 @@ sub ha_main($) {
while ($Running) { while ($Running) {
eval { eval {
eval {
local $SIG{__DIE__};
# Load enterprise components.
enterprise_load($conf, 1);
# Register Enterprise logger
enterprise_hook('pandoraha_logger', [\&log_message]);
log_message($conf, 'LOG', 'Enterprise capabilities loaded');
};
if ($@) {
# No enterprise capabilities.
log_message($conf, 'LOG', 'No enterprise capabilities');
}
# Start the Pandora FMS server if needed. # Start the Pandora FMS server if needed.
log_message($conf, 'LOG', 'Checking the pandora_server service.'); log_message($conf, 'LOG', 'Checking the pandora_server service.');
@ -321,7 +335,10 @@ sub ha_main($) {
# Exit current eval. # Exit current eval.
return; return;
} }
# Synchronize database.
enterprise_hook('pandoraha_sync_node', [$conf, $dbh]);
# Monitoring. # Monitoring.
enterprise_hook('pandoraha_monitoring', [$conf, $dbh]); enterprise_hook('pandoraha_monitoring', [$conf, $dbh]);