2014-06-17 Vanessa Gil <vanessa.gil@artica.es>

* lib/PandoraFMS/Core.pm: Added macros
	'_alert_critical_instructions_' and
	'_alert_warning_instructions_'.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10340 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2014-07-14 07:09:16 +00:00
parent 81df6e92fb
commit 23a2b75bb3
2 changed files with 19 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2014-06-17 Vanessa Gil <vanessa.gil@artica.es>
* lib/PandoraFMS/Core.pm: Added macros
'_alert_critical_instructions_' and
'_alert_warning_instructions_'.
2014-07-11 Hirofumi Kosaka <kosaka@rworks.jp> 2014-07-11 Hirofumi Kosaka <kosaka@rworks.jp>
* util/pandora_manage.pl: To handle multi-byte strings in * util/pandora_manage.pl: To handle multi-byte strings in

View File

@ -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 $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 $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'}); 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 # Generate an event
if ($table eq 'tevent_alert') { if ($table eq 'tevent_alert') {
@ -666,6 +669,14 @@ sub pandora_execute_alert ($$$$$$$$;$) {
return; 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 # Execute actions
my $event_generated = 0; my $event_generated = 0;
foreach my $action (@actions) { 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 # Generate an event only if an event has not already been generated by an alert action
if ($event_generated == 0) { if ($event_generated == 0) {
@ -840,6 +846,8 @@ sub pandora_execute_action ($$$$$$$$$;$) {
_alert_times_fired_ => $alert->{'times_fired'}, _alert_times_fired_ => $alert->{'times_fired'},
_alert_priority_ => $alert->{'priority'}, _alert_priority_ => $alert->{'priority'},
_alert_text_severity_ => get_priority_name($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'} : '', _groupcontact_ => (defined ($group)) ? $group->{'contact'} : '',
_groupother_ => (defined ($group)) ? $group->{'other'} : '', _groupother_ => (defined ($group)) ? $group->{'other'} : '',
_module_ => (defined ($module)) ? $module->{'nombre'} : '', _module_ => (defined ($module)) ? $module->{'nombre'} : '',