1
0
mirror of https://github.com/pavel-odintsov/fastnetmon synced 2024-11-26 13:14:31 +01:00

Moving Netflow configuration to main unified storage

This commit is contained in:
Pavel Odintsov 2024-07-16 13:43:58 +03:00
parent b366696ab8
commit 9ebb39c0d9
3 changed files with 9 additions and 6 deletions

@ -291,7 +291,6 @@ bool enable_afpacket_collection = false;
bool enable_af_xdp_collection = false;
bool enable_data_collection_from_mirror = false;
bool enable_netmap_collection = false;
bool enable_netflow_collection = false;
bool enable_pcap_collection = false;
std::string speed_calculation_time_desc = "Time consumed by recalculation for all IPs";
@ -818,9 +817,9 @@ bool load_configuration_file() {
// Netflow
if (configuration_map.count("netflow") != 0) {
if (configuration_map["netflow"] == "on") {
enable_netflow_collection = true;
fastnetmon_global_configuration.netflow = true;
} else {
enable_netflow_collection = false;
fastnetmon_global_configuration.netflow = false;
}
}
@ -2081,7 +2080,7 @@ int main(int argc, char** argv) {
packet_capture_plugin_thread_group.add_thread(new boost::thread(start_sflow_collection, process_packet));
}
if (enable_netflow_collection) {
if (fastnetmon_global_configuration.netflow) {
packet_capture_plugin_thread_group.add_thread(new boost::thread(start_netflow_collection, process_packet));
}

@ -15,6 +15,11 @@ class fastnetmon_configuration_t {
std::string sflow_host{ "0.0.0.0" };
bool sflow_read_packet_length_from_ip_header{ false };
// Netflow / IPFIX
bool netflow{ false };
std::vector<unsigned int> netflow_ports{};
std::string netflow_host{ "0.0.0.0" };
// Clickhouse metrics
bool clickhouse_metrics{ false };
std::string clickhouse_metrics_database{ "fastnetmon" };

@ -110,7 +110,6 @@ extern bool enable_connection_tracking;
extern bool enable_afpacket_collection;
extern bool enable_data_collection_from_mirror;
extern bool enable_netmap_collection;
extern bool enable_netflow_collection;
extern bool enable_pcap_collection;
extern uint64_t incoming_total_flows_speed;
extern uint64_t outgoing_total_flows_speed;
@ -2955,7 +2954,7 @@ bool get_statistics(std::vector<system_counter_t>& system_counters) {
system_counters.insert(system_counters.end(), sflow_stats.begin(), sflow_stats.end());
}
if (enable_netflow_collection) {
if (fastnetmon_global_configuration.netflow) {
auto netflow_stats = get_netflow_stats();
system_counters.insert(system_counters.end(), netflow_stats.begin(), netflow_stats.end());