From 8808685b8bbc4a07741496b7e75227cf4e638dbb Mon Sep 17 00:00:00 2001 From: Junichi Satoh Date: Sat, 6 Sep 2014 11:16:46 +0900 Subject: [PATCH] 2014-09-06 Junichi Satoh * lib/PandoraFMS/Core.pm: Fixed that unknown modules are never recovered when module data is received correctly in/after the race condition (module execution time exceeds its interval). --- pandora_server/ChangeLog | 6 ++++++ pandora_server/lib/PandoraFMS/Core.pm | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index ba599a747f..6d20695550 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2014-09-06 Junichi Satoh + + * lib/PandoraFMS/Core.pm: Fixed that unknown modules are never + recovered when module data is received correctly in/after the + race condition (module execution time exceeds its interval). + 2014-09-03 Ramon Novoa * lib/PandoraFMS/Tools.pm: Added basic support to log to syslog. diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index da75f3e8fb..f351d19d8d 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -4223,7 +4223,7 @@ sub pandora_module_unknown ($$) { # Set the module state to normal logger ($pa_config, "Module " . $module->{'nombre'} . " is going to NORMAL", 10); - db_do ($dbh, 'UPDATE tagente_estado SET last_known_status = estado, last_status = 0, estado = 0 WHERE id_agente_estado = ?', $module->{'id_agente_estado'}); + db_do ($dbh, 'UPDATE tagente_estado SET last_status = 0, estado = 0 WHERE id_agente_estado = ?', $module->{'id_agente_estado'}); # Get agent information my $agent = get_db_single_row ($dbh, 'SELECT * @@ -4265,7 +4265,7 @@ sub pandora_module_unknown ($$) { else { # Set the module state to unknown logger ($pa_config, "Module " . $module->{'nombre'} . " is going to UNKNOWN", 10); - db_do ($dbh, 'UPDATE tagente_estado SET last_known_status = estado, last_status = 3, estado = 3 WHERE id_agente_estado = ?', $module->{'id_agente_estado'}); + db_do ($dbh, 'UPDATE tagente_estado SET last_status = 3, estado = 3 WHERE id_agente_estado = ?', $module->{'id_agente_estado'}); # Get agent information my $agent = get_db_single_row ($dbh, 'SELECT * FROM tagente WHERE id_agente = ?', $module->{'id_agente'});