From 1f56b4cca3d2cec469b8396cc01afdb422964bf6 Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch>
Date: Thu, 29 Feb 2024 11:53:11 +0100
Subject: [PATCH] show restore progress only for misplaed/ degraded objects

---
 check_ceph_status                   | 8 ++++----
 docs/20_Checks/check_ceph_status.md | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/check_ceph_status b/check_ceph_status
index 59a4022..d2e25fe 100755
--- a/check_ceph_status
+++ b/check_ceph_status
@@ -22,11 +22,12 @@
 # 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>      update help page
 # 2023-10-20  v1.7  <axel.hahn@unibe.ch>      harden sudo command execution
+# 2024-02-29  v1.8  <axel.hahn@unibe.ch>      show restore progress only for misplaed/ degraded objects
 # ======================================================================
 
 . $(dirname $0)/inc_pluginfunctions
 
-export self_APPVERSION=1.7
+export self_APPVERSION=1.8
 
 initfile="/tmp/ceph-status-not-ok-start-$USER"
 
@@ -114,6 +115,7 @@ fi
 
 iLastDeg=$iDeg
 iLastMis=$iMis
+typeset -i iObjCount=$iDeg+$iMis
 
 sCephStatus=$(getCephStatus)
 
@@ -130,9 +132,7 @@ fi
 ph.status "Ceph status is $sCephStatus"
 echo
 
-while [ ! "$sCephStatus" = "HEALTH_OK" ] && [ $doLoop = 1 ]; do
-
-        typeset -i iObjCount=$iDeg+$iMis
+while [ ! "$sCephStatus" = "HEALTH_OK" ] && [ $iObjCount -gt 0 ] && [ $doLoop = 1 ]; do
 
         iTsNow=$( date +%s )
 
diff --git a/docs/20_Checks/check_ceph_status.md b/docs/20_Checks/check_ceph_status.md
index abce980..e4e8d41 100644
--- a/docs/20_Checks/check_ceph_status.md
+++ b/docs/20_Checks/check_ceph_status.md
@@ -19,7 +19,7 @@ icingaclient ALL=(ALL) NOPASSWD: /bin/ceph
 ______________________________________________________________________
 
 CHECK_CEPH_STATUS
-v1.7
+v1.8
 
 (c) Institute for Medical Education - University of Bern
 Licence: GNU GPL 3
-- 
GitLab