Firts change of logs in delete agent. Tiquet: #3511

(cherry picked from commit 9076f4bda1)
This commit is contained in:
m-lopez-f 2016-04-04 16:48:02 +02:00
parent 61280b2ad9
commit d46b8a92ea
1 changed files with 3 additions and 1 deletions

View File

@ -973,7 +973,6 @@ sub cli_delete_agent() {
my $agent_name = @ARGV[2]; my $agent_name = @ARGV[2];
$agent_name = decode_entities($agent_name); $agent_name = decode_entities($agent_name);
print_log "[INFO] Deleting agent '$agent_name'\n\n";
if (is_metaconsole($conf) == 1) { if (is_metaconsole($conf) == 1) {
my $agents_groups = enterprise_hook('get_metaconsole_agent',[$dbh, $agent_name]); my $agents_groups = enterprise_hook('get_metaconsole_agent',[$dbh, $agent_name]);
@ -981,6 +980,7 @@ sub cli_delete_agent() {
if (scalar(@{$agents_groups}) != 0) { if (scalar(@{$agents_groups}) != 0) {
foreach my $agent (@{$agents_groups}) { foreach my $agent (@{$agents_groups}) {
my $return = enterprise_hook('delete_metaconsole_agent',[$dbh,$agent->{'id_agente'}]); my $return = enterprise_hook('delete_metaconsole_agent',[$dbh,$agent->{'id_agente'}]);
print_log "[INFO] Deleting agent '$agent_name' \n\n";
} }
} }
my $servers = enterprise_hook('get_metaconsole_setup_servers',[$dbh]); my $servers = enterprise_hook('get_metaconsole_setup_servers',[$dbh]);
@ -996,6 +996,7 @@ sub cli_delete_agent() {
next; next;
} }
else { else {
print_log "[INFO] Deleting agent '$agent_name' in ID server: '$server'\n\n";
pandora_delete_agent($dbh_metaconsole,$id_agent,$conf); pandora_delete_agent($dbh_metaconsole,$id_agent,$conf);
} }
} }
@ -1005,6 +1006,7 @@ sub cli_delete_agent() {
my $id_agent = get_agent_id($dbh,$agent_name); my $id_agent = get_agent_id($dbh,$agent_name);
exist_check($id_agent,'agent',$agent_name); exist_check($id_agent,'agent',$agent_name);
print_log "[INFO] Deleting agent '$agent_name'\n\n";
pandora_delete_agent($dbh,$id_agent,$conf); pandora_delete_agent($dbh,$id_agent,$conf);
} }
} }