From d795c3c457398e62c6d82200ff17c53083f29f3f Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 23 Feb 2017 16:35:40 -0500 Subject: [PATCH] mon/OSDMonitor: generate health warnings for luminous Note that this tells us how many OSDs are full or nearfull; it does not include detailed warnings telling you exactly what the utilization is because we don't have the full osd_stat_t available. We leave it to ceph-mgr to generate those health messages. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index ce35491888e..3f7b8985aed 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3171,7 +3171,25 @@ void OSDMonitor::get_health(list >& summary, ss << " osds: [" << osds << "]"; detail->push_back(make_pair(HEALTH_WARN, ss.str())); } - } + } + + if (osdmap.test_flag(CEPH_OSDMAP_REQUIRE_LUMINOUS)) { + int full, nearfull; + osdmap.count_full_nearfull_osds(&full, &nearfull); + if (full > 0) { + ostringstream ss; + ss << full << " full osds(s)"; + summary.push_back(make_pair(HEALTH_ERR, ss.str())); + } + if (nearfull > 0) { + ostringstream ss; + ss << nearfull << " nearfull osds(s)"; + summary.push_back(make_pair(HEALTH_WARN, ss.str())); + } + } + // note: we leave it to ceph-mgr to generate details health warnings + // with actual osd utilizations + // warn about flags uint64_t warn_flags = CEPH_OSDMAP_FULL |