From 3b4abe4e17e1e905beadb93cce2ddc3cb3463a55 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Wed, 12 Aug 2015 14:10:14 +0200 Subject: [PATCH] Revert "Do post-processing before incremental constraints are evaluated (thanks" This reverts commit a338458ec2c403dbc9caca29c12ddb4501cbca0b. New data was compared against the previous value BEFORE post processing, so the order was not important. --- pandora_server/lib/PandoraFMS/Core.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 169b7d4f41..91974f6b87 100755 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3309,11 +3309,6 @@ sub process_data ($$$$$$$) { # If is a number, we need to replace "," for "." $data =~ s/\,/\./; - # Post process - if (is_numeric ($module->{'post_process'}) && $module->{'post_process'} != 0) { - $data = $data * $module->{'post_process'}; - } - # Out of bounds if (($module->{'max'} != $module->{'min'}) && ($data > $module->{'max'} || $data < $module->{'min'})) { logger($pa_config, "Received invalid data '" . $data_object->{'data'} . "' from agent '" . $agent->{'nombre'} . "' module '" . $module->{'nombre'} . "' agent " . (defined ($agent) ? "'" . $agent->{'nombre'} . "'" : 'ID ' . $module->{'id_agente'}) . ".", 3); @@ -3328,6 +3323,11 @@ sub process_data ($$$$$$$) { return undef unless defined ($data); } + # Post process + if (is_numeric ($module->{'post_process'}) && $module->{'post_process'} != 0) { + $data = $data * $module->{'post_process'}; + } + # TODO: Float precission should be adjusted here in the future with a global # config parameter # Format data