Skip to content
Snippets Groups Projects
Commit 1dbe451d authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Apache server status: add timeout and max tries

parent c09c2396
Branches
No related tags found
No related merge requests found
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2020-04-09 v1.0 <axel.hahn@iml.unibe.ch> # 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-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 . `dirname $0`/inc_pluginfunctions
...@@ -26,6 +27,10 @@ typeset -i iIdle=0 ...@@ -26,6 +27,10 @@ typeset -i iIdle=0
typeset -i iUnused=0 typeset -i iUnused=0
typeset -i iUsage=0 typeset -i iUsage=0
paramsWget="-T 5 -t 1 --no-check-certificate"
# ^ ^
# | tries = 1
# timeout in seconds
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# pre checks # pre checks
...@@ -37,10 +42,10 @@ ph.require wget ...@@ -37,10 +42,10 @@ ph.require wget
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# --- get /server-status page # --- 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 if [ $? -ne 0 ]; then
rm -f $tmpfile 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 fi
# set default / override from command line params # set default / override from command line params
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment