Merge branch 'ent-6052-revision-parametros-binario-server' into 'develop'

Solved issue with verbosity parameters

Closes pandora_enterprise#6052

See merge request artica/pandorafms!3790
This commit is contained in:
Daniel Rodriguez 2021-03-12 09:11:53 +00:00
commit d0234314a0
1 changed files with 3 additions and 9 deletions

View File

@ -60,11 +60,9 @@ my %pa_config;
sub help_screen {
print "\nSyntax: \n\n pandora_server [ options ] < fullpathname to configuration file > \n\n";
print "Following options are optional : \n";
print " -v : Verbose mode activated. Writes more information in the logfile \n";
print " -d : Debug mode activated. Writes extensive information in the logfile \n";
print " -D : Daemon mode (runs in background)\n";
print " -P <file> : Store PID to file.\n";
print " -q : Quiet startup \n";
print " -S <install|uninstall|run>: Manage the win32 service.\n";
print " -h : This screen. Shows a little help screen \n";
print " \n";
@ -103,18 +101,12 @@ sub pandora_init {
if (($parametro =~ m/-h\z/i ) || ($parametro =~ m/help\z/i )) {
help_screen();
}
elsif ($parametro =~ m/-v\z/i) {
$pa_config->{"verbosity"}=5;
}
elsif ($parametro =~ m/^-P\z/i) {
$pa_config->{'PID'}= clean_blank($ARGV[$ax+1]);
}
elsif ($parametro =~ m/-d\z/) {
$pa_config->{"verbosity"}=10;
}
elsif ($parametro =~ m/-q\z/) {
$pa_config->{"quiet"}=1;
}
elsif ($parametro =~ m/-D\z/) {
$pa_config->{"daemon"}=1;
}
@ -826,7 +818,9 @@ sub pandora_load_config {
$pa_config->{"snmp_proc_deadresponse"} = clean_blank($1);
}
elsif ($parametro =~ m/^verbosity\s+([0-9]*)/i) {
$pa_config->{"verbosity"} = clean_blank($1);
if ($pa_config->{"verbosity"} == 0) {
$pa_config->{"verbosity"} = clean_blank($1);
}
}
elsif ($parametro =~ m/^server_threshold\s+([0-9]*)/i) {
$pa_config->{"server_threshold"} = clean_blank($1);