#include "Monitor.h"
#include "common/version.h"
+#include "common/blkdev.h"
#include "osd/OSDMap.h"
collect_sys_info(m, g_ceph_context);
(*m)["addr"] = stringify(messenger->get_myaddr());
(*m)["compression_algorithms"] = collect_compression_algorithms();
+
+ // infer storage device
+ string devname = store->get_devname();
+ if (devname.size()) {
+ (*m)["devices"] = devname;
+ string id = get_device_id(devname);
+ if (id.size()) {
+ (*m)["device_ids"] = string(devname) + "=" + id;
+ } else {
+ derr << "failed to get devid for " << devname << dendl;
+ }
+ }
}
void Monitor::finish_election()
#include "common/errno.h"
#include "common/debug.h"
#include "common/safe_io.h"
+#include "common/blkdev.h"
#define dout_context g_ceph_context
public:
+ string get_devname() {
+ char devname[4096] = {0}, partition[4096];
+ get_device_by_path(path.c_str(), partition, devname,
+ sizeof(devname));
+ return devname;
+ }
+
struct Op {
uint8_t type;
string prefix;