From e6498156242636749e3acd632aaa463f8436edb0 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 16 Oct 2017 15:52:00 +0200 Subject: [PATCH] Do not automatically restart manual recon tasks. Ref pandora_enterprise#1274. --- pandora_server/lib/PandoraFMS/ReconServer.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index a618d0323b..b25c222bf7 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -76,7 +76,12 @@ sub new ($$$$$$) { $Sem = Thread::Semaphore->new; $TaskSem = Thread::Semaphore->new (0); - db_do ($dbh, 'UPDATE trecon_task SET utimestamp = 0 WHERE id_recon_server = ? AND status <> -1', + # Restart automatic recon tasks. + db_do ($dbh, 'UPDATE trecon_task SET utimestamp = 0 WHERE id_recon_server = ? AND status <> -1 AND interval_sweep > 0', + get_server_id ($dbh, $config->{'servername'}, RECONSERVER)); + + # Reset (but do not restart) manual recon tasks. + db_do ($dbh, 'UPDATE trecon_task SET status = -1 WHERE id_recon_server = ? AND status <> -1 AND interval_sweep = 0', get_server_id ($dbh, $config->{'servername'}, RECONSERVER)); # Call the constructor of the parent class