diff --git a/cfg_checker/modules/ceph/__init__.py b/cfg_checker/modules/ceph/__init__.py
index d3f9581..62941d5 100644
--- a/cfg_checker/modules/ceph/__init__.py
+++ b/cfg_checker/modules/ceph/__init__.py
@@ -185,9 +185,14 @@
     ceph_bench.prepare_agents(_opts)
     if not ceph_bench.run_benchmark(_opts):
         # No cleaning and/or report if benchmark was not finished
+        logger_cli.info("# Abnormal benchmark run, no cleaning performed")
         return
     if not config.no_cleaning_after_benchmark:
         ceph_bench.cleanup()
+    else:
+        logger_cli.info(
+            "# '--no-cleaning' option set. Cleaning not conducted."
+        )
 
     # Create report
     ceph_bench.create_report(_filename)
diff --git a/cfg_checker/modules/ceph/bench.py b/cfg_checker/modules/ceph/bench.py
index dd96a69..5fa4cfd 100644
--- a/cfg_checker/modules/ceph/bench.py
+++ b/cfg_checker/modules/ceph/bench.py
@@ -6,6 +6,7 @@
 from time import sleep
 
 from cfg_checker.common import logger_cli
+from cfg_checker.helpers.console_utils import Progress
 # from cfg_checker.common.exception import InvalidReturnException
 # from cfg_checker.common.exception import ConfigException
 # from cfg_checker.common.exception import KubeException
@@ -108,8 +109,8 @@
     def _poke_agent(self, url, body, action="GET"):
         _datafile = "/tmp/data"
         _data = [
-            "--data-binary",
-            "@" + _datafile,
+            "-d",
+            "@" + _datafile
         ]
         _cmd = [
             "curl",
@@ -161,7 +162,7 @@
             _h = _s["healthcheck"]["hostname"]
             _t = _s['status']
             _r = _s["healthcheck"]["ready"]
-            if _t != "idle":
+            if _t not in ["idle", "finished"]:
                 logger_cli.error("Agent status invalid {}:{}".format(_h, _t))
                 _tt += [False]
             else:
@@ -228,11 +229,11 @@
                 )
             # recalc how much is left
             diff = (_end - datetime.now()).total_seconds()
-            logger_cli.debug("... [{}s]: {}".format(diff, _str))
+            logger_cli.debug("... [{:.2f}s]: {}".format(diff, _str))
             # In case end_datetime was in past to begin with
             if diff < 0:
                 break
-            logger_cli.info("-> Sleeping for {}s".format(diff/2))
+            logger_cli.info("-> Sleeping for {:.2f}s".format(diff/2))
             sleep(diff/2)
             if diff <= 0.1:
                 break
@@ -245,7 +246,30 @@
 
         for _res in self.cleanup_list:
             self.master.cleanup_resource_by_name(_res[0], _res[2], ns=_res[1])
-        logger_cli.info("# Done cleaning up")
+
+        # Wait for resource to be cleaned
+        _timeout = 120
+        _total = len(self.cleanup_list)
+        logger_cli.info("-> Wait until {} resources cleaned".format(_total))
+        _p = Progress(_total)
+        while True:
+            _g = self.master.get_resource_phase_by_name
+            _l = [_g(r[0], r[2], ns=r[1]) for r in self.cleanup_list]
+            _l = [item for item in _l if item]
+            _idx = _total - len(_l)
+            if len(_l) > 0:
+                _p.write_progress(_idx)
+            else:
+                _p.end()
+                logger_cli.info("# Done cleaning up")
+                break
+            if _timeout > 0:
+                _timeout -= 1
+            else:
+                _p.end()
+                logger_cli.info("# Timed out waiting after 120s.")
+                break
+
         return
 
     # Create report
