From 233cc10e36019662d2eeb5fd7a5b8bb6229f7258 Mon Sep 17 00:00:00 2001 From: slerena Date: Sun, 9 Nov 2008 14:42:13 +0000 Subject: [PATCH] 2008-11-08 Sancho Lerena * Config.pm: Fixed bug parsing config options with more than 2 digits. Thanks to Glen Eustace. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1230 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/Config.pm | 25 ++++++++++++++----------- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index d4de4dfc43..3b065e164a 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2008-11-08 Sancho Lerena + + * Config.pm: Fixed bug parsing config options with more + than 2 digits. Thanks to Glen Eustace. + 2008-11-07 Sancho Lerena * bin/pandora_server: Fixed an important problem detected diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index c558dcfb92..c3fde45499 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -39,7 +39,7 @@ our @EXPORT = qw( # version: Defines actual version of Pandora Server for this module only my $pandora_version = "2.1-dev"; -my $pandora_build="PS081030"; +my $pandora_build="PS081109"; our $VERSION = $pandora_version." ".$pandora_build; # Setup hash @@ -246,6 +246,7 @@ sub pandora_loadconfig { for ($ax=0;$ax<=$ltotal;$ax++){ $parametro = $args[$ax]; + if ($parametro =~ m/^incomingdir\s(.*)/i) { $tbuf= clean_blank($1); if ($tbuf =~ m/^\.(.*)/){ @@ -254,16 +255,18 @@ sub pandora_loadconfig { $pa_config->{"incomingdir"} = $tbuf; } } + elsif ($parametro =~ m/^log_file\s(.*)/i) { - $tbuf= clean_blank($1); + $tbuf= clean_blank($1); if ($tbuf =~ m/^\.(.*)/){ $pa_config->{"logfile"} = $pa_config->{"basepath"}.$1; } else { $pa_config->{"logfile"} = $tbuf; } } - elsif ($parametro =~ m/^errorlog_file\s(.*)/i) { - $tbuf= clean_blank($1); + + elsif ($parametro =~ m/^errorlog_file\s(.*)/i) { + $tbuf= clean_blank($1); if ($tbuf =~ m/^\.(.*)/){ $pa_config->{"errorlogfile"} = $pa_config->{"basepath"}.$1; } else { @@ -341,25 +344,25 @@ sub pandora_loadconfig { elsif ($parametro =~ m/^master\s([0-9])/i) { $pa_config->{"pandora_master"} = clean_blank($1); } - elsif ($parametro =~ m/^icmp_checks\s([0-9])/i) { + elsif ($parametro =~ m/^icmp_checks\s([0-9]*)/i) { $pa_config->{"icmp_checks"} = clean_blank($1); } - elsif ($parametro =~ m/^snmpconsole\s([0-9])/i) { + elsif ($parametro =~ m/^snmpconsole\s([0-9]*)/i) { $pa_config->{"snmpconsole"} = clean_blank($1); } - elsif ($parametro =~ m/^alert_recovery\s([0-9])/i) { + elsif ($parametro =~ m/^alert_recovery\s([0-9]*)/i) { $pa_config->{"alert_recovery"} = clean_blank($1); } - elsif ($parametro =~ m/^snmp_checks\s([0-9])/i) { + elsif ($parametro =~ m/^snmp_checks\s([0-9]*)/i) { $pa_config->{"snmp_checks"} = clean_blank($1); } - elsif ($parametro =~ m/^snmp_timeout\s([0-9])/i) { + elsif ($parametro =~ m/^snmp_timeout\s([0-9]*)/i) { $pa_config->{"snmp_timeout"} = clean_blank($1); } - elsif ($parametro =~ m/^tcp_checks\s([0-9])/i) { + elsif ($parametro =~ m/^tcp_checks\s([0-9]*)/i) { $pa_config->{"tcp_checks"} = clean_blank($1); } - elsif ($parametro =~ m/^tcp_timeout\s([0-9])/i) { + elsif ($parametro =~ m/^tcp_timeout\s([0-9]*)/i) { $pa_config->{"tcp_timeout"} = clean_blank($1); } elsif ($parametro =~ m/^snmp_proc_deadresponse\s([0-9]*)/i) {