diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 9560c442ab..d06f1de68f 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2012-10-24 Ramon Novoa + + * conf/pandora_server.conf, + lib/PandoraFMS/Config.pm, + lib/PandoraFMS/DataServer.pm: Added a new configuration option to + make the data server process XML files in a stack instead of a queue. + 2012-10-23 Ramon Novoa * lib/PandoraFMS/Core.pm: Added new macros. Execute alerts after the diff --git a/pandora_server/conf/pandora_server.conf b/pandora_server/conf/pandora_server.conf index 9f1f9f9452..623af5b62c 100755 --- a/pandora_server/conf/pandora_server.conf +++ b/pandora_server/conf/pandora_server.conf @@ -350,3 +350,8 @@ netflow_interval 300 # Base directory where netflow files will be stored. netflow_basedir /tmp + +# If set to 1, process XML data files in a stack instead of a queue. 0 by default. +# WARNING: Incremental modules will not work properly if dataserver_lifo is set to 1!!! +dataserver_lifo 0 + diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index c48df7b87e..52c49d8d5e 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -278,6 +278,9 @@ sub pandora_load_config { # Self monitoring $pa_config->{'self_monitoring'} = 0; + # Process XML data files as a stack + $pa_config->{"dataserver_lifo"} = 0; # 5.0 + # ------------------------------------------------------------------------- # This values are not stored in .conf files. # This values should be stored in database, not in .conf files! @@ -615,6 +618,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^block_size\s+([0-9]*)/i) { $pa_config->{'block_size'}= clean_blank($1); } + elsif ($parametro =~ m/^dataserver_lifo\s+([0-1])/i) { + $pa_config->{'dataserver_lifo'}= clean_blank($1); + } } # end of loop for parameter # # Set to RDBMS' standard port diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 22cad0f29c..01ccb899a9 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -110,8 +110,12 @@ sub data_producer ($) { # Temporarily disable warnings (some files may have been deleted) { - no warnings; - @tasks = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files); + no warnings; + if ($pa_config->{'dataserver_lifo'} == 0) { + @tasks = sort { -C $pa_config->{'incomingdir'} . "/$b" <=> -C $pa_config->{'incomingdir'} . "/$a" } (@files); + } else { + @tasks = sort { -C $pa_config->{'incomingdir'} . "/$a" <=> -C $pa_config->{'incomingdir'} . "/$b" } (@files); + } } return @tasks;