From a6160671d176c21810c84cd5e549d6339ca78bca Mon Sep 17 00:00:00 2001 From: ramonn Date: Wed, 8 Jul 2009 11:01:47 +0000 Subject: [PATCH] 2009-07-08 Ramon Novoa * lib/PandoraFMS/Config.pm: Properly set the new agentaccess config option. Fixes bug #2815878. * util/pandora_xml_stress.pl: Fixed config file comment detection. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1792 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 7 +++++++ pandora_server/lib/PandoraFMS/Config.pm | 6 ++++++ pandora_server/util/pandora_xml_stress.pl | 11 ++++++----- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 2f1ad9e6b6..0f3ea6a602 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,10 @@ +2009-07-08 Ramon Novoa + + * lib/PandoraFMS/Config.pm: Properly set the new agentaccess + config option. Fixes bug #2815878. + + * util/pandora_xml_stress.pl: Fixed config file comment detection. + 2009-06-30 Manuel Arostegui * pandora_server.spec: Now it builds packages for SLE9. diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 11e9e611f2..fde4e1cb11 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -215,6 +215,9 @@ sub pandora_load_config { # Multicast change report $pa_config->{'mcast_change_group'} = ''; $pa_config->{'mcast_change_port'} = ''; + + # Update tagent_access + $pa_config->{"agentaccess"} = 1; # Check for UID0 if ($pa_config->{"quiet"} != 0){ @@ -472,6 +475,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^max_queue_files\s([0-9]*)/i) { $pa_config->{'max_queue_files'}= clean_blank($1); } + elsif ($parametro =~ m/^agentaccess\s([0-1])/i) { + $pa_config->{'agentaccess'}= clean_blank($1); + } } # end of loop for parameter # diff --git a/pandora_server/util/pandora_xml_stress.pl b/pandora_server/util/pandora_xml_stress.pl index c58892ab42..ab3d1312f9 100755 --- a/pandora_server/util/pandora_xml_stress.pl +++ b/pandora_server/util/pandora_xml_stress.pl @@ -47,11 +47,15 @@ sub load_config ($\%\@) { if ($line =~ m/module_begin/) { my %module; + # A comment + next if ($line =~ m/^#/); + while (my $line = ) { - last if ($line =~ m/module_end/); # A comment next if ($line =~ m/^#/); + + last if ($line =~ m/module_end/); # Unknown line next if ($line !~ /^\s*(\w+)\s+(.+)$/); @@ -63,9 +67,6 @@ sub load_config ($\%\@) { $Modules++; next; } - - # A comment - next if ($line =~ m/^#/); # Unknown line next if ($line !~ /^\s*(\w+)\s+(.+)$/); @@ -82,7 +83,7 @@ sub generate_xml_files ($$$$$) { my ($agents, $start, $step, $conf, $modules) = @_; # Read agent configuration - my $interval = get_conf_token ($conf, 'interval', '300'); + my $interval = get_conf_token ($conf, 'agent_interval', '300'); my $xml_version = get_conf_token ($conf, 'xml_version', '1.0'); my $encoding = get_conf_token ($conf, 'encoding', 'ISO-8859-1'); my $os_name = get_conf_token ($conf, 'os_name', 'Linux');