mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch 'ent-11634-eliminar-ha-antigua' into 'develop'
Ent 11634 Eliminar HA antigua See merge request artica/pandorafms!6946
This commit is contained in:
commit
29e5cf9658
@ -1747,3 +1747,5 @@ enterprise/include/class/MySQL.app.php
|
|||||||
enterprise/include/class/Oracle.app.php
|
enterprise/include/class/Oracle.app.php
|
||||||
enterprise/include/class/SAP.app.php
|
enterprise/include/class/SAP.app.php
|
||||||
enterprise/include/class/VMware.app.php
|
enterprise/include/class/VMware.app.php
|
||||||
|
enterprise/include/class/DatabaseHA.class.php
|
||||||
|
enterprise/godmode/servers/HA_cluster.php
|
||||||
|
@ -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/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';
|
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;
|
COMMIT;
|
@ -133,14 +133,12 @@ foreach ($servers as $server) {
|
|||||||
__('Server has crashed.'),
|
__('Server has crashed.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
} else if ((int) ($server['disabled'] == 1)) {
|
||||||
} else if ((int) ($server['disabled'] == 1)){
|
|
||||||
$data[1] = ui_print_status_image(
|
$data[1] = ui_print_status_image(
|
||||||
STATUS_SERVER_STANDBY,
|
STATUS_SERVER_STANDBY,
|
||||||
__('Server was manually disabled.'),
|
__('Server was manually disabled.'),
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
} else if ((int) ($server['status'] === 0)
|
} else if ((int) ($server['status'] === 0)
|
||||||
|| (($date - $server_keepalive) > ($server['server_keepalive']) * 2)
|
|| (($date - $server_keepalive) > ($server['server_keepalive']) * 2)
|
||||||
) {
|
) {
|
||||||
|
@ -3015,7 +3015,7 @@ class ConsoleSupervisor
|
|||||||
public function checkHaStatus()
|
public function checkHaStatus()
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
enterprise_include_once('include/class/DatabaseHA.class.php');
|
enterprise_include_once('include/class/NewDatabaseHA.class.php');
|
||||||
|
|
||||||
$cluster = new DatabaseHA();
|
$cluster = new DatabaseHA();
|
||||||
$nodes = $cluster->getNodes();
|
$nodes = $cluster->getNodes();
|
||||||
@ -3038,7 +3038,7 @@ class ConsoleSupervisor
|
|||||||
'type' => 'NOTIF.HAMASTER.MESSAGE',
|
'type' => 'NOTIF.HAMASTER.MESSAGE',
|
||||||
'title' => __('Desynchronized operation on the node '.$node['host']),
|
'title' => __('Desynchronized operation on the node '.$node['host']),
|
||||||
'message' => __($message),
|
'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,
|
'icon_notification' => self::ICON_ERROR,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -505,10 +505,6 @@ function config_update_config()
|
|||||||
$error_update[] = __('Enable Update Manager');
|
$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) {
|
if (config_update_value('agent_vulnerabilities', get_parameter('agent_vulnerabilities'), true) === false) {
|
||||||
$error_update[] = __('agent_vulnerabilities');
|
$error_update[] = __('agent_vulnerabilities');
|
||||||
}
|
}
|
||||||
@ -2430,10 +2426,6 @@ function config_process_config()
|
|||||||
config_update_value('enable_update_manager', 1);
|
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'])) {
|
if (!isset($config['disabled_newsletter'])) {
|
||||||
config_update_value('disabled_newsletter', 0);
|
config_update_value('disabled_newsletter', 0);
|
||||||
}
|
}
|
||||||
|
@ -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).
|
# Pandora FMS Daemon Watchdog execution interval in seconds (PANDORA FMS ENTERPRISE ONLY).
|
||||||
ha_interval 30
|
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).
|
# Comma separated list of HA host IPs or FQDNs (PANDORA FMS ENTERPRISE ONLY).
|
||||||
#ha_hosts 172.16.0.8,172.168.0.16
|
#ha_hosts 172.16.0.8,172.168.0.16
|
||||||
|
|
||||||
|
@ -566,7 +566,6 @@ sub pandora_load_config {
|
|||||||
|
|
||||||
$pa_config->{"netflowserver"} = 0; # 7.0.770
|
$pa_config->{"netflowserver"} = 0; # 7.0.770
|
||||||
$pa_config->{"netflowserver_threads"} = 1; # 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_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_hosts_file"} = '/var/spool/pandora/data_in/conf/pandora_ha_hosts.conf'; # 7.0.770
|
||||||
$pa_config->{"ha_connect_retries"} = 2; # 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) {
|
elsif ($parametro =~ m/^ncm_ssh_utility\s+(.*)/i) {
|
||||||
$pa_config->{'ncm_ssh_utility'}= clean_blank($1);
|
$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) {
|
elsif ($parametro =~ m/^ha_file\s(.*)/i) {
|
||||||
$pa_config->{'ha_file'} = clean_blank($1);
|
$pa_config->{'ha_file'} = clean_blank($1);
|
||||||
}
|
}
|
||||||
|
@ -539,89 +539,6 @@ sub ha_restart_pandora($) {
|
|||||||
`$config->{'pandora_service_cmd'} $control_command 2>/dev/null`;
|
`$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)
|
# Main (Pandora)
|
||||||
@ -763,11 +680,6 @@ ha_init_pandora(\%Conf);
|
|||||||
# Read config file
|
# Read config file
|
||||||
ha_load_pandora_conf (\%Conf);
|
ha_load_pandora_conf (\%Conf);
|
||||||
|
|
||||||
# Main
|
ha_main_pandora(\%Conf);
|
||||||
if (defined($Conf{'ha_mode'}) && lc($Conf{'ha_mode'}) eq 'pandora') {
|
|
||||||
ha_main_pandora(\%Conf);
|
|
||||||
} else {
|
|
||||||
ha_main_pacemaker(\%Conf);
|
|
||||||
}
|
|
||||||
|
|
||||||
exit 0;
|
exit 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user