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

use params directly - not a variable

parent 5dab8c3d
No related branches found
No related tags found
1 merge request!13use params directly - not a variable
......@@ -19,12 +19,6 @@
cfgfile=/etc/haproxy/haproxy.cfg
tmpfile=/tmp/check_haproxy_healthcheck_$$
paramsWget="-T 5 -t 1 --no-check-certificate"
# ^ ^
# | tries = 1
# timeout in seconds
# ----------------------------------------------------------------------
# pre checks
# ----------------------------------------------------------------------
......@@ -52,16 +46,16 @@ fi
safeurl=$( echo $url | sed "s#\(://\)\(.*@\)#\1#g" )
# --- get status page
wget $paramsWget -O $tmpfile $url 2>/dev/null
wget -T 5 -t 1 --no-check-certificate -O $tmpfile $url 2>/dev/null
if [ $? -ne 0 ]; then
rm -f $tmpfile
ph.abort "UNKNOWN: url $safeurl did not respond. $(wget $paramsWget -O - -S $url)"
ph.abort "UNKNOWN: url $safeurl did not respond. $(wget -T 5 -t 1 --no-check-certificate -O - -S $url)"
fi
grep "200 OK" $tmpfile >/dev/null
if [ $? -ne 0 ]; then
ph.setStatus "error"
ph.status "url $safeurl did not contain 200 OK. $(wget $paramsWget -O - -S $url)"
ph.status "url $safeurl did not contain 200 OK. $(wget -T 5 -t 1 --no-check-certificate -O - -S $url)"
else
ph.status "HA Proxy $safeurl is up and running."
fi
......
......@@ -27,11 +27,6 @@ tmpfile=/tmp/check_haproxy_status_$$
tmpfile2=/tmp/check_haproxy_status2_$$
tmpfileping=/tmp/check_haproxy_status3_$$
paramsWget="-T 5 -t 1 --no-check-certificate"
# ^ ^
# | tries = 1
# timeout in seconds
# ----------------------------------------------------------------------
# pre checks
# ----------------------------------------------------------------------
......@@ -108,10 +103,10 @@ urlmasked=$( echo $url | sed "s#\(://\)\(.*@\)#\1#g" )
# --- get status page
wget $paramsWget -O $tmpfile $url 2>/dev/null
wget -T 5 -t 1 --no-check-certificate -O $tmpfile $url 2>/dev/null
if [ $? -ne 0 ]; then
rm -f $tmpfile
ph.abort "UNKNOWN: url $urlmasked did not respond. $(wget --no-check-certificate -O - -S $url)"
ph.abort "UNKNOWN: url $urlmasked did not respond. $(wget -T 5 -t 1 --no-check-certificate -O - -S $url)"
fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment