diff --git a/director-cli.sh b/director-cli.sh
index a6311bb37508e1f0260ff3d539de47f03b71b5a0..5c7af1605ea09fb1b4e64c93b944edfebbbe353c 100755
--- a/director-cli.sh
+++ b/director-cli.sh
@@ -16,6 +16,7 @@
 # ----------------------------------------------------------------------
 # ah = axel.hahn@iml.unibe.ch
 # 2022-02-16  v0.2  ah  add --cfg param
+# 2022-03-04  v0.3  ah  abort on http 5xx error
 # ======================================================================
 
 tmpfile=/tmp/outcurl.tmp
@@ -365,6 +366,10 @@ typeset cfg_dryrun=false
     if [ ${_paramDryrun} = false ]; then
       _wd ">>>>> $_paramAction $_paramObj [${_object_name}] >> $_sMethod $_sUrl $_jsondata"
       http.makeRequest "$_sMethod" "$_sUrl" "$_jsondata"
+      if http.isServerError >/dev/null; then
+        echo "CRITICAL ERROR: Director API request failed with a server error $_sMethod $_sUrl"
+        exit 1
+      fi
       if [ $_bShowResponse = true ]; then
         http.getResponseHeader
         http.getResponse
diff --git a/icinga-cli.sh b/icinga-cli.sh
index 1db04e0ff3f9f4466f26f9fb2eb423dfdd446c34..74c36a21f1bdcb72793067b4abe9444a67c9a638 100755
--- a/icinga-cli.sh
+++ b/icinga-cli.sh
@@ -13,11 +13,12 @@
 # 2021-03-..  init
 # 2022-01-11  v0.7  ah  shellcheck
 # 2022-02-16  v0.8  ah  add --cfg param
+# 2022-03-04  v0.9  ah  abort on http 5xx error
 # ======================================================================
 
 
 _product="ICINGA PASSIVE CLIENT"
-_version="0.8"
+_version="0.9"
 _license="GNU GPL 3.0"
 _copyright='(c) 2020 Institute for Medical Education * University of Bern'
 
@@ -248,6 +249,10 @@ function icingaHost(){
       http.setCacheTtl     $_iRefreshCache
       http.setCacheFile    $_localCache
       http.makeRequest GET $_apiRequest
+      if http.isServerError >/dev/null; then
+        echo "CRITICAL ERROR: Icinga2 API request failed with a server error GET $_apiRequest"
+        exit 1
+      fi
 
       # set return code of GET action
       http.isOk >/dev/null
diff --git a/inc_functions.sh b/inc_functions.sh
index c1affcc9f1c28d06e14cab049f3a348cd279c410..2cb5268ff2ccf71a83888774a777074d21562cf5 100644
--- a/inc_functions.sh
+++ b/inc_functions.sh
@@ -232,6 +232,10 @@ function _getIpPrivate(){
   function _APIcall(){
 
     http.makeRequest "$1" "$2" "$3"
+    if http.isServerError >/dev/null; then
+      echo "CRITICAL ERROR: API request failed with a server error $1 $2"
+      exit 1
+    fi
 
     http.getResponseHeader
     http.getResponse