]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Always provide summary for non-healthy cluster. 4867/head
authorThorsten Behrens <tbehrens@suse.com>
Fri, 6 Feb 2015 00:26:40 +0000 (01:26 +0100)
committerNathan Cutler <ncutler@suse.com>
Wed, 22 Jul 2015 06:39:57 +0000 (08:39 +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>
(cherry picked from commit eaf6e0cf48488fe604d0ef0db164d44948d4e8d4)

Conflicts:
src/mon/Monitor.cc
            firefly needs ss

src/mon/Monitor.cc

index c39faad23e27660a876b5c7e38494e95b75370d0..371341c998b99a0a4eb48656cd6947e14762ef8c 100644 (file)
@@ -1925,30 +1925,6 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
 
   health_monitor->get_health(f, summary, (detailbl ? &detail : NULL));
 
-  if (f)
-    f->open_array_section("summary");
-  stringstream ss;
-  health_status_t overall = HEALTH_OK;
-  if (!summary.empty()) {
-    ss << ' ';
-    while (!summary.empty()) {
-      if (overall > summary.front().first)
-       overall = summary.front().first;
-      ss << 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 (!summary.empty())
-       ss << "; ";
-    }
-  }
-  if (f)
-    f->close_section();
-
   if (f) {
     f->open_object_section("timechecks");
     f->dump_int("epoch", get_epoch());
@@ -1957,6 +1933,8 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
       << ((timecheck_round%2) ? "on-going" : "finished");
   }
 
+  stringstream ss;
+  health_status_t overall = HEALTH_OK;
   if (!timecheck_skews.empty()) {
     list<string> warns;
     if (f)
@@ -2003,6 +1981,7 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
         if (!warns.empty())
           ss << ",";
       }
+      summary.push_back(make_pair(HEALTH_WARN, "Monitor clock skew detected "));
     }
     if (f)
       f->close_section();
@@ -2010,6 +1989,28 @@ void Monitor::get_health(string& status, bufferlist *detailbl, Formatter *f)
   if (f)
     f->close_section();
 
+  if (f)
+    f->open_array_section("summary");
+  if (!summary.empty()) {
+    ss << ' ';
+    while (!summary.empty()) {
+      if (overall > summary.front().first)
+       overall = summary.front().first;
+      ss << 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 (!summary.empty())
+        ss << "; ";
+    }
+  }
+  if (f)
+    f->close_section();
+
   stringstream fss;
   fss << overall;
   status = fss.str() + ss.str();