From ee6a60c71dc412afebc3c154d2c924b987d344dd Mon Sep 17 00:00:00 2001 From: juanmanuelr Date: Tue, 28 Feb 2012 17:41:01 +0000 Subject: [PATCH] 2012-02-28 Juan Manuel Ramon * util/pandora_manage.pl: Modify call to function pandora_delete_not_policy_modules adding md5 filename like a parameter. Fixes: #3486481 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5668 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 8 ++++++++ pandora_server/util/pandora_manage.pl | 13 ++++++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 04644fc64c..d512318476 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2012-02-28 Juan Manuel Ramon + + * util/pandora_manage.pl: Modify call to function + pandora_delete_not_policy_modules adding md5 filename like a + parameter. + + Fixes: #3486481 + 2012-02-28 Vanessa Gil * bin/PandoraFMS/Core.pm: Fixed bug: double safe_input in event name. diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index bf30362022..5e8c155f83 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -1357,7 +1357,7 @@ sub cli_create_plugin_module($) { } ############################################################################## -# Create delete module. +# Delete module. # Related option: --delete_module ############################################################################## @@ -1375,14 +1375,16 @@ sub cli_delete_module() { } ############################################################################## -# Create delete not policy modules. +# Delete not policy modules. # Related option: --delete_not_policy_modules ############################################################################## sub cli_delete_not_policy_modules() { my $incomingdir; + my $incomingdirmd5; $incomingdir = $conf->{incomingdir}.'/conf/'; + $incomingdirmd5 = $conf->{incomingdir}.'/md5/'; # Open the folder opendir FOLDER, $incomingdir || die "[ERROR] Opening incoming directory"; @@ -1390,12 +1392,17 @@ sub cli_delete_not_policy_modules() { # Store the list of files my @files = readdir(FOLDER); my $file; + my $filemd5; print "[INFO] Deleting modules without policy from conf files \n\n"; foreach $file (@files) { if($file ne '.' && $file ne '..') { - my $ret = enterprise_hook('pandora_delete_not_policy_modules', [$incomingdir.$file]); + # Creates md5 filename of agent + $filemd5 = $file; + $filemd5 =~ s/\.conf/\.md5/g; + + my $ret = enterprise_hook('pandora_delete_not_policy_modules', [$incomingdir.$file, $incomingdirmd5.$filemd5]); } }