2012-05-21 Sergio Martin <sergio.martin@artica.es>
* lib/PandoraFMS/Core.pm: Added new Internal Command for actions to validate the events of one module given the agent name (field1) and the module name (field2) git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6325 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
0fcd6f8641
commit
a24f7ed111
|
@ -1,3 +1,9 @@
|
|||
2012-05-21 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Core.pm: Added new Internal Command for
|
||||
actions to validate the events of one module given
|
||||
the agent name (field1) and the module name (field2)
|
||||
|
||||
2012-05-21 Koichiro Kikuchi <koichiro@rworks.jp>
|
||||
|
||||
* util/pandora_db.pl: Merged from 4.0.2: Set default DB port
|
||||
|
|
|
@ -817,6 +817,19 @@ sub pandora_execute_action ($$$$$$$$$;$) {
|
|||
} elsif ($action->{'name'} eq "Pandora FMS Event") {
|
||||
$field1 = subst_alert_macros ($field1, \%macros);
|
||||
pandora_event ($pa_config, $field1, (defined ($agent) ? $agent->{'id_grupo'} : 0), (defined ($agent) ? $agent->{'id_agente'} : 0), $alert->{'priority'}, 0, 0, "alert_fired", 0, $dbh);
|
||||
# Validate event (field1: agent name; field2: module name)
|
||||
} elsif ($action->{'name'} eq "Validate Event") {
|
||||
my $agent_id = -1;
|
||||
my $module_id = -1;
|
||||
if($field1 ne '') {
|
||||
$agent_id = get_agent_id ($dbh, $field1);
|
||||
if($field2 ne '' && $agent_id != -1) {
|
||||
$module_id = get_agent_module_id ($dbh, $field2, $agent_id);
|
||||
if($module_id != -1) {
|
||||
pandora_validate_event ($pa_config, $module_id, $dbh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Unknown
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue