From 06680d09f2bac3780edab5d5c9d9fe53406e9b28 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 1 Oct 2014 11:58:45 +0200 Subject: [PATCH] Added the async_recovery configuration token. --- pandora_server/conf/pandora_server.conf.new | 3 +++ pandora_server/conf/pandora_server.conf.windows | 5 +++++ pandora_server/lib/PandoraFMS/Config.pm | 6 ++++++ pandora_server/lib/PandoraFMS/Core.pm | 2 ++ 4 files changed, 16 insertions(+) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index faa24ed3e6..b3e220d140 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -462,4 +462,7 @@ event_expiry_time 0 # the SNMP Enterprise Server when pandora_db is run. claim_back_snmp_modules 1 +# If set to 1 asynchronous modules that do not receive data for twice their +# interval will become normal. Set to 0 to disable. +async_recovery 1 diff --git a/pandora_server/conf/pandora_server.conf.windows b/pandora_server/conf/pandora_server.conf.windows index c3786c0885..a15dd0d943 100644 --- a/pandora_server/conf/pandora_server.conf.windows +++ b/pandora_server/conf/pandora_server.conf.windows @@ -277,3 +277,8 @@ restart_delay 60 # Update parent from the agent xml #update_parent 1 + +# If set to 1 asynchronous modules that do not receive data for twice their +# interval will become normal. Set to 0 to disable. +async_recovery 1 + diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index eec64694b6..5e78597993 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -335,6 +335,9 @@ sub pandora_load_config { # Event auto-expiry time window $pa_config->{"claim_back_snmp_modules"} = 1; # 5.1 + # Auto-recovery of asynchronous modules. + $pa_config->{"async_recovery"} = 1; # 5.1SP1 + # ------------------------------------------------------------------------- # This values are not stored in .conf files. # This values should be stored in database, not in .conf files! @@ -797,6 +800,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^claim_back_snmp_modules\s(.*)/i) { $pa_config->{'claim_back_snmp_modules'}= safe_input($1); } + elsif ($parametro =~ m/^async_recovery\s+([0-1])/i) { + $pa_config->{'async_recovery'}= safe_input($1); + } } # end of loop for parameter # # Set to RDBMS' standard port diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index c8cb3605a4..87d26bf9ea 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4218,6 +4218,8 @@ sub pandora_module_unknown ($$) { if ($module->{'id_tipo_modulo'} == 21 || $module->{'id_tipo_modulo'} == 22 || $module->{'id_tipo_modulo'} == 23) { + + next if ($pa_config->{"async_recovery"} == 0); # Set the module state to normal logger ($pa_config, "Module " . $module->{'nombre'} . " is going to NORMAL", 10);