bool get_available() const { return available; }
const std::string &get_active_name() const { return active_name; }
const utime_t& get_active_change() const { return active_change; }
+ int get_num_standby() const { return standbys.size(); }
bool all_support_module(const std::string& module) {
if (!have_module(module)) {
cmd_getval(cmdmap, "prefix", prefix);
int r = 0;
- if (prefix == "mgr dump") {
+ if (prefix == "mgr stat") {
+ f->open_object_section("stat");
+ f->dump_unsigned("epoch", map.get_epoch());
+ f->dump_bool("available", map.get_available());
+ f->dump_string("active_name", map.get_active_name());
+ f->dump_unsigned("num_standby", map.get_num_standby());
+ f->close_section();
+ f->flush(rdata);
+ } else if (prefix == "mgr dump") {
int64_t epoch = 0;
cmd_getval(cmdmap, "epoch", epoch, (int64_t)map.get_epoch());
if (epoch == (int64_t)map.get_epoch()) {
/*
* mon/MgrMonitor.cc
*/
+COMMAND("mgr stat",
+ "dump basic info about the mgr cluster state",
+ "mgr", "r")
COMMAND("mgr dump "
"name=epoch,type=CephInt,range=0,req=false",
"dump the latest MgrMap",