From 15761e7b02d676d11888fd3f276cde9a0d2bd840 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 20 Sep 2021 13:25:02 +0200 Subject: [PATCH] Read event_replication from the database. Instead of reading event_replication from pandora_server.conf, read it from the database. Ref. pandora_enterprise#8011. --- pandora_server/conf/pandora_server.conf.new | 5 ----- pandora_server/conf/pandora_server.conf.windows | 5 ----- pandora_server/lib/PandoraFMS/Config.pm | 5 ++--- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index d9ea96e6b7..9f6e105ef5 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -540,11 +540,6 @@ dataserver_lifo 0 policy_manager 1 -# If set to 1, the event replicate process is enabled. 0 by default. (PANDORA FMS ENTERPRISE ONLY) -# WARNING: This process doesn't do anything if is not properly configured from the console setup - -event_replication 0 - # If set to 1, new events validate older event for the same module. This will # affect the performance of the server. This was the "normal behaviour" on previous (4.x) versions. # disable only if you really know what you are doing !!. diff --git a/pandora_server/conf/pandora_server.conf.windows b/pandora_server/conf/pandora_server.conf.windows index c5cc85ac5e..9d953cfa94 100644 --- a/pandora_server/conf/pandora_server.conf.windows +++ b/pandora_server/conf/pandora_server.conf.windows @@ -446,11 +446,6 @@ dataserver_lifo 0 policy_manager 1 -# If set to 1, the event replicate process is enabled. 0 by default. (PANDORA FMS ENTERPRISE ONLY) -# WARNING: This process doesn't do anything if is not properly configured from the console setup - -event_replication 0 - # If set to 1, new events validate older event for the same module. This will # affect the performance of the server. This was the "normal behaviour" on previous (4.x) versions. # disable only if you really know what you are doing !!. diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 44822ce632..410869f100 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -172,6 +172,8 @@ sub pandora_get_sharedconfig ($$) { $pa_config->{"use_custom_encoding"} = pandora_get_tconfig_token ($dbh, 'use_custom_encoding', 0); + $pa_config->{"event_replication"} = pandora_get_tconfig_token ($dbh, 'event_replication', 0); + if ($pa_config->{'include_agents'} eq '') { $pa_config->{'include_agents'} = 0; } @@ -1043,9 +1045,6 @@ sub pandora_load_config { elsif ($parametro =~ m/^policy_manager\s+([0-1])/i) { $pa_config->{'policy_manager'}= clean_blank($1); } - elsif ($parametro =~ m/^event_replication\s+([0-1])/i) { - $pa_config->{'event_replication'}= clean_blank($1); - } elsif ($parametro =~ m/^event_auto_validation\s+([0-1])/i) { $pa_config->{'event_auto_validation'}= clean_blank($1); }