From 9c291fe82bff5bdf4bb14b7629bcd521998075e4 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 2 Nov 2016 13:10:32 +0100 Subject: [PATCH] Never set the status of script recon tasks outside the script. (cherry picked from commit 9b79307668d51021eeed17f78ae728b1f8518abf) --- pandora_server/lib/PandoraFMS/ReconServer.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/ReconServer.pm b/pandora_server/lib/PandoraFMS/ReconServer.pm index a2453a8dd1..ac113579fd 100644 --- a/pandora_server/lib/PandoraFMS/ReconServer.pm +++ b/pandora_server/lib/PandoraFMS/ReconServer.pm @@ -517,8 +517,8 @@ sub exec_recon_script ($$$) { logger ($pa_config, "Cannot execute recon task command $command."); } - # Notify this recon task is ended - update_recon_task ($dbh, $task->{'id_rt'}, -1); + # Only update the timestamp in case something went wrong. The script should set the status. + db_do ($dbh, 'UPDATE trecon_task SET utimestamp = ? WHERE id_rt = ?', time (), $task->{'id_rt'}); logger($pa_config, 'Done executing recon script ' . safe_output($script->{'name'}), 10); return 0;