From: Sage Weil Date: Fri, 18 Jun 2021 23:05:36 +0000 (-0400) Subject: mgr/cephadm: include addr in HOST_CHECK_FAILED alert detail X-Git-Tag: v16.2.6~54^2~64 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9c7bcf98c4072984b14bb9c83ac1312896f4d8df;p=ceph.git mgr/cephadm: include addr in HOST_CHECK_FAILED alert detail Signed-off-by: Sage Weil (cherry picked from commit 929f2819735aa7799a11d2e60665d2b5173a4a52) --- diff --git a/src/pybind/mgr/cephadm/serve.py b/src/pybind/mgr/cephadm/serve.py index 3a2128e4958..ff14caab354 100644 --- a/src/pybind/mgr/cephadm/serve.py +++ b/src/pybind/mgr/cephadm/serve.py @@ -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]: