Dixed discovery server agents creation

This commit is contained in:
Enrique Martin 2024-03-07 15:02:48 +01:00
parent c5c92411c9
commit 4e1ab0be42
1 changed files with 14 additions and 11 deletions

View File

@ -2326,9 +2326,9 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
);
my $parent_id;
if (defined($agent->{'id_parent'})) {
$parent_id = $agent->{'id_parent'};
} elsif (defined($agent->{'parent_agent_name'})) {
if (defined($agent->{'id_parent'})) {
$parent_id = $agent->{'id_parent'};
} elsif (defined($agent->{'parent_agent_name'})) {
$parent_id = PandoraFMS::Core::locate_agent(
$pa_config, $dbh, $agent->{'parent_agent_name'}
);
@ -2350,7 +2350,10 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
$pa_config, $pa_config->{'servername'}, $agent->{'agent_name'},
$agent->{'address'}, $agent->{'id_group'}, $parent_id,
$os_id, $agent->{'description'},
$agent->{'interval'}, $dbh, $agent->{'timezone_offset'}
$agent->{'interval'}, $dbh, $agent->{'timezone_offset'},
$agent->{'longitude'}, $agent->{'latitude'}, $agent->{'altitude'},
$agent->{'position_description'}, $agent->{'custom_id'}, $agent->{'url_address'},
$agent->{'agent_mode'}, $agent->{'agent_alias'}
);
$current_agent = $parent_id = PandoraFMS::Core::locate_agent(
@ -2405,13 +2408,13 @@ sub PandoraFMS::Recon::Base::create_agents($$) {
# Add inventory data.
if (ref($inventory) eq "HASH") {
PandoraFMS::Core::process_inventory_data (
$pa_config,
$inventory,
0, # Does not seem to be used.
$agent->{'agent_name'},
$agent->{'interval'},
strftime ("%Y/%m/%d %H:%M:%S", localtime()),
$dbh
$pa_config,
$inventory,
0, # Does not seem to be used.
$agent->{'agent_name'},
$agent->{'interval'},
strftime ("%Y/%m/%d %H:%M:%S", localtime()),
$dbh
);
}
}