diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index c099a9dc42..71e0e4c332 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-03-03 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Added 'matches_value' support to 'onchange' + alerts. + 2010-03-02 Raúl Mateos * util/tentacle_serverd, util/pandora_server: Updated year. Changed diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 8ed4b36d65..d711bb5b60 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -265,14 +265,17 @@ sub pandora_evaluate_alert ($$$$$$$) { } if ($alert->{'type'} eq "onchange") { - - if (is_numeric($last_data_value)){ - if ($last_data_value == $data){ - return $status; + if ($alert->{'matches_value'} == 1) { + if (is_numeric($last_data_value)){ + return $status if ($last_data_value == $data); + } else { + return $status if ($last_data_value eq $data); } } else { - if ($last_data_value eq $data){ - return $status; + if (is_numeric($last_data_value)){ + return $status if ($last_data_value != $data); + } else { + return $status if ($last_data_value ne $data); } } }