diff --git a/check_ceph_osd b/check_ceph_osd
index aacd9317de67dfd3a12fddfef57a9c0eb06d1a49..bbe1dd512c1f657bca971cd174f472e0a1878fab 100755
--- a/check_ceph_osd
+++ b/check_ceph_osd
@@ -26,12 +26,13 @@
 # 2022-10-21  v1.3  <axel.hahn@unibe.ch>     remove grep: warning: stray \ before white space
 # 2023-04-24  v1.4  <axel.hahn@unibe.ch>     update for newer ceph versions
 # 2023-06-19  v1.5  <axel.hahn@unibe.ch>     add help and param support; no more tmpfile
+# 2023-07-27  v1.6  <axel.hahn@unibe.ch>     shorten ceph exec; show output on error; shell fixes
 # ======================================================================
 
 . $(dirname $0)/inc_pluginfunctions
 
 self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
-self_APPVERSION=1.5
+self_APPVERSION=1.6
 
 # column number in output where to find the up/ down info
 iColUpDown=5
@@ -94,19 +95,18 @@ case "$1" in
     *)
 esac
 
-data=$( sudo /bin/ceph osd tree 2>&1 )
-if [ $? -ne 0 ]; then
+if ! data=$( sudo /bin/ceph osd tree 2>&1 ); then
+    echo "$data"
     ph.abort "UNKNOWN: ceph is not available or no sudo permissions to execute ceph commands."
 fi
 
 # set default / override from command line params
-typeset -i iWarnLimit=$(     ph.getValueWithParam 1 w "$@")
-typeset -i iCriticalLimit=$( ph.getValueWithParam 2 c "$@")
-
-typeset -i iOsdTotal=$( getOsd | wc -l)
-typeset -i iOsdDown=$(  getOsd | awk '{ print $iColUpDown }' | grep "down" | wc -l)
-typeset -i iOsdUp=$(    getOsd | awk '{ print $iColUpDown }' | grep "up"   | wc -l)
+typeset -i iWarnLimit;     iWarnLimit=$(     ph.getValueWithParam 1 w "$@")
+typeset -i iCriticalLimit; iCriticalLimit=$( ph.getValueWithParam 2 c "$@")
 
+typeset -i iOsdTotal;      iOsdTotal=$( getOsd | wc -l)
+typeset -i iOsdDown;       iOsdDown=$(  getOsd | awk '{ print $iColUpDown }' | grep "down" | wc -l)
+typeset -i iOsdUp;         iOsdUp=$(    getOsd | awk '{ print $iColUpDown }' | grep "up"   | wc -l)
 
 if [ $iOsdDown -lt $iWarnLimit ]; then
     ph.setStatus "ok"
diff --git a/docs/20_Checks/check_ceph_osd.md b/docs/20_Checks/check_ceph_osd.md
index 8855aecf4f6b1462fffa9fbdda75f704638b5ee5..d1a09a65b9f716046b197207d0f0c8d081ab2942 100644
--- a/docs/20_Checks/check_ceph_osd.md
+++ b/docs/20_Checks/check_ceph_osd.md
@@ -18,7 +18,7 @@ critical level.
 ______________________________________________________________________
 
 CHECK_CEPH_OSD 
-v1.5
+v1.6
 
 (c) Institute for Medical Education - University of Bern
 Licence: GNU GPL 3