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

haproxy health: remove password for showing url in output

parent 80deed3f
No related branches found
No related tags found
No related merge requests found
...@@ -38,22 +38,24 @@ fi ...@@ -38,22 +38,24 @@ fi
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
url=$( getHealthUri ) url=$( getHealthUri )
# remove password for showing url in output
safeurl=$( echo $url | sed "s#\(://\)\(.*@\)#\1#g" )
# --- get status page # --- get status page
wget --no-check-certificate -O $tmpfile $url 2>/dev/null wget --no-check-certificate -O $tmpfile $url 2>/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
rm -f $tmpfile rm -f $tmpfile
ph.abort "UNKNOWN: url $url did not respond. `wget --no-check-certificate -O - -S $url`" ph.abort "UNKNOWN: url $safeurl did not respond. `wget --no-check-certificate -O - -S $url`"
fi fi
grep "200 OK" $tmpfile >/dev/null grep "200 OK" $tmpfile >/dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
ph.setStatus "error" ph.setStatus "error"
ph.status "url $url did not contain 200 OK. `wget --no-check-certificate -O - -S $url`" ph.status "url $safeurl did not contain 200 OK. `wget --no-check-certificate -O - -S $url`"
else else
ph.status "HA Proxy $url is up and running." ph.status "HA Proxy $safeurl is up and running."
fi fi
rm -f $tmpfile rm -f $tmpfile
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment