diff --git a/pandora_console/extras/delete_files/delete_files.txt b/pandora_console/extras/delete_files/delete_files.txt index 379ab17621..91943a5994 100644 --- a/pandora_console/extras/delete_files/delete_files.txt +++ b/pandora_console/extras/delete_files/delete_files.txt @@ -1747,3 +1747,5 @@ enterprise/include/class/MySQL.app.php enterprise/include/class/Oracle.app.php enterprise/include/class/SAP.app.php enterprise/include/class/VMware.app.php +enterprise/include/class/DatabaseHA.class.php +enterprise/godmode/servers/HA_cluster.php diff --git a/pandora_console/extras/mr/69.sql b/pandora_console/extras/mr/69.sql index 11562f9ded..19dfe33d6d 100644 --- a/pandora_console/extras/mr/69.sql +++ b/pandora_console/extras/mr/69.sql @@ -7706,5 +7706,6 @@ UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id=en/documentation/02_installation/05_configuration_agents#conf' WHERE title = 'Automatic agent provision system'; UPDATE `twelcome_tip` SET url = 'https://pandorafms.com/manual/!current/start?id=en/documentation/04_using/05_data_presentation_visual_maps' WHERE title = 'Using custom icons in visual consoles'; +DELETE FROM tconfig WHERE `token` = 'legacy_database_ha'; COMMIT; \ No newline at end of file diff --git a/pandora_console/godmode/servers/servers.build_table.php b/pandora_console/godmode/servers/servers.build_table.php index beebb0286e..7a651a7a43 100644 --- a/pandora_console/godmode/servers/servers.build_table.php +++ b/pandora_console/godmode/servers/servers.build_table.php @@ -133,14 +133,12 @@ foreach ($servers as $server) { __('Server has crashed.'), true ); - - } else if ((int) ($server['disabled'] == 1)){ + } else if ((int) ($server['disabled'] == 1)) { $data[1] = ui_print_status_image( STATUS_SERVER_STANDBY, __('Server was manually disabled.'), true ); - } else if ((int) ($server['status'] === 0) || (($date - $server_keepalive) > ($server['server_keepalive']) * 2) ) { diff --git a/pandora_console/include/class/ConsoleSupervisor.php b/pandora_console/include/class/ConsoleSupervisor.php index 9e9a1246b7..24af0a860c 100644 --- a/pandora_console/include/class/ConsoleSupervisor.php +++ b/pandora_console/include/class/ConsoleSupervisor.php @@ -3015,7 +3015,7 @@ class ConsoleSupervisor public function checkHaStatus() { global $config; - enterprise_include_once('include/class/DatabaseHA.class.php'); + enterprise_include_once('include/class/NewDatabaseHA.class.php'); $cluster = new DatabaseHA(); $nodes = $cluster->getNodes(); @@ -3038,7 +3038,7 @@ class ConsoleSupervisor 'type' => 'NOTIF.HAMASTER.MESSAGE', 'title' => __('Desynchronized operation on the node '.$node['host']), 'message' => __($message), - 'url' => '__url__/index.php?sec=gservers&sec2=enterprise/godmode/servers/HA_cluster', + 'url' => '__url__/index.php?sec=gservers&sec2=enterprise/godmode/servers/new_HA_cluster', 'icon_notification' => self::ICON_ERROR, ] ); diff --git a/pandora_console/include/functions_config.php b/pandora_console/include/functions_config.php index ecfc06c1d1..416ad69e8b 100644 --- a/pandora_console/include/functions_config.php +++ b/pandora_console/include/functions_config.php @@ -505,10 +505,6 @@ function config_update_config() $error_update[] = __('Enable Update Manager'); } - if (config_update_value('legacy_database_ha', get_parameter('legacy_database_ha'), true) === false) { - $error_update[] = __('Legacy database HA'); - } - if (config_update_value('agent_vulnerabilities', get_parameter('agent_vulnerabilities'), true) === false) { $error_update[] = __('agent_vulnerabilities'); } @@ -2430,10 +2426,6 @@ function config_process_config() config_update_value('enable_update_manager', 1); } - if (!isset($config['legacy_database_ha'])) { - config_update_value('legacy_database_ha', 0); - } - if (!isset($config['disabled_newsletter'])) { config_update_value('disabled_newsletter', 0); } diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index 48c6c6288d..8dcb2ee0f4 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -714,9 +714,6 @@ ncm_ssh_utility /usr/share/pandora_server/util/ncm_ssh_extension # Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY). ha_interval 30 -# HA operation mode. For backward compatibility with pacemaker. Do not change this value (PANDORA FMS ENTERPRISE ONLY). -ha_mode pandora - # Comma separated list of HA host IPs or FQDNs (PANDORA FMS ENTERPRISE ONLY). #ha_hosts 172.16.0.8,172.168.0.16 diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 152a2d405a..8bd211a529 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -566,7 +566,6 @@ sub pandora_load_config { $pa_config->{"netflowserver"} = 0; # 7.0.770 $pa_config->{"netflowserver_threads"} = 1; # 7.0.770 - $pa_config->{"ha_mode"} = "pacemaker"; # 7.0.770 $pa_config->{"ha_file"} = undef; # 7.0.770 $pa_config->{"ha_hosts_file"} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'; # 7.0.770 $pa_config->{"ha_connect_retries"} = 2; # 7.0.770 @@ -1338,11 +1337,6 @@ sub pandora_load_config { elsif ($parametro =~ m/^ncm_ssh_utility\s+(.*)/i) { $pa_config->{'ncm_ssh_utility'}= clean_blank($1); } - - # Pandora HA extra - elsif ($parametro =~ m/^ha_mode\s(.*)/i) { - $pa_config->{'ha_mode'} = clean_blank($1); - } elsif ($parametro =~ m/^ha_file\s(.*)/i) { $pa_config->{'ha_file'} = clean_blank($1); } diff --git a/pandora_server/util/pandora_ha.pl b/pandora_server/util/pandora_ha.pl index 28ae0df795..57b2de44b5 100755 --- a/pandora_server/util/pandora_ha.pl +++ b/pandora_server/util/pandora_ha.pl @@ -539,89 +539,6 @@ sub ha_restart_pandora($) { `$config->{'pandora_service_cmd'} $control_command 2>/dev/null`; } -############################################################################### -# Main (Pacemaker) -############################################################################### -sub ha_main_pacemaker($) { - my ($conf) = @_; - - # Set the PID file. - $conf->{'PID'} = $PID_FILE; - - # Log to a separate file if needed. - $conf->{'log_file'} = $conf->{'ha_log_file'} if defined ($conf->{'ha_log_file'}); - - $Running = 1; - - ha_daemonize($conf) if ($DAEMON == 1); - - while ($Running) { - 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. - log_message($conf, 'LOG', 'Checking the pandora_server service.'); - - # Connect to a DB. - my $dbh = ha_database_connect($conf); - - if ($First_Cleanup == 1) { - log_message($conf, 'LOG', 'Cleaning previous unfinished actions'); - enterprise_hook('pandoraha_cleanup_states', [$conf, $dbh]); - $First_Cleanup = 0; - } - - # Check if there are updates pending. - ha_update_server($conf, $dbh); - - # Keep pandora running - ha_keep_pandora_running($conf, $dbh); - - # Keep Tentacle running - ha_keep_tentacle_running($conf, $dbh); - - # Keep MADE running - ha_keep_made_running($conf, $dbh); - - # Are we the master? - pandora_set_master($conf, $dbh); - if (!pandora_is_master($conf)) { - log_message($conf, 'LOG', $conf->{'servername'} . ' is not the current master. Skipping DB-HA actions and monitoring.'); - # Exit current eval. - return; - } - - # Synchronize database. - enterprise_hook('pandoraha_sync_node', [$conf, $dbh]); - - # Monitoring. - enterprise_hook('pandoraha_monitoring', [$conf, $dbh]); - - # Pending actions. - enterprise_hook('pandoraha_process_queue', [$conf, $dbh, $First_Cleanup]); - - # Cleanup and exit - db_disconnect ($dbh); - }; - log_message($conf, 'WARNING', $@) if ($@); - - log_message($conf, 'LOG', "Sleep."); - sleep($conf->{'ha_interval'}); - } -} ############################################################################### # Main (Pandora) @@ -763,11 +680,6 @@ ha_init_pandora(\%Conf); # Read config file ha_load_pandora_conf (\%Conf); -# Main -if (defined($Conf{'ha_mode'}) && lc($Conf{'ha_mode'}) eq 'pandora') { - ha_main_pandora(\%Conf); -} else { - ha_main_pacemaker(\%Conf); -} +ha_main_pandora(\%Conf); exit 0;