From d34113dbe10c872cc658f73e4f65c839e42b5de1 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 11 Oct 2023 12:35:43 -0600 Subject: [PATCH 1/2] Change utimestamp to avoid Unknown --- pandora_server/lib/PandoraFMS/Core.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index b8f42b1734..8c704dacc1 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -7689,6 +7689,9 @@ sub safe_mode($$$$$$) { elsif ($known_status == MODULE_CRITICAL) { logger($pa_config, "Disabling safe mode for agent " . $agent->{'nombre'}, 10); db_do($dbh, 'UPDATE tagente_modulo SET disabled=0 WHERE id_agente=? AND id_agente_modulo!=?', $agent->{'id_agente'}, $module->{'id_agente_modulo'}); + + # Prevent the modules from becoming unknown! + db_do ($dbh, 'UPDATE tagente_estado SET utimestamp = ? WHERE id_agente = ?', time(), $agent->{'id_agente'}); } } From baad1f341c91c9f9a3a77855dd96e5c87fcf3c41 Mon Sep 17 00:00:00 2001 From: "felix.suarez" Date: Wed, 11 Oct 2023 17:58:56 -0500 Subject: [PATCH 2/2] Update query to avoid safe mode module --- pandora_server/lib/PandoraFMS/Core.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 8c704dacc1..58815a4ff9 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -7691,7 +7691,7 @@ sub safe_mode($$$$$$) { db_do($dbh, 'UPDATE tagente_modulo SET disabled=0 WHERE id_agente=? AND id_agente_modulo!=?', $agent->{'id_agente'}, $module->{'id_agente_modulo'}); # Prevent the modules from becoming unknown! - db_do ($dbh, 'UPDATE tagente_estado SET utimestamp = ? WHERE id_agente = ?', time(), $agent->{'id_agente'}); + db_do ($dbh, 'UPDATE tagente_estado SET utimestamp = ? WHERE id_agente = ? AND id_agente_modulo!=?', time(), $agent->{'id_agente'}, $module->{'id_agente_modulo'}); } }