diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c5ac0aa..ec6bc25 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -363,6 +363,7 @@ target_link_libraries(fastnetmon influxdb_metrics) # Clickhouse metrics if (CLICKHOUSE_SUPPORT) add_library(clickhouse_metrics STATIC metrics/clickhouse.cpp) +target_link_libraries(clickhouse_metrics ${CLICKHOUSE_LIBRARY_PATH}) target_link_libraries(fastnetmon clickhouse_metrics) endif() diff --git a/src/fastnetmon.cpp b/src/fastnetmon.cpp index 3f3b56b..d4daaff 100644 --- a/src/fastnetmon.cpp +++ b/src/fastnetmon.cpp @@ -120,7 +120,7 @@ #include "metrics/influxdb.hpp" // It's not enabled by default and we enable it only when we have Clickhouse libraries on platform -#ifdef ENABLE_CLICKHOUSE_SUPPORT +#ifdef CLICKHOUSE_SUPPORT #include "metrics/clickhouse.hpp" #endif @@ -2003,9 +2003,10 @@ int main(int argc, char** argv) { service_thread_group.add_thread(new boost::thread(influxdb_push_thread)); } -#ifdef ENABLE_CLICKHOUSE_SUPPORT +#ifdef CLICKHOUSE_SUPPORT // Clickhouse metrics export therad if (fastnetmon_global_configuration.clickhouse_metrics) { + logger << log4cpp::Priority::INFO << "Starting Clickhouse metrics export thread"; service_thread_group.add_thread(new boost::thread(clickhouse_push_thread)); } #endif diff --git a/src/metrics/clickhouse.cpp b/src/metrics/clickhouse.cpp index 880a8cd..5a459ab 100644 --- a/src/metrics/clickhouse.cpp +++ b/src/metrics/clickhouse.cpp @@ -906,7 +906,6 @@ void clickhouse_push_thread() { extern total_speed_counters_t total_counters_ipv6; extern abstract_subnet_counters_t ipv4_network_counters; - extern abstract_subnet_counters_t ipv4_network_24_counters; extern abstract_subnet_counters_t ipv6_network_counters; extern abstract_subnet_counters_t ipv4_host_counters; @@ -985,10 +984,6 @@ void clickhouse_push_thread() { // Push per subnet counters to ClickHouse push_network_traffic_counters_to_clickhouse(clickhouse_metrics_client, ipv4_network_counters, "network_metrics"); - // Push per /24 subnet counters to Clickhouse - push_network_traffic_counters_to_clickhouse(clickhouse_metrics_client, ipv4_network_24_counters, - "network_24_metrics_ipv4"); - push_network_traffic_counters_to_clickhouse(clickhouse_metrics_client, ipv6_network_counters, "network_metrics_ipv6");