]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: include addr in HOST_CHECK_FAILED alert detail
authorSage Weil <sage@newdream.net>
Fri, 18 Jun 2021 23:05:36 +0000 (19:05 -0400)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 10 Aug 2021 14:31:21 +0000 (16:31 +0200)
Signed-off-by: Sage Weil <sage@newdream.net>
(cherry picked from commit 929f2819735aa7799a11d2e60665d2b5173a4a52)

src/pybind/mgr/cephadm/serve.py

index 3a2128e4958045ca6e1b9b43a9e8edd6c848887e..ff14caab354badf70153686ae00c9902111b7693 100644 (file)
@@ -368,20 +368,21 @@ class CephadmServe:
             return None
         self.log.debug(' checking %s' % host)
         try:
+            addr = self.mgr.inventory.get_addr(host) if host in self.mgr.inventory else host
             out, err, code = self._run_cephadm(
                 host, cephadmNoImage, 'check-host', [],
                 error_ok=True, no_fsid=True)
             self.mgr.cache.update_last_host_check(host)
             self.mgr.cache.save_host(host)
             if code:
-                self.log.debug(' host %s failed check' % host)
+                self.log.debug(' host %s (%s) failed check' % (host, addr))
                 if self.mgr.warn_on_failed_host_check:
-                    return 'host %s failed check: %s' % (host, err)
+                    return 'host %s (%s) failed check: %s' % (host, addr, err)
             else:
-                self.log.debug(' host %s ok' % host)
+                self.log.debug(' host %s (%s) ok' % (host, addr))
         except Exception as e:
-            self.log.debug(' host %s failed check' % host)
-            return 'host %s failed check: %s' % (host, e)
+            self.log.debug(' host %s (%s) failed check' % (host, addr))
+            return 'host %s (%s) failed check: %s' % (host, addr, e)
         return None
 
     def _refresh_host_daemons(self, host: str) -> Optional[str]: