ceph-mon
ceph-authtool
ceph-conf
+ ceph-exporter
monmaptool
crushtool
rados)
--- /dev/null
+#include "mgr/DaemonMetricCollector.h"
+#include <iostream>
+#include "global/global_init.h"
+#include "common/ceph_argparse.h"
+#include <map>
+
+
+int main(int argc, char** argv) {
+ // TODO: daemonize
+ std::cout << "inside exporter" << std::endl;
+ std::map<std::string,std::string> defaults = {
+ { "keyring", "$mgr_data/keyring" }
+ };
+ auto args = argv_to_vec(argc, argv);
+ auto cct = global_init(&defaults, args, CEPH_ENTITY_TYPE_EXPORTER,
+ CODE_ENVIRONMENT_DAEMON, 0);
+ DaemonMetricCollector collector;
+ collector.main();
+}
using std::string;
-const std::array<EntityName::str_to_entity_type_t, 6> EntityName::STR_TO_ENTITY_TYPE = {{
+const std::array<EntityName::str_to_entity_type_t, 7> EntityName::STR_TO_ENTITY_TYPE = {{
{ CEPH_ENTITY_TYPE_AUTH, "auth" },
{ CEPH_ENTITY_TYPE_MON, "mon" },
{ CEPH_ENTITY_TYPE_OSD, "osd" },
{ CEPH_ENTITY_TYPE_MDS, "mds" },
{ CEPH_ENTITY_TYPE_MGR, "mgr" },
+ { CEPH_ENTITY_TYPE_EXPORTER, "exporter" },
{ CEPH_ENTITY_TYPE_CLIENT, "client" },
}};
bool is_mds() const { return get_type() == CEPH_ENTITY_TYPE_MDS; }
bool is_client() const { return get_type() == CEPH_ENTITY_TYPE_CLIENT; }
bool is_mon() const { return get_type() == CEPH_ENTITY_TYPE_MON; }
+ bool is_exporter() const { return get_type() == CEPH_ENTITY_TYPE_EXPORTER; }
std::string_view get_type_name() const;
const std::string &get_id() const;
uint32_t type;
const char *str;
};
- static const std::array<str_to_entity_type_t, 6> STR_TO_ENTITY_TYPE;
+ static const std::array<str_to_entity_type_t, 7> STR_TO_ENTITY_TYPE;
uint32_t type = 0;
std::string id;
#define CEPH_ENTITY_TYPE_CLIENT 0x08
#define CEPH_ENTITY_TYPE_MGR 0x10
#define CEPH_ENTITY_TYPE_AUTH 0x20
+#define CEPH_ENTITY_TYPE_EXPORTER 0x30
#define CEPH_ENTITY_TYPE_ANY 0xFF
} else if (what.substr(0, 7) == "osd_map") {
without_gil_t no_gil;
cluster_state.with_osdmap([&](const OSDMap &osd_map){
- no_gil.acquire_gil();
if (what == "osd_map") {
osd_map.dump(&f);
} else if (what == "osd_map_tree") {
StandbyPyModules.cc
mgr_commands.cc
$<TARGET_OBJECTS:mgr_cap_obj>)
+ set(exporter_srcs
+ ${CMAKE_SOURCE_DIR}/src/ceph_exporter.cc
+ DaemonMetricCollector.cc
+ )
add_executable(ceph-mgr ${mgr_srcs})
+ add_executable(ceph-exporter ${exporter_srcs})
+ target_link_libraries(ceph-exporter
+ global-static ceph-common)
target_compile_definitions(ceph-mgr PRIVATE PY_SSIZE_T_CLEAN)
if(WITH_LIBCEPHSQLITE)
target_link_libraries(ceph-mgr cephsqlite SQLite3::SQLite3)
--- /dev/null
+#include "DaemonMetricCollector.h"
+#include <iostream>
+
+
+void DaemonMetricCollector::main() {
+ std::cout << "metric" << std::endl;
+}
--- /dev/null
+#pragma once
+
+class DaemonMetricCollector {
+ public:
+ int i;
+ void main();
+};
} else if (s.find("mgr.") == 0) {
_type = TYPE_MGR;
start += 4;
+ } else if (s.find("exporter.") == 0) {
+ _type = TYPE_EXPORTER;
+ start += 8;
} else {
return false;
}
static const int TYPE_OSD = CEPH_ENTITY_TYPE_OSD;
static const int TYPE_CLIENT = CEPH_ENTITY_TYPE_CLIENT;
static const int TYPE_MGR = CEPH_ENTITY_TYPE_MGR;
+ static const int TYPE_EXPORTER = CEPH_ENTITY_TYPE_EXPORTER;
static const int64_t NEW = -1;
static entity_name_t OSD(int64_t i=NEW) { return entity_name_t(TYPE_OSD, i); }
static entity_name_t CLIENT(int64_t i=NEW) { return entity_name_t(TYPE_CLIENT, i); }
static entity_name_t MGR(int64_t i=NEW) { return entity_name_t(TYPE_MGR, i); }
+ static entity_name_t EXPORTER(int64_t i=NEW) { return entity_name_t(TYPE_EXPORTER, i); }
int64_t num() const { return _num; }
int type() const { return _type; }
bool is_osd() const { return type() == TYPE_OSD; }
bool is_mon() const { return type() == TYPE_MON; }
bool is_mgr() const { return type() == TYPE_MGR; }
+ bool is_exporter() const { return type() == TYPE_EXPORTER; }
operator ceph_entity_name() const {
ceph_entity_name n = { _type, ceph_le64(_num) };
add_subdirectory(dashboard)
-if(WITH_MGR_ROOK_CLIENT)
- add_subdirectory(rook)
-endif()
+# if(WITH_MGR_ROOK_CLIENT)
+# add_subdirectory(rook)
+# endif()
if(WITH_TESTS)
include(AddCephTest)
add_tox_test(mgr ${CMAKE_CURRENT_SOURCE_DIR} TOX_ENVS py3 py37 mypy flake8 jinjalint nooptional)
mds root ino gid = `id -g`
$(format_conf "${extra_conf}")
[mgr]
- mgr disabled modules = rook
mgr data = $CEPH_DEV_DIR/mgr.\$id
mgr module path = $MGR_PYTHON_PATH
cephadm path = $CEPH_ROOT/src/cephadm/cephadm
$(format_conf "${extra_conf}")
[mon]
mon_data_avail_crit = 1
+ mgr disabled modules = rook
mgr initial modules = $mgr_modules
$DAEMONOPTS
$CMONDEBUG