From efbb9e9d398a5e704944f8676aace485b73a87a7 Mon Sep 17 00:00:00 2001 From: ramonn Date: Thu, 13 Mar 2014 15:29:20 +0000 Subject: [PATCH] 2014-03-13 Ramon Novoa * util/pandora_db.pl: Do not compact proc modules. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@9585 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 4 ++++ pandora_server/util/pandora_db.pl | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 7160287bac..1e6a471829 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,7 @@ +2014-03-13 Ramon Novoa + + * util/pandora_db.pl: Do not compact proc modules. + 2014-03-13 Mario Pulido * pandora_server.redhat.spec: Added netflow directory diff --git a/pandora_server/util/pandora_db.pl b/pandora_server/util/pandora_db.pl index 138b1d6040..d86d1e2b6e 100755 --- a/pandora_server/util/pandora_db.pl +++ b/pandora_server/util/pandora_db.pl @@ -368,6 +368,7 @@ sub pandora_compactdb ($$) { my %count_hash; my %id_agent_hash; my %value_hash; + my %module_proc_hash; return if ($conf->{'_days_compact'} == 0 || $conf->{'_step_compact'} < 1); @@ -417,6 +418,20 @@ sub pandora_compactdb ($$) { # Get interval data foreach my $data (@data) { my $id_module = $data->{'id_agente_modulo'}; + if (! defined($module_proc_hash{$id_module})) { + my $module_type = get_db_value ($dbh, 'SELECT id_tipo_modulo FROM tagente_modulo WHERE id_agente_modulo = ?', $id_module); + + # Mark proc modules. + if ($module_type == 2 || $module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 21 || $module_type == 31) { + $module_proc_hash{$id_module} = 1; + } + else { + $module_proc_hash{$id_module} = 0; + } + } + + # Skip proc modules! + next if ($module_proc_hash{$id_module} == 1); if (! defined($value_hash{$id_module})) { $value_hash{$id_module} = 0;