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

fix wrong exitcode to "critical"

parent 92b6f80b
Branches
No related tags found
1 merge request!1386468 docs and harmonize
...@@ -12,12 +12,13 @@ ...@@ -12,12 +12,13 @@
# 2021-12-14 v1.3 <axel.hahn@iml.unibe.ch> use updated haproxy paser in sourced file # 2021-12-14 v1.3 <axel.hahn@iml.unibe.ch> use updated haproxy paser in sourced file
# 2022-04-01 v1.4 <axel.hahn@iml.unibe.ch> use wget default params; shell fixes # 2022-04-01 v1.4 <axel.hahn@iml.unibe.ch> use wget default params; shell fixes
# 2022-10-21 v1.5 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space # 2022-10-21 v1.5 <axel.hahn@unibe.ch> remove grep: warning: stray \ before white space
# 2023-07-28 v1.6 <axel.hahn@unibe.ch> add help page # 2023-07-28 v1.6 <axel.hahn@unibe.ch> add help page
# 2023-08-23 v1.7 <axel.hahn@unibe.ch> fix wrong exitcode to "critical"
# ====================================================================== # ======================================================================
. $(dirname $0)/inc_pluginfunctions . $(dirname $0)/inc_pluginfunctions
export self_APPVERSION=1.6 export self_APPVERSION=1.7
. $(dirname $0)/inc_haproxy_cfg.sh . $(dirname $0)/inc_haproxy_cfg.sh
...@@ -106,7 +107,7 @@ fi ...@@ -106,7 +107,7 @@ 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 "critical"
ph.status "url $safeurl did not contain 200 OK. $(wget -T 5 -t 1 --no-check-certificate -O - -S $url)" ph.status "url $safeurl did not contain 200 OK. $(wget -T 5 -t 1 --no-check-certificate -O - -S $url)"
else else
ph.status "HA Proxy $safeurl is up and running." ph.status "HA Proxy $safeurl is up and running."
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
# ds=daniel.schueler@iml.unibe.ch # ds=daniel.schueler@iml.unibe.ch
# #
# 2017-03-03 v1.0 ah,ds # 2017-03-03 v1.0 ah,ds
# 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions # 2020-03-05 v1.1 <axel.hahn@iml.unibe.ch> switch to ph.* helper functions
# 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes # 2023-02-13 v1.2 <axel.hahn@unibe.ch> some shell fixes
# 2023-08-23 v1.3 <axel.hahn@unibe.ch> fix wrong exitcode to "critical"
# ====================================================================== # ======================================================================
...@@ -75,7 +76,7 @@ function showHelp(){ ...@@ -75,7 +76,7 @@ function showHelp(){
echo | openssl s_client -connect ${sDomain}:${iPort} >/dev/null 2>&1 echo | openssl s_client -connect ${sDomain}:${iPort} >/dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
ph.setStatus "error" ph.setStatus "critical"
ph.status "unable to connect to ${sDomain} via port :${iPort} - maybe wrong host ... or port ... wrong chaining" ph.status "unable to connect to ${sDomain} via port :${iPort} - maybe wrong host ... or port ... wrong chaining"
# repeat the last command without redirecting output # repeat the last command without redirecting output
echo | openssl s_client -connect ${sDomain}:${iPort} echo | openssl s_client -connect ${sDomain}:${iPort}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment