From e49400ae15c0afaca0324272ff46fc4091f4030b Mon Sep 17 00:00:00 2001 From: Ramon Novoa Date: Fri, 5 May 2017 12:54:55 +0200 Subject: [PATCH] Add a default timeout for web modules. Ref #548. --- pandora_server/conf/pandora_server.conf.new | 4 ++++ pandora_server/lib/PandoraFMS/Config.pm | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/pandora_server/conf/pandora_server.conf.new b/pandora_server/conf/pandora_server.conf.new index d444152f55..d306e99cb1 100644 --- a/pandora_server/conf/pandora_server.conf.new +++ b/pandora_server/conf/pandora_server.conf.new @@ -382,6 +382,10 @@ webserver 1 web_threads 1 +# Default timeout (in seconds) for web modules. + +web_timeout 60 + # Uncomment to perform web checks with CURL instead of LWP. #web_engine curl diff --git a/pandora_server/lib/PandoraFMS/Config.pm b/pandora_server/lib/PandoraFMS/Config.pm index 5547e04e36..8c48564b78 100644 --- a/pandora_server/lib/PandoraFMS/Config.pm +++ b/pandora_server/lib/PandoraFMS/Config.pm @@ -208,6 +208,7 @@ sub pandora_load_config { $pa_config->{"exportserver"} = 1; # default $pa_config->{"inventoryserver"} = 1; # default $pa_config->{"webserver"} = 1; # 3.0 + $pa_config->{"web_timeout"} = 60; # 6.0SP5 $pa_config->{"servermode"} = ""; $pa_config->{'snmp_logfile'} = "/var/log/pandora_snmptrap.log"; $pa_config->{"network_threads"} = 3; # Fixed default @@ -604,6 +605,9 @@ sub pandora_load_config { elsif ($parametro =~ m/^webserver\s+([0-9]*)/i) { $pa_config->{'webserver'}= clean_blank($1); } + elsif ($parametro =~ m/^web_timeout\s+([0-9]*)/i) { + $pa_config->{'web_timeout'}= clean_blank($1); + } elsif ($parametro =~ m/^eventserver\s+([0-9]*)/i) { $pa_config->{'eventserver'}= clean_blank($1); }