Merge branch 'fix/out-of-order-data-6120' into 'develop'

Do not update tagente_estado when processing out-of-order data.

See merge request artica/pandorafms!1624
This commit is contained in:
vgilc 2018-08-27 09:07:06 +02:00
commit f0494ea598

View File

@ -1624,16 +1624,19 @@ sub pandora_process_module ($$$$$$$$$;$) {
my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0; my $save = ($module->{'history_data'} == 1 && ($agent_status->{'datos'} ne $processed_data || $last_try < ($utimestamp - 86400))) ? 1 : 0;
db_do ($dbh, 'UPDATE tagente_estado # Never update tagente_estado when processing out-of-order data.
SET datos = ?, estado = ?, known_status = ?, last_status = ?, last_known_status = ?, if ($utimestamp >= $last_try) {
status_changes = ?, utimestamp = ?, timestamp = ?, db_do ($dbh, 'UPDATE tagente_estado
id_agente = ?, current_interval = ?, running_by = ?, SET datos = ?, estado = ?, known_status = ?, last_status = ?, last_known_status = ?,
last_execution_try = ?, last_try = ?, last_error = ?, status_changes = ?, utimestamp = ?, timestamp = ?,
ff_start_utimestamp = ? id_agente = ?, current_interval = ?, running_by = ?,
WHERE id_agente_modulo = ?', $processed_data, $status, $status, $new_status, $new_status, $status_changes, last_execution_try = ?, last_try = ?, last_error = ?,
$current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id, ff_start_utimestamp = ?
$utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $ff_start_utimestamp, $module->{'id_agente_modulo'}); WHERE id_agente_modulo = ?', $processed_data, $status, $status, $new_status, $new_status, $status_changes,
$current_utimestamp, $timestamp, $module->{'id_agente'}, $current_interval, $server_id,
$utimestamp, ($save == 1) ? $timestamp : $agent_status->{'last_try'}, $last_error, $ff_start_utimestamp, $module->{'id_agente_modulo'});
}
# Save module data. Async and log4x modules are not compressed. # Save module data. Async and log4x modules are not compressed.
if ($module_type =~ m/(async)|(log4x)/ || $save == 1) { if ($module_type =~ m/(async)|(log4x)/ || $save == 1) {
save_module_data ($data_object, $module, $module_type, $utimestamp, $dbh); save_module_data ($data_object, $module, $module_type, $utimestamp, $dbh);