WIP discovery F3 app db my multiserver

Former-commit-id: a85c048a6d4e755b76a7e042e04cfebdfe69b6f4
This commit is contained in:
fbsanchez 2019-04-03 22:44:06 +02:00
parent 74303168ac
commit 654e0c28f6

View File

@ -1446,6 +1446,16 @@ sub db_scan($) {
return;
}
my @targets = split /,/, $self->{'task_data'}->{'subnet'};
my $i = 0;
foreach my $target (@targets) {
call('message', 'Checking target ' . $target, 10);
# Force target acquirement.
$self->{'task_data'}->{'dbhost'} = $target;
$self->{'task_data'}->{'target_index'} = $i++;
# Connect to target.
my $dbObj = PandoraFMS::Recon::Util::enterprise_new(
'PandoraFMS::Recon::Applications::'.$type,
@ -1453,9 +1463,8 @@ sub db_scan($) {
);
if (!defined($dbObj)) {
call('message', 'Cannot connect to target ' .'', 3);
$self->call('update_progress', -1);
return;
call('message', 'Cannot connect to target ' . $target, 3);
next;
}
my @modules;
@ -1494,8 +1503,14 @@ sub db_scan($) {
}
];
use Data::Dumper;
print Dumper($data);
$self->call('create_agents', $data);
# Destroy item.
undef($dbObj);
}
# Update progress.
# Done!
$self->{'step'} = '';