diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 1a7f058ac0..00c6998189 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,9 @@ +2014-06-17 Vanessa Gil + + * lib/PandoraFMS/Core.pm: Added macros + '_alert_critical_instructions_' and + '_alert_warning_instructions_'. + 2014-07-11 Hirofumi Kosaka * util/pandora_manage.pl: To handle multi-byte strings in diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index cfdcbaebd4..267f31276e 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -511,6 +511,9 @@ sub pandora_process_alert ($$$$$$$$;$) { my $critical_instructions = get_db_value ($dbh, 'SELECT critical_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); my $warning_instructions = get_db_value ($dbh, 'SELECT warning_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); my $unknown_instructions = get_db_value ($dbh, 'SELECT unknown_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); + + $alert->{'critical_instructions'} = $critical_instructions; + $alert->{'warning_instructions'} = $warning_instructions; # Generate an event if ($table eq 'tevent_alert') { @@ -666,6 +669,14 @@ sub pandora_execute_alert ($$$$$$$$;$) { return; } + # Critical_instructions, warning_instructions, unknown_instructions + my $critical_instructions = get_db_value ($dbh, 'SELECT critical_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); + my $warning_instructions = get_db_value ($dbh, 'SELECT warning_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); + my $unknown_instructions = get_db_value ($dbh, 'SELECT unknown_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); + + $alert->{'critical_instructions'} = $critical_instructions; + $alert->{'warning_instructions'} = $warning_instructions; + # Execute actions my $event_generated = 0; foreach my $action (@actions) { @@ -692,11 +703,6 @@ sub pandora_execute_alert ($$$$$$$$;$) { } } - # Critical_instructions, warning_instructions, unknown_instructions - my $critical_instructions = get_db_value ($dbh, 'SELECT critical_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); - my $warning_instructions = get_db_value ($dbh, 'SELECT warning_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); - my $unknown_instructions = get_db_value ($dbh, 'SELECT unknown_instructions FROM tagente_modulo WHERE id_agente_modulo = ?', $alert->{'id_agent_module'}); - # Generate an event only if an event has not already been generated by an alert action if ($event_generated == 0) { @@ -840,6 +846,8 @@ sub pandora_execute_action ($$$$$$$$$;$) { _alert_times_fired_ => $alert->{'times_fired'}, _alert_priority_ => $alert->{'priority'}, _alert_text_severity_ => get_priority_name($alert->{'priority'}), + _alert_critical_instructions_ => $alert->{'critical_instructions'}, + _alert_warning_instructions_ => $alert->{'warning_instructions'}, _groupcontact_ => (defined ($group)) ? $group->{'contact'} : '', _groupother_ => (defined ($group)) ? $group->{'other'} : '', _module_ => (defined ($module)) ? $module->{'nombre'} : '',