diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 200 |
1 files changed, 187 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ddce9882..d21ea89c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -490,14 +490,38 @@ set(EBPF_PROCESS_PLUGIN_FILES collectors/ebpf.plugin/ebpf_cachestat.h collectors/ebpf.plugin/ebpf_dcstat.c collectors/ebpf.plugin/ebpf_dcstat.h + collectors/ebpf.plugin/ebpf_disk.c + collectors/ebpf.plugin/ebpf_disk.h + collectors/ebpf.plugin/ebpf_fd.c + collectors/ebpf.plugin/ebpf_fd.h + collectors/ebpf.plugin/ebpf_hardirq.c + collectors/ebpf.plugin/ebpf_hardirq.h + collectors/ebpf.plugin/ebpf_mdflush.c + collectors/ebpf.plugin/ebpf_mdflush.h + collectors/ebpf.plugin/ebpf_mount.c + collectors/ebpf.plugin/ebpf_mount.h + collectors/ebpf.plugin/ebpf_filesystem.c + collectors/ebpf.plugin/ebpf_filesystem.h + collectors/ebpf.plugin/ebpf_oomkill.c + collectors/ebpf.plugin/ebpf_oomkill.h collectors/ebpf.plugin/ebpf_process.c collectors/ebpf.plugin/ebpf_process.h + collectors/ebpf.plugin/ebpf_shm.c + collectors/ebpf.plugin/ebpf_shm.h collectors/ebpf.plugin/ebpf_socket.c collectors/ebpf.plugin/ebpf_socket.h + collectors/ebpf.plugin/ebpf_softirq.c + collectors/ebpf.plugin/ebpf_softirq.h collectors/ebpf.plugin/ebpf_sync.c collectors/ebpf.plugin/ebpf_sync.h + collectors/ebpf.plugin/ebpf_swap.c + collectors/ebpf.plugin/ebpf_swap.h + collectors/ebpf.plugin/ebpf_vfs.c + collectors/ebpf.plugin/ebpf_vfs.h collectors/ebpf.plugin/ebpf_apps.c collectors/ebpf.plugin/ebpf_apps.h + collectors/ebpf.plugin/ebpf_cgroup.c + collectors/ebpf.plugin/ebpf_cgroup.h ) set(PROC_PLUGIN_FILES @@ -611,6 +635,16 @@ set(RRD_PLUGIN_FILES database/rrdvar.h database/sqlite/sqlite_functions.c database/sqlite/sqlite_functions.h + database/sqlite/sqlite_aclk.c + database/sqlite/sqlite_aclk.h + database/sqlite/sqlite_health.c + database/sqlite/sqlite_health.h + database/sqlite/sqlite_aclk_node.c + database/sqlite/sqlite_aclk_node.h + database/sqlite/sqlite_aclk_chart.c + database/sqlite/sqlite_aclk_chart.h + database/sqlite/sqlite_aclk_alert.c + database/sqlite/sqlite_aclk_alert.h database/sqlite/sqlite3.c database/sqlite/sqlite3.h database/engine/rrdengine.c @@ -724,12 +758,22 @@ set(BACKENDS_PLUGIN_FILES set(CLAIM_PLUGIN_FILES claim/claim.c claim/claim.h - aclk/legacy/aclk_rrdhost_state.h - aclk/legacy/aclk_common.c - aclk/legacy/aclk_common.h ) -set(ACLK_PLUGIN_FILES +set(ACLK_ALWAYS_BUILD + aclk/aclk_rrdhost_state.h + aclk/aclk_api.c + aclk/aclk_api.h + aclk/aclk_proxy.c + aclk/aclk_proxy.h + ) + +set(ACLK_COMMON_FILES + aclk/aclk_collector_list.c + aclk/aclk_collector_list.h + ) + +set(ACLK_LEGACY_FILES aclk/legacy/agent_cloud_link.c aclk/legacy/agent_cloud_link.h aclk/legacy/aclk_query.c @@ -744,6 +788,63 @@ set(ACLK_PLUGIN_FILES aclk/legacy/aclk_stats.h aclk/legacy/aclk_rx_msgs.c aclk/legacy/aclk_rx_msgs.h + aclk/legacy/aclk_common.c + aclk/legacy/aclk_common.h + ) + +set(ACLK_NG_FILES + aclk/aclk.c + aclk/aclk.h + aclk/aclk_util.c + aclk/aclk_util.h + aclk/aclk_stats.c + aclk/aclk_stats.h + aclk/aclk_query.c + aclk/aclk_query.h + aclk/aclk_query_queue.c + aclk/aclk_query_queue.h + aclk/aclk_otp.c + aclk/aclk_otp.h + aclk/aclk_tx_msgs.c + aclk/aclk_tx_msgs.h + aclk/aclk_rx_msgs.c + aclk/aclk_rx_msgs.h + aclk/https_client.c + aclk/https_client.h + aclk/aclk_charts_api.c + aclk/aclk_charts_api.h + aclk/aclk_alarm_api.c + aclk/aclk_alarm_api.h + mqtt_websockets/src/mqtt_wss_client.c + mqtt_websockets/src/include/mqtt_wss_client.h + mqtt_websockets/src/mqtt_wss_log.c + mqtt_websockets/src/include/mqtt_wss_log.h + mqtt_websockets/src/ws_client.c + mqtt_websockets/src/include/ws_client.h + mqtt_websockets/c-rbuf/src/ringbuffer.c + mqtt_websockets/c-rbuf/include/ringbuffer.h + mqtt_websockets/c-rbuf/src/ringbuffer_internal.h + mqtt_websockets/MQTT-C/src/mqtt.c + mqtt_websockets/MQTT-C/include/mqtt.h + aclk/schema-wrappers/connection.cc + aclk/schema-wrappers/connection.h + aclk/schema-wrappers/node_connection.cc + aclk/schema-wrappers/node_connection.h + aclk/schema-wrappers/node_creation.cc + aclk/schema-wrappers/node_creation.h + aclk/schema-wrappers/chart_stream.cc + aclk/schema-wrappers/chart_stream.h + aclk/schema-wrappers/chart_config.cc + aclk/schema-wrappers/chart_config.h + aclk/schema-wrappers/alarm_stream.cc + aclk/schema-wrappers/alarm_stream.h + aclk/schema-wrappers/alarm_config.cc + aclk/schema-wrappers/alarm_config.h + aclk/schema-wrappers/node_info.cc + aclk/schema-wrappers/node_info.h + aclk/schema-wrappers/schema_wrappers.h + aclk/schema-wrappers/schema_wrapper_utils.cc + aclk/schema-wrappers/schema_wrapper_utils.h ) set(SPAWN_PLUGIN_FILES @@ -753,7 +854,7 @@ set(SPAWN_PLUGIN_FILES spawn/spawn.h ) -set(ACLK_STATIC_LIBS +set(ACLK_LEGACY_STATIC_LIBS ${CMAKE_SOURCE_DIR}/externaldeps/mosquitto/libmosquitto.a ${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/libwebsockets.a ) @@ -836,12 +937,19 @@ set(DAEMON_FILES daemon/main.h daemon/signals.c daemon/signals.h + daemon/service.c + daemon/service.h daemon/commands.c daemon/commands.h daemon/unit_test.c daemon/unit_test.h ) +set(ML_FILES + ml/ml.h + ml/ml-dummy.c +) + set(NETDATA_FILES collectors/all.h ${DAEMON_FILES} @@ -851,6 +959,7 @@ set(NETDATA_FILES ${CHECKS_PLUGIN_FILES} ${HEALTH_PLUGIN_FILES} ${IDLEJITTER_PLUGIN_FILES} + ${ML_FILES} ${PLUGINSD_PLUGIN_FILES} ${RRD_PLUGIN_FILES} ${REGISTRY_PLUGIN_FILES} @@ -961,21 +1070,21 @@ ENDIF() set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT}) -set(ACLK_CAN_BUILD 1) +set(ACLK_LEGACY_CAN_BUILD 1) if(NOT EXISTS "${CMAKE_SOURCE_DIR}/externaldeps/mosquitto/libmosquitto.a") message(WARNING "Static build of mosquitto not found. Disabling ACLK") - set(ACLK_CAN_BUILD 0) + set(ACLK_LEGACY_CAN_BUILD 0) ENDIF() if(NOT EXISTS "${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/libwebsockets.a") message(WARNING "Static build of libwebsockets not found. Disabling ACLK") - set(ACLK_CAN_BUILD 0) + set(ACLK_LEGACY_CAN_BUILD 0) ENDIF() -IF(ACLK_CAN_BUILD) - message(STATUS "agent-cloud-link: enabled") - list(APPEND NETDATA_FILES ${ACLK_PLUGIN_FILES}) - list(APPEND NETDATA_COMMON_LIBRARIES ${ACLK_STATIC_LIBS}) +IF(ACLK_LEGACY_CAN_BUILD) + message(STATUS "agent-cloud-link Legacy: enabled") + list(APPEND NETDATA_FILES ${ACLK_LEGACY_FILES}) + list(APPEND NETDATA_COMMON_LIBRARIES ${ACLK_LEGACY_STATIC_LIBS}) include_directories(BEFORE ${CMAKE_SOURCE_DIR}/externaldeps/libwebsockets/include) IF(LINUX AND CAP_FOUND) list(APPEND NETDATA_COMMON_LIBRARIES ${CAP_LIBRARIES}) @@ -983,9 +1092,74 @@ IF(ACLK_CAN_BUILD) list(APPEND NETDATA_COMMON_CFLAGS ${CAP_CFLAGS_OTHER}) ENDIF() ELSE() - message(STATUS "agent-cloud-link: disabled") + message(STATUS "agent-cloud-link Legacy: disabled") ENDIF() +find_package(Protobuf REQUIRED) + +function(PROTOBUF_ACLK_GENERATE_CPP SRCS HDRS) + if(NOT ARGN) + message(SEND_ERROR "Error: PROTOBUF_ACLK_GENERATE_CPP() called without any proto files") + return() + endif() + + set(${SRCS}) + set(${HDRS}) + foreach(FIL ${ARGN}) + get_filename_component(ABS_FIL ${FIL} ABSOLUTE) + get_filename_component(DIR ${ABS_FIL} DIRECTORY) + get_filename_component(FIL_WE ${FIL} NAME_WE) + set(GENERATED_PB_CC "${DIR}/${FIL_WE}.pb.cc") + set(GENERATED_PB_H "${DIR}/${FIL_WE}.pb.h") +# cmake > 3.20 required :( +# cmake_path(SET GENERATED_PB_CC "${DIR}") +# cmake_path(SET GENERATED_PB_H "${DIR}") +# cmake_path(APPEND GENERATED_PB_CC "${FIL_WE}.pb.cc") +# cmake_path(APPEND GENERATED_PB_H "${FIL_WE}.pb.h") + + list(APPEND ${SRCS} ${GENERATED_PB_CC}) + list(APPEND ${HDRS} ${GENERATED_PB_H}) + add_custom_command( + OUTPUT ${GENERATED_PB_CC} + ${GENERATED_PB_H} + COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} + ARGS -I=${CMAKE_SOURCE_DIR}/aclk/aclk-schemas --cpp_out=${CMAKE_SOURCE_DIR}/aclk/aclk-schemas ${ABS_FIL} + DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE} + COMMENT "Running C++ protocol buffer compiler on ${FIL}" + VERBATIM ) + endforeach() + set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE) + set(${SRCS} ${${SRCS}} PARENT_SCOPE) + set(${HDRS} ${${HDRS}} PARENT_SCOPE) +endfunction() + +set(ACLK_NG_PROTO_DEFS + aclk/aclk-schemas/proto/aclk/v1/lib.proto + aclk/aclk-schemas/proto/agent/v1/disconnect.proto + aclk/aclk-schemas/proto/agent/v1/connection.proto + aclk/aclk-schemas/proto/alarm/v1/config.proto + aclk/aclk-schemas/proto/alarm/v1/stream.proto + aclk/aclk-schemas/proto/chart/v1/config.proto + aclk/aclk-schemas/proto/chart/v1/dimension.proto + aclk/aclk-schemas/proto/chart/v1/instance.proto + aclk/aclk-schemas/proto/chart/v1/stream.proto + aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.proto + aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto + aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto + ) +PROTOBUF_ACLK_GENERATE_CPP(ACLK_NG_PROTO_BUILT_SRCS ACLK_NG_PROTO_BUILT_HDRS ${ACLK_NG_PROTO_DEFS}) + +list(APPEND NETDATA_COMMON_LIBRARIES ${PROTOBUF_LIBRARIES}) +list(APPEND NETDATA_COMMON_INCLUDE_DIRS ${PROTOBUF_INCLUDE_DIRS}) +list(APPEND NETDATA_COMMON_CFLAGS ${PROTOBUF_CFLAGS_OTHER}) +list(APPEND NETDATA_FILES ${ACLK_ALWAYS_BUILD}) +list(APPEND NETDATA_FILES ${ACLK_NG_FILES} ${ACLK_NG_PROTO_BUILT_SRCS} ${ACLK_NG_PROTO_BUILT_HDRS}) +list(APPEND NETDATA_FILES ${ACLK_COMMON_FILES}) +include_directories(BEFORE ${CMAKE_SOURCE_DIR}/aclk/aclk-schemas) +include_directories(BEFORE ${CMAKE_SOURCE_DIR}/mqtt_websockets/MQTT-C/include) +include_directories(BEFORE ${CMAKE_SOURCE_DIR}/mqtt_websockets/src/include) +include_directories(BEFORE ${CMAKE_SOURCE_DIR}/mqtt_websockets/c-rbuf/include) + # ----------------------------------------------------------------------------- # netdata |