Merge branch 'ent-6027-error-cli-create-agent' into 'develop'

CLI create agent fixed add address to taddress

See merge request artica/pandorafms!3358
This commit is contained in:
Daniel Rodriguez 2020-08-07 14:09:26 +02:00
commit 9e9db89390
1 changed files with 6 additions and 1 deletions

View File

@ -1129,8 +1129,13 @@ sub cli_create_agent() {
exist_check($id_group,'operating system',$group_name);
my $agent_exists = get_agent_id($dbh,$agent_name);
non_exist_check($agent_exists, 'agent name', $agent_name);
pandora_create_agent ($conf, $server_name, $agent_name, $address, $id_group, 0, $os_id, $description, $interval, $dbh,
my $agent_id = pandora_create_agent ($conf, $server_name, $agent_name, $address, $id_group, 0, $os_id, $description, $interval, $dbh,
undef, undef, undef, undef, undef, undef, undef, undef, $agent_alias);
# Create address for this agent in taddress.
if (defined($address)) {
pandora_add_agent_address($conf, $agent_id, $agent_name, $address, $dbh);
}
}
##############################################################################