]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Always provide summary for non-healthy cluster. 3659/head
authorThorsten Behrens <tbehrens@suse.com>
Fri, 6 Feb 2015 00:26:40 +0000 (01:26 +0100)
committerThorsten Behrens <tbehrens@suse.com>
Mon, 30 Mar 2015 01:28:55 +0000 (03:28 +0200)
This fixes a problem, wherein calamari does not provide
popup drill-downs for warnings or errors, should the summary
be missing.

Calamari gets health info from /api/v1/cluster/$FSID/health.
If the data here has a summary field, this summary is provided
in a popup window:

  /api/v1/cluster/$FSID/health is populated (ultimately) with
  status obtained via librados python bindings from the ceph
  cluster. In the case where there's clock skew, the summary
  field supplied by the ceph cluster is empty.

No summary field, no popup window with more health details.

Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
src/mon/Monitor.cc

index 6344b32b56c4457c66eedc2b57c7d8b61de6067d..8a98c2b9672fccaba4fa988ef9f11b4728236200 100644 (file)
@@ -2246,26 +2246,6 @@ health_status_t Monitor::get_health(list<string>& status,
 
   health_monitor->get_health(f, summary, (detailbl ? &detail : NULL));
 
-  if (f)
-    f->open_array_section("summary");
-  health_status_t overall = HEALTH_OK;
-  if (!summary.empty()) {
-    while (!summary.empty()) {
-      if (overall > summary.front().first)
-       overall = summary.front().first;
-      status.push_back(summary.front().second);
-      if (f) {
-        f->open_object_section("item");
-        f->dump_stream("severity") <<  summary.front().first;
-        f->dump_string("summary", summary.front().second);
-        f->close_section();
-      }
-      summary.pop_front();
-    }
-  }
-  if (f)
-    f->close_section();
-
   if (f) {
     f->open_object_section("timechecks");
     f->dump_unsigned("epoch", get_epoch());
@@ -2274,6 +2254,7 @@ health_status_t Monitor::get_health(list<string>& status,
       << ((timecheck_round%2) ? "on-going" : "finished");
   }
 
+  health_status_t overall = HEALTH_OK;
   if (!timecheck_skews.empty()) {
     list<string> warns;
     if (f)
@@ -2320,6 +2301,7 @@ health_status_t Monitor::get_health(list<string>& status,
           ss << ",";
       }
       status.push_back(ss.str());
+      summary.push_back(make_pair(HEALTH_WARN, "Monitor clock skew detected "));
     }
     if (f)
       f->close_section();
@@ -2327,6 +2309,25 @@ health_status_t Monitor::get_health(list<string>& status,
   if (f)
     f->close_section();
 
+  if (f)
+    f->open_array_section("summary");
+  if (!summary.empty()) {
+    while (!summary.empty()) {
+      if (overall > summary.front().first)
+       overall = summary.front().first;
+      status.push_back(summary.front().second);
+      if (f) {
+        f->open_object_section("item");
+        f->dump_stream("severity") <<  summary.front().first;
+        f->dump_string("summary", summary.front().second);
+        f->close_section();
+      }
+      summary.pop_front();
+    }
+  }
+  if (f)
+    f->close_section();
+
   stringstream fss;
   fss << overall;
   status.push_front(fss.str());