summaryrefslogtreecommitdiffstats
path: root/src/mon
diff options
context:
space:
mode:
authorDavid Zafman <dzafman@redhat.com>2017-04-14 05:42:55 +0200
committerDavid Zafman <dzafman@redhat.com>2017-04-17 17:02:50 +0200
commit252230786557353f9d52cf633b6400097f9daba3 (patch)
tree53a858d9827f0d6cda217b04c928d423a6c7a4f8 /src/mon
parentmon: Issue warning or error if a full ratio out of order (diff)
downloadceph-252230786557353f9d52cf633b6400097f9daba3.tar.xz
ceph-252230786557353f9d52cf633b6400097f9daba3.zip
mon, osd: Add detailed full information for now in the mon
Show ceph health doc output in the correct order Signed-off-by: David Zafman <dzafman@redhat.com>
Diffstat (limited to 'src/mon')
-rw-r--r--src/mon/OSDMonitor.cc33
1 files changed, 25 insertions, 8 deletions
diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
index 680e9e3a6fe..0b059271fbb 100644
--- a/src/mon/OSDMonitor.cc
+++ b/src/mon/OSDMonitor.cc
@@ -3402,23 +3402,40 @@ void OSDMonitor::get_health(list<pair<health_status_t,string> >& summary,
summary.push_back(make_pair(HEALTH_ERR, ss.str()));
}
- int full, backfill, nearfull;
- osdmap.count_full_nearfull_osds(&full, &backfill, &nearfull);
- if (full > 0) {
+ map<int, float> full, backfillfull, nearfull;
+ osdmap.get_full_osd_util(mon->pgmon()->pg_map.osd_stat, &full, &backfillfull, &nearfull);
+ if (full.size()) {
ostringstream ss;
- ss << full << " full osd(s)";
+ ss << full.size() << " full osd(s)";
summary.push_back(make_pair(HEALTH_ERR, ss.str()));
}
- if (backfill > 0) {
+ if (backfillfull.size()) {
ostringstream ss;
- ss << backfill << " backfillfull osd(s)";
+ ss << backfillfull.size() << " backfillfull osd(s)";
summary.push_back(make_pair(HEALTH_WARN, ss.str()));
}
- if (nearfull > 0) {
+ if (nearfull.size()) {
ostringstream ss;
- ss << nearfull << " nearfull osd(s)";
+ ss << nearfull.size() << " nearfull osd(s)";
summary.push_back(make_pair(HEALTH_WARN, ss.str()));
}
+ if (detail) {
+ for (auto& i: full) {
+ ostringstream ss;
+ ss << "osd." << i.first << " is full at " << roundf(i.second * 100) << "%";
+ detail->push_back(make_pair(HEALTH_ERR, ss.str()));
+ }
+ for (auto& i: backfillfull) {
+ ostringstream ss;
+ ss << "osd." << i.first << " is backfill full at " << roundf(i.second * 100) << "%";
+ detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ for (auto& i: nearfull) {
+ ostringstream ss;
+ ss << "osd." << i.first << " is near full at " << roundf(i.second * 100) << "%";
+ detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ }
}
// note: we leave it to ceph-mgr to generate details health warnings
// with actual osd utilizations