Merge branch 'ent-11731-cli-error-servidor-no-asignado-e-intervalo-incorrecto-al-crear-agente-con-create_event' into 'develop'

Ent-11731-cli-error-servidor-no-asignado-e-intervalo-incorrecto-al-crear-agente-con-create_event

Closes pandora_enterprise#11731

See merge request artica/pandorafms!6293
This commit is contained in:
Rafael Ameijeiras 2023-12-14 15:11:27 +00:00
commit abe950e7d7
1 changed files with 3 additions and 1 deletions

View File

@ -4509,7 +4509,9 @@ sub cli_create_event() {
# exist_check($id_agent,'agent',$agent_name);
if($id_agent == -1){
if($force_create_agent == 1){
pandora_create_agent ($conf, '', $agent_name, '', $id_group, '', '', 'Created by cli_create_event', '', $dbh);
my $target_os = pandora_get_os($dbh, 'other');
my $target_server = $conf{'servername'};
pandora_create_agent ($conf, $target_server, $agent_name, '', $id_group, '', $target_os, 'Created by cli_create_event', '300', $dbh);
print_log "[INFO] Adding agent '$agent_name' \n\n";
$id_agent = get_agent_id($dbh,$agent_name);
}