From 32345e07d5ff9566a4b6f85bca14ea14562afb9b Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Mon, 13 Jun 2016 13:51:55 +0200 Subject: [PATCH] Introducing to Pandora FMS Transactional Server --- pandora_server/bin/pandora_server | 2 ++ pandora_server/lib/PandoraFMS/Config.pm | 21 +++++++++++++++++++++ pandora_server/lib/PandoraFMS/Tools.pm | 2 ++ 3 files changed, 25 insertions(+) diff --git a/pandora_server/bin/pandora_server b/pandora_server/bin/pandora_server index cc3590b245..a8dd5e83a4 100755 --- a/pandora_server/bin/pandora_server +++ b/pandora_server/bin/pandora_server @@ -37,6 +37,7 @@ use PandoraFMS::ReconServer; use PandoraFMS::WMIServer; use PandoraFMS::PluginServer; use PandoraFMS::PredictionServer; +use PandoraFMS::TransactionalServer; # Constants for Win32 services. use constant WIN32_SERVICE_STOPPED => 0x01; @@ -116,6 +117,7 @@ sub pandora_startup () { push (@Servers, new PandoraFMS::WMIServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::PluginServer (\%Config, $DBH)); push (@Servers, new PandoraFMS::PredictionServer (\%Config, $DBH)); + push (@Servers, new PandoraFMS::TransactionalServer (\%Config, $DBH)); } else { # Metaconsole service modules are run by the prediction server push (@Servers, new PandoraFMS::PredictionServer (\%Config, $DBH)); diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 43283fdf5f..755e384eae 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -208,6 +208,10 @@ sub pandora_load_config { $pa_config->{"exportserver"} = 1; # default $pa_config->{"inventoryserver"} = 1; # default $pa_config->{"webserver"} = 1; # 3.0 + $pa_config->{"transactionalserver"} = 0; # Default 0, introduced on 6.1 + $pa_config->{"transactional_threads"} = 1; # Default 1, introduced on 6.1 + $pa_config->{"transactional_threshold"} = 2; # Default 2, introduced on 6.1 + $pa_config->{"transactional_pool"} = $pa_config->{"incomingdir"} . "/" . "trans"; # Default, introduced on 6.1 $pa_config->{'snmp_logfile'} = "/var/log/pandora_snmptrap.log"; $pa_config->{"network_threads"} = 3; # Fixed default $pa_config->{"keepalive"} = 60; # 60 Seconds initially for server keepalive @@ -584,6 +588,23 @@ sub pandora_load_config { elsif ($parametro =~ m/^webserver\s([0-9]*)/i) { $pa_config->{'webserver'}= clean_blank($1); } + elsif ($parametro =~ m/^transactionalserver\s([0-9]*)/i) { + $pa_config->{'transactionalserver'}= clean_blank($1); + } + elsif ($parametro =~ m/^transactional_threads\s([0-9]*)/i) { + $pa_config->{'transactional_threads'}= clean_blank($1); + } + elsif ($parametro =~ m/^transactional_threshold\s([0-9]*)/i) { + $pa_config->{'transactional_threshold'}= clean_blank($1); + } + if ($parametro =~ m/^transactional_pool\s(.*)/i) { + $tbuf= clean_blank($1); + if ($tbuf =~ m/^\.(.*)/){ + $pa_config->{"transactional_pool"} = $pa_config->{"incomingdir"} . "/" . $1; + } else { + $pa_config->{"transactional_pool"} = $pa_config->{"incomingdir"} . "/" . $tbuf; + } + } elsif ($parametro =~ m/^eventserver\s([0-9]*)/i) { $pa_config->{'eventserver'}= clean_blank($1); } diff --git a/pandora_server/lib/PandoraFMS/Tools.pm b/pandora_server/lib/PandoraFMS/Tools.pm index 26d82bce35..8b66c37ae9 100755 --- a/pandora_server/lib/PandoraFMS/Tools.pm +++ b/pandora_server/lib/PandoraFMS/Tools.pm @@ -57,6 +57,7 @@ our @EXPORT = qw( ICMPSERVER SNMPSERVER SATELLITESERVER + TRANSACTIONALSERVER METACONSOLE_LICENSE $DEVNULL RECOVERED_ALERT @@ -112,6 +113,7 @@ use constant EVENTSERVER => 10; use constant ICMPSERVER => 11; use constant SNMPSERVER => 12; use constant SATELLITESERVER => 13; +use constant TRANSACTIONALSERVER => 14; # Value for a metaconsole license type use constant METACONSOLE_LICENSE => 0x01;