From 37c1a95c63f12cece8f0f758cd3d6336db162f3f Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Mon, 4 Feb 2013 15:34:02 +0000 Subject: [PATCH] 2013-02-04 Sergio Martin * lib/PandoraFMS/Core.pm: Set the last_known_status when process module to fix an error of "to normal" status events generation git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7575 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- 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 e64b620c15..14a1a0329f 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2013-02-04 Sergio Martin + + * lib/PandoraFMS/Core.pm: Set the last_known_status when + process module to fix an error of "to normal" status + events generation + 2013-01-31 Ramon Novoa * bin/pandora_server, diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 3521d6765c..820dc209c9 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -1039,11 +1039,11 @@ sub pandora_process_module ($$$$$$$$$;$) { my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0; db_do ($dbh, 'UPDATE tagente_estado - SET datos = ?, estado = ?, last_status = ?, + SET datos = ?, estado = ?, last_status = ?, last_known_status = ? status_changes = ?, utimestamp = ?, timestamp = ?, id_agente = ?, current_interval = ?, running_by = ?, last_execution_try = ?, last_try = ? - WHERE id_agente_modulo = ?', $processed_data, $status, $last_status, $status_changes, + WHERE id_agente_modulo = ?', $processed_data, $status, $last_status, $last_status, $status_changes, $current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id, $utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $module->{'id_agente_modulo'});