]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: generate health warnings for luminous
authorSage Weil <sage@redhat.com>
Thu, 23 Feb 2017 21:35:40 +0000 (16:35 -0500)
committerSage Weil <sage@redhat.com>
Mon, 6 Mar 2017 22:21:22 +0000 (17:21 -0500)
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 <sage@redhat.com>
src/mon/OSDMonitor.cc

index ce35491888e0236475c06bab14e0acaeb91c126d..3f7b8985aede72424199d1a8a876b46754f19f60 100644 (file)
@@ -3171,7 +3171,25 @@ void OSDMonitor::get_health(list<pair<health_status_t,string> >& 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 |