diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 53982b1553..c4d3d43bca 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,7 @@ +2011-09-06 Ramon Novoa + + * lib/PandoraFMS/Core.pm: Fixed action search for event alerts. + 2011-09-06 Ramon Novoa * lib/PandoraFMS/NmapParser.pm: Remove nmap warnings from output. diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 23bdb2a31a..ab24224286 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -633,11 +633,10 @@ sub pandora_execute_alert ($$$$$$$$;$) { @actions = get_db_rows ($dbh, 'SELECT * FROM tevent_alert_action, talert_actions, talert_commands WHERE tevent_alert_action.id_alert_action = talert_actions.id AND talert_actions.id_alert_command = talert_commands.id - AND tevent_alert_action.id = ? + AND tevent_alert_action.id_event_alert = ? AND ((fires_min = 0 AND fires_max = 0) OR (? >= fires_min AND ? <= fires_max))', - $alert->{'id'}, $alert->{'times_fired'}, $alert->{'times_fired'}); - + $alert->{'id'}, $alert->{'times_fired'}, $alert->{'times_fired'}); # Get default action if ($#actions < 0) { @actions = get_db_rows ($dbh, 'SELECT * FROM talert_actions, talert_commands