diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index e8c48b2193..e90fffdecb 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2011-09-27 Dario Rodriguez + + * util/pandora_manage.pl: Changed way to create and event now is possible + to create an event without agent_name and without agent_module. + 2011-09-26 Vanessa Gil * pandora_server/util/pandora_manage.pl: Fixed bad behaviour of several diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index 81e9255203..abc82c8bf5 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -1101,10 +1101,25 @@ sub pandora_manage_main ($$$) { exist_check($id_group,'group',$group_name); } - my $id_agent = get_agent_id($dbh,$agent_name); - exist_check($id_agent,'agent',$agent_name); - my $id_agentmodule = get_agent_module_id($dbh,$module_name,$id_agent); - exist_check($id_agentmodule,'module',$module_name); + my $id_agent; + + if (defined($agent_name) && $agent_name ne "") { + $id_agent = get_agent_id($dbh,$agent_name); + exist_check($id_agent,'agent',$agent_name); + + } else { + $id_agent = 0; + } + + my $id_agentmodule; + + if (defined($module_name) && $module_name ne "") { + $id_agentmodule = get_agent_module_id($dbh,$module_name,$id_agent); + exist_check($id_agentmodule,'module',$module_name); + + } else { + $id_agentmodule = 0; + } my $id_alert_agent_module;