]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: include some (basic) auth info in report 430/head
authorSage Weil <sage@inktank.com>
Sun, 14 Jul 2013 23:20:54 +0000 (16:20 -0700)
committerSage Weil <sage@inktank.com>
Sun, 14 Jul 2013 23:20:54 +0000 (16:20 -0700)
Nothing privileged!

Signed-off-by: Sage Weil <sage@inktank.com>
src/auth/cephx/CephxKeyServer.h
src/mon/AuthMonitor.cc
src/mon/AuthMonitor.h
src/mon/Monitor.cc

index 905eb71fe17243c6ea6ede64cc8b32cd00f9025f..bc30fef640b163cac98703fd4d7eafba780c304f 100644 (file)
@@ -268,6 +268,9 @@ public:
     map<EntityName, EntityAuth>::const_iterator b = data.secrets_begin();
     return (b != data.secrets_end());
   }
+  int get_num_secrets() {
+    return data.secrets.size();
+  }
 
   /*void add_rotating_secret(uint32_t service_id, ExpiringCryptoKey& key) {
     Mutex::Locker l(lock);
index 9f8c2ea260d81429e2c9f9e28783e23c537f6367..83b7ac2ce0cb5fa1f57451c8adc7c8733c5c64ce 100644 (file)
@@ -997,3 +997,13 @@ void AuthMonitor::upgrade_format()
     propose_pending();
   }
 }
+
+void AuthMonitor::dump_info(Formatter *f)
+{
+  /*** WARNING: do not include any privileged information here! ***/
+  f->open_object_section("auth");
+  f->dump_unsigned("first_committed", get_first_committed());
+  f->dump_unsigned("last_committed", get_last_committed());
+  f->dump_unsigned("num_secrets", mon->key_server.get_num_secrets());
+  f->close_section();
+}
index f538e737856a643f109e87a3bf59577cefddfc32..30d567a77caf6d99cd0c1a958be1130f4eb83beb 100644 (file)
@@ -157,6 +157,8 @@ private:
   void pre_auth(MAuth *m);
   
   void tick();  // check state, take actions
+
+  void dump_info(Formatter *f);
 };
 
 
index 1db1b3363f86fcb8498ff616eb41ece9e9d84b86..6a401013de07fbc681faa1b0f0bdda7240eeb811 100644 (file)
@@ -2118,6 +2118,7 @@ void Monitor::handle_command(MMonCommand *m)
     osdmon()->dump_info(f.get());
     mdsmon()->dump_info(f.get());
     pgmon()->dump_info(f.get());
+    authmon()->dump_info(f.get());
 
     paxos->dump_info(f.get());