From 38b481153ad6ac814e8b3fc1824dad3395b7b02a Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Wed, 23 Aug 2023 16:50:41 +0200
Subject: [PATCH] fix wrong exitcode to "critical"

---
 check_haproxy_health | 7 ++++---
 check_ssl            | 7 ++++---
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/check_haproxy_health b/check_haproxy_health
index 7f7590d..1be5adc 100755
--- a/check_haproxy_health
+++ b/check_haproxy_health
@@ -12,12 +12,13 @@
 # 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-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
 
-export self_APPVERSION=1.6
+export self_APPVERSION=1.7
 
 . $(dirname $0)/inc_haproxy_cfg.sh
 
@@ -106,7 +107,7 @@ fi
 
 grep "200 OK" $tmpfile >/dev/null
 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)"
 else
   ph.status "HA Proxy $safeurl is up and running."
diff --git a/check_ssl b/check_ssl
index e80f5d9..77e8938 100755
--- a/check_ssl
+++ b/check_ssl
@@ -15,8 +15,9 @@
 # ds=daniel.schueler@iml.unibe.ch
 #
 # 2017-03-03  v1.0  ah,ds
-# 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
+# 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-08-23  v1.3  <axel.hahn@unibe.ch>      fix wrong exitcode to "critical"
 # ======================================================================
 
 
@@ -75,7 +76,7 @@ function showHelp(){
 
   echo | openssl s_client -connect ${sDomain}:${iPort} >/dev/null 2>&1  
   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"
     # repeat the last command without redirecting output
     echo | openssl s_client -connect ${sDomain}:${iPort}
-- 
GitLab