Added discovery name convention to server files

Former-commit-id: d432ac2c5526cc05b7cbb29df66aef60a35ab0e7
This commit is contained in:
fbsanchez 2019-02-21 15:07:51 +01:00
parent 8fb84e910a
commit 6409fc2ddd
2 changed files with 14 additions and 4 deletions

View File

@ -226,7 +226,7 @@ sub pandora_load_config {
$pa_config->{"dataserver"} = 1; # default
$pa_config->{"networkserver"} = 1; # default
$pa_config->{"snmpconsole"} = 1; # default
$pa_config->{"reconserver"} = 1; # default
$pa_config->{"discoveryserver"} = 1; # default
$pa_config->{"wmiserver"} = 1; # default
$pa_config->{"pluginserver"} = 1; # default
$pa_config->{"predictionserver"} = 1; # default
@ -254,6 +254,7 @@ sub pandora_load_config {
$pa_config->{"plugin_threads"} = 2; # Introduced on 2.0
$pa_config->{"plugin_exec"} = '/usr/bin/timeout'; # 3.0
$pa_config->{"recon_threads"} = 2; # Introduced on 2.0
$pa_config->{"discovery_threads"} = 2; # Introduced on 732
$pa_config->{"prediction_threads"} = 1; # Introduced on 2.0
$pa_config->{"plugin_timeout"} = 5; # Introduced on 2.0
$pa_config->{"wmi_threads"} = 2; # Introduced on 2.0
@ -659,8 +660,8 @@ sub pandora_load_config {
elsif ($parametro =~ m/^predictionserver\s+([0-9]*)/i){
$pa_config->{'predictionserver'}= clean_blank($1);
}
elsif ($parametro =~ m/^reconserver\s+([0-9]*)/i) {
$pa_config->{'reconserver'}= clean_blank($1);
elsif ($parametro =~ m/^discoveryserver\s+([0-9]*)/i) {
$pa_config->{'discoveryserver'}= clean_blank($1);
}
elsif ($parametro =~ m/^reconserver\s+([0-9]*)/i) {
$pa_config->{'reconserver'}= clean_blank($1);
@ -809,6 +810,9 @@ sub pandora_load_config {
elsif ($parametro =~ m/^autocreate_group\s+([0-9*]*)/i) {
$pa_config->{'autocreate_group'}= clean_blank($1);
}
elsif ($parametro =~ m/^discovery_threads\s+([0-9]*)/i) {
$pa_config->{'discovery_threads'}= clean_blank($1);
}
elsif ($parametro =~ m/^recon_threads\s+([0-9]*)/i) {
$pa_config->{'recon_threads'}= clean_blank($1);
}

View File

@ -100,7 +100,13 @@ sub run ($) {
my $pa_config = $self->getConfig ();
print_message ($pa_config, " [*] Starting " . $pa_config->{'rb_product_name'} . " Discovery Server.", 1);
$self->setNumThreads ($pa_config->{'recon_threads'});
my $threads = $pa_config->{'recon_threads'};
# Use hightest value
if ($pa_config->{'discovery_threads'} > $pa_config->{'recon_threads'}) {
$threads = $pa_config->{'discovery_threads'};
}
$self->setNumThreads($threads);
$self->SUPER::run (\@TaskQueue, \%PendingTasks, $Sem, $TaskSem);
}