From 433cfeb73854ce6e6b57119ef8d329996d00c0f8 Mon Sep 17 00:00:00 2001 From: hkosaka Date: Fri, 10 Feb 2012 04:40:57 +0000 Subject: [PATCH] 2012-02-10 Hirofumi Kosaka * pandora_agent: Allow filename wildcards to specify additional configuration files. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5543 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_agents/unix/ChangeLog | 5 +++++ pandora_agents/unix/pandora_agent | 18 +++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pandora_agents/unix/ChangeLog b/pandora_agents/unix/ChangeLog index e82c4fb65e..162d1f4c18 100644 --- a/pandora_agents/unix/ChangeLog +++ b/pandora_agents/unix/ChangeLog @@ -1,3 +1,8 @@ +2012-02-10 Hirofumi Kosaka + + * pandora_agent: Allow filename wildcards to specify + additional configuration files. + 2012-01-03 Ramon Novoa * pandora_agent: Added support for intensive modules. diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 1bf89947f3..f2539ba3cc 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -549,11 +549,19 @@ sub read_config (;$) { next if ($line =~ /^module\s*\w*/); # Additional configuration file - if ($line =~ /^include\s+(.*)\s*/){ - open (FILE, "$1") or next; - my @file_conf = ; - parse_conf_modules(\@file_conf); - close (FILE); + if ($line =~ /^include\s+(.*)\s*/) { + log_message ('setup', "include is $1"); + $Conf{'include'} = $Conf{'include'} ? "$Conf{'include'} $1" : $1; + + foreach my $file_name (glob("$1")) { + open (FILE, "$file_name") or next; + + log_message ('setup', "reading $file_name"); + my @file_conf = ; + parse_conf_modules(\@file_conf); + close (FILE); + } + next; } #Configuration token