From 068344194d11caef293cb2f1088015c68deae54c Mon Sep 17 00:00:00 2001 From: ramonn Date: Wed, 27 May 2009 16:51:42 +0000 Subject: [PATCH] 2009-05-27 Ramon Novoa * lib/PandoraFMS/Core.pm: Disabled string comparisons for equal/not_equal alerts (use regex instead). git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1716 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Core.pm | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 0510659c7c..6524448dac 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2009-05-27 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Disabled string comparisons for + equal/not_equal alerts (use regex instead). + 2009-05-27 Ramon Novoa * lib/PandoraFMS/DataServer.pm: Fixed timestamps for data lists. Made diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 142d3699b6..8947a1d4c5 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -165,9 +165,8 @@ sub pandora_evaluate_alert ($$$$$$) { $data <= $alert->{'max_value'}); } - return $status if ($alert->{'type'} eq "equal" && $data ne $alert->{'value'}); - return $status if ($alert->{'type'} eq "not_equal" && $data eq $alert->{'value'}); - + return $status if ($alert->{'type'} eq "equal" && $data != $alert->{'value'}); + return $status if ($alert->{'type'} eq "not_equal" && $data == $alert->{'value'}); if ($alert->{'type'} eq "regex") { return $status if ($alert->{'matches_value'} == 1 && $data =~ m/$alert->{'value'}/i);