From af9225f72fe5794a27506060039d40ae09cfd538 Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Mon, 23 Apr 2012 09:44:48 +0000 Subject: [PATCH] 2012-04-20 Ramon Novoa * lib/PandoraFMS/Core.pm: Merged from 4.0 branch. Do not try to reset the internal counter unless it is > 0. Fixed a warning. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6083 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 8cd56f7f7c..8b398bcb17 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2012-04-20 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Merged from 4.0 branch. Do not try to reset + the internal counter unless it is > 0. Fixed a warning. + 2012-04-20 Sergio Martin * lib/PandoraFMS/Core.pm: Setted last_reference to current utimestamp diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index fa999e9018..3a468451e1 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -323,7 +323,7 @@ sub pandora_evaluate_alert ($$$$$$$;$$$) { # Recover takes precedence over cease $status = 4 if ($alert->{'recovery_notify'} == 1); - } elsif ($utimestamp > $limit_utimestamp) { + } elsif ($utimestamp > $limit_utimestamp && $alert->{'internal_counter'} > 0) { $status = 5; } @@ -1916,16 +1916,15 @@ sub process_data ($$$$$) { # Process INC modules if ($module_type =~ m/_inc$/) { $data = process_inc_data ($data, $module, $utimestamp, $dbh); - - # Same timestamp as previous data. Discard. - return undef if($data == -1); - + # Not an error, no previous data if (!defined($data)){ $data_object->{'data'} = 0; return 0; } - #return 0 unless defined ($data); + + # Same timestamp as previous data. Discard. + return undef if($data == -1); } # Post process