diff --git a/server/modules/monitor/CMakeLists.txt b/server/modules/monitor/CMakeLists.txt index a36777be7..d4743e1db 100644 --- a/server/modules/monitor/CMakeLists.txt +++ b/server/modules/monitor/CMakeLists.txt @@ -1,7 +1,8 @@ add_subdirectory(auroramon) +add_subdirectory(clustrixmon) +add_subdirectory(csmon) add_subdirectory(galeramon) add_subdirectory(grmon) add_subdirectory(mariadbmon) add_subdirectory(mmmon) add_subdirectory(ndbclustermon) -add_subdirectory(csmon) diff --git a/server/modules/monitor/clustrixmon/CMakeLists.txt b/server/modules/monitor/clustrixmon/CMakeLists.txt new file mode 100644 index 000000000..72527477d --- /dev/null +++ b/server/modules/monitor/clustrixmon/CMakeLists.txt @@ -0,0 +1,7 @@ +add_library(clustrixmon SHARED + clustrixmon.cc + clustrixmonitor.cc + ) +target_link_libraries(clustrixmon maxscale-common) +set_target_properties(clustrixmon PROPERTIES VERSION "1.0.0" LINK_FLAGS -Wl,-z,defs) +install_module(clustrixmon core) diff --git a/server/modules/monitor/clustrixmon/clustrixmon.cc b/server/modules/monitor/clustrixmon/clustrixmon.cc new file mode 100644 index 000000000..19a9f50c1 --- /dev/null +++ b/server/modules/monitor/clustrixmon/clustrixmon.cc @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2022-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ + +#include "clustrixmon.hh" +#include +#include "clustrixmonitor.hh" + +/** + * The module entry point routine. It is this routine that + * must populate the structure that is referred to as the + * "module object", this is a structure with the set of + * external entry points for this module. + * + * @return The module object + */ +extern "C" MXS_MODULE* MXS_CREATE_MODULE() +{ + MXS_NOTICE("Initialise the MariaDB Clustrix Monitor module."); + + static MXS_MODULE info = + { + MXS_MODULE_API_MONITOR, + MXS_MODULE_GA, + MXS_MONITOR_VERSION, + "A Clustrix cluster monitor", + "V1.0.0", + MXS_NO_MODULE_CAPABILITIES, + &maxscale::MonitorApi::s_api, + NULL, /* Process init. */ + NULL, /* Process finish. */ + NULL, /* Thread init. */ + NULL, /* Thread finish. */ + { + {MXS_END_MODULE_PARAMS} + } + }; + + return &info; +} diff --git a/server/modules/monitor/clustrixmon/clustrixmon.hh b/server/modules/monitor/clustrixmon/clustrixmon.hh new file mode 100644 index 000000000..f8cbb5dc9 --- /dev/null +++ b/server/modules/monitor/clustrixmon/clustrixmon.hh @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2018 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2022-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ +#pragma once + +#define MXS_MODULE_NAME "clustrixmon" + +#include +#include + diff --git a/server/modules/monitor/clustrixmon/clustrixmonitor.cc b/server/modules/monitor/clustrixmon/clustrixmonitor.cc new file mode 100644 index 000000000..e3e6ea8f6 --- /dev/null +++ b/server/modules/monitor/clustrixmon/clustrixmonitor.cc @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2022-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ + +#include "clustrixmonitor.hh" + + +ClustrixMonitor::ClustrixMonitor(MXS_MONITOR* pMonitor) + : maxscale::MonitorInstance(pMonitor) +{ +} + +//static +ClustrixMonitor* ClustrixMonitor::create(MXS_MONITOR* pMonitor) +{ + return new ClustrixMonitor(pMonitor); +} + +void ClustrixMonitor::tick() +{ +} diff --git a/server/modules/monitor/clustrixmon/clustrixmonitor.hh b/server/modules/monitor/clustrixmon/clustrixmonitor.hh new file mode 100644 index 000000000..96b191b11 --- /dev/null +++ b/server/modules/monitor/clustrixmon/clustrixmonitor.hh @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018 MariaDB Corporation Ab + * + * Use of this software is governed by the Business Source License included + * in the LICENSE.TXT file and at www.mariadb.com/bsl11. + * + * Change Date: 2022-01-01 + * + * On the date above, in accordance with the Business Source License, use + * of this software will be governed by version 2 or later of the General + * Public License. + */ +#pragma once + +#include "clustrixmon.hh" +#include + +class ClustrixMonitor : public maxscale::MonitorInstance +{ + ClustrixMonitor(const ClustrixMonitor&) = delete; + ClustrixMonitor& operator=(const ClustrixMonitor&) = delete; +public: + + static ClustrixMonitor* create(MXS_MONITOR* pMonitor); + +private: + ClustrixMonitor(MXS_MONITOR* pMonitor); + + void tick(); +};