CLI create agent fixed add address to taddress

This commit is contained in:
Luis Calvo 2020-07-06 10:25:14 +02:00
parent 50ef2f6e54
commit f8c7241cc8
1 changed files with 6 additions and 1 deletions

View File

@ -1126,8 +1126,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);
}
}
##############################################################################