diff --git a/check_apache_requests b/check_apache_requests index 89ba184d2269f6ba4f6f44477695ee374e012cd2..292c6ae8c3cc1ab147879afe32b2566796f9ed8b 100755 --- a/check_apache_requests +++ b/check_apache_requests @@ -8,6 +8,7 @@ # ---------------------------------------------------------------------- # 2020-04-09 v1.0 <axel.hahn@iml.unibe.ch> # 2021-03-11 v1.1 <axel.hahn@iml.unibe.ch> more error checks for output data +# 2021-11-18 v1.2 <axel.hahn@iml.unibe.ch> add timeout and max tries # ====================================================================== . `dirname $0`/inc_pluginfunctions @@ -26,6 +27,10 @@ typeset -i iIdle=0 typeset -i iUnused=0 typeset -i iUsage=0 +paramsWget="-T 5 -t 1 --no-check-certificate" +# ^ ^ +# | tries = 1 +# timeout in seconds # ---------------------------------------------------------------------- # pre checks @@ -37,10 +42,10 @@ ph.require wget # ---------------------------------------------------------------------- # --- get /server-status page -wget --no-check-certificate -O $tmpfile $url 2>/dev/null +wget $paramsWget -O $tmpfile $url 2>/dev/null if [ $? -ne 0 ]; then rm -f $tmpfile - ph.abort "UNKNOWN: request to url $url failed. `wget --no-check-certificate -O - -S $url`" + ph.abort "UNKNOWN: request to url $url failed. `wget $paramsWget --no-check-certificate -O - -S $url 2>&1`" fi # set default / override from command line params