From fc357b8c14a8337e1bfde7aee2028c222decaea4 Mon Sep 17 00:00:00 2001 From: Shigekazu Aoyagi Date: Tue, 11 Apr 2017 03:32:58 +0000 Subject: [PATCH 1/3] add initialize $conf->{'verbosity'} when not defined config file. --- pandora_server/util/pandora_db.pl | 1 + 1 file changed, 1 insertion(+) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index fcec542ed8..48c9471141 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -669,6 +669,7 @@ sub pandora_load_config ($) { $conf->{'dbengine'} = 'mysql' unless defined ($conf->{'dbengine'}); $conf->{'dbport'} = '3306' unless defined ($conf->{'dbport'}); $conf->{'claim_back_snmp_modules'} = '1' unless defined ($conf->{'claim_back_snmp_modules'}); + $conf->{'verbosity'} = '3' unless defined ($conf->{'verbosity'}); # Dynamic interval configuration. $conf->{"dynamic_constant"} = 0.10 unless defined($conf->{"dynamic_constant"}); From 311ac744c6227f477d693a4bcf04186f400f00de Mon Sep 17 00:00:00 2001 From: Shigekazu Aoyagi Date: Tue, 11 Apr 2017 03:35:12 +0000 Subject: [PATCH 2/3] move logging $conf->{'_days_delete_unknown'} after defined checking --- pandora_server/util/pandora_db.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 48c9471141..3eea7ec0a4 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -840,10 +840,10 @@ sub pandora_checkdb_consistency { log_message ('CHECKDB', "Ignoring not-init data."); } - log_message ('CHECKDB', - "Deleting unknown data (More than " . $conf{'_days_delete_unknown'} . " days)."); - if (defined($conf{'_days_delete_unknown'}) && $conf{'_days_delete_unknown'} > 0) { + log_message ('CHECKDB', + "Deleting unknown data (More than " . $conf{'_days_delete_unknown'} . " days)."); + my @modules = get_db_rows($dbh, 'SELECT tagente_modulo.id_agente_modulo, tagente_modulo.id_agente FROM tagente_modulo, tagente_estado From 200b821a203d648bf8c87372b0ad138a5bb09b5c Mon Sep 17 00:00:00 2001 From: Shigekazu Aoyagi Date: Tue, 11 Apr 2017 03:37:23 +0000 Subject: [PATCH 3/3] add defined check for $conf->{'_inventory_purge'} --- pandora_server/util/pandora_db.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 3eea7ec0a4..28c5adca1d 100644 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -93,7 +93,7 @@ sub pandora_purgedb ($$) { } # Delete old inventory data - if ($conf->{'_inventory_purge'} > 0) { + if (defined ($conf->{'_inventory_purge'}) && $conf->{'_inventory_purge'} > 0) { if (enterprise_load (\%conf) != 0) { my $ulimit_timestamp_inventory = time() - (86400 * $conf->{'_inventory_purge'});