Merge branch 'ent-5553-dangerous-behaviour-dataserver-lifo-enabled' into 'develop'

Ent 5553 dangerous behaviour dataserver lifo enabled

See merge request artica/pandorafms!3203
This commit is contained in:
Alejandro Fraguas 2020-05-25 16:08:37 +02:00
commit 24bb16fe64

View File

@ -1739,6 +1739,17 @@ sub pandora_process_module ($$$$$$$$$;$) {
# Save module data. Async and log4x modules are not compressed.
if ($module_type =~ m/(async)|(log4x)/ || $save == 1) {
# If previous timestamp data changes, save the last one to avoid errors on SLA or graphs.
if($last_data_value ne $processed_data) {
my $last_data_timestamp = $agent_status->{'utimestamp'};
my $last_data_object;
$last_data_object->{'data'} = $last_data_value;
save_module_data ($last_data_object, $module, $module_type, $last_data_timestamp, $dbh);
}
save_module_data ($data_object, $module, $module_type, $utimestamp, $dbh);
}