bool read_only = (command == "mon_status" ||
command == "mon metadata" ||
command == "quorum_status" ||
- command == "ops");
+ command == "ops" ||
+ command == "sessions");
(read_only ? audit_clog->debug() : audit_clog->info())
<< "from='admin socket' entity='admin socket' "
if (f) {
f->flush(ss);
}
+ } else if (command == "sessions") {
+
+ if (f) {
+ f->open_array_section("sessions");
+ for (auto p : session_map.sessions) {
+ f->dump_stream("session") << *p;
+ }
+ f->close_section();
+ f->flush(ss);
+ }
+
} else {
assert(0 == "bad AdminSocket command binding");
}
admin_hook,
"show the ops currently in flight");
assert(r == 0);
+ r = admin_socket->register_command("sessions",
+ "sessions",
+ admin_hook,
+ "list existing sessions");
+ assert(r == 0);
lock.Lock();
admin_socket->unregister_command("quorum enter");
admin_socket->unregister_command("quorum exit");
admin_socket->unregister_command("ops");
+ admin_socket->unregister_command("sessions");
delete admin_hook;
admin_hook = NULL;
}