diff options
-rw-r--r-- | examples/c-collectd/c-collectd.c | 8 | ||||
-rw-r--r-- | examples/c-collectd/plugin_nDPIsrvd.conf | 12 | ||||
-rw-r--r-- | examples/c-collectd/plugin_nDPIsrvd_types.db | 65 |
3 files changed, 10 insertions, 75 deletions
diff --git a/examples/c-collectd/c-collectd.c b/examples/c-collectd/c-collectd.c index 3a2c604a8..b4c83d795 100644 --- a/examples/c-collectd/c-collectd.c +++ b/examples/c-collectd/c-collectd.c @@ -10,7 +10,7 @@ #include "nDPIsrvd.h" -#define DEFAULT_COLLECTD_EXEC_INST "exec-nDPIsrvd" +#define DEFAULT_COLLECTD_EXEC_INST "nDPIsrvd" #define LOG(flags, format, ...) \ if (quiet == 0) \ @@ -244,7 +244,7 @@ static int parse_options(int argc, char ** argv, struct nDPIsrvd_socket * const return 0; } -#define COLLECTD_PUTVAL_N_FORMAT(name) "PUTVAL %s/%s/" #name " interval=%llu %llu:%llu\n" +#define COLLECTD_PUTVAL_N_FORMAT(name) "PUTVAL \"%s/exec-%s/gauge-" #name "\" interval=%llu %llu:%llu\n" #define COLLECTD_PUTVAL_N(value) \ collectd_hostname, instance_name, collectd_interval_ull, (unsigned long long int)now, \ (unsigned long long int)collectd_statistics.value @@ -255,8 +255,8 @@ static void print_collectd_exec_output(void) printf(COLLECTD_PUTVAL_N_FORMAT(flow_new_count) COLLECTD_PUTVAL_N_FORMAT(flow_end_count) COLLECTD_PUTVAL_N_FORMAT(flow_idle_count) COLLECTD_PUTVAL_N_FORMAT(flow_guessed_count) COLLECTD_PUTVAL_N_FORMAT(flow_detected_count) COLLECTD_PUTVAL_N_FORMAT(flow_detection_update_count) - COLLECTD_PUTVAL_N_FORMAT(flow_not_detected_count) - COLLECTD_PUTVAL_N_FORMAT(flow_total_bytes) COLLECTD_PUTVAL_N_FORMAT(flow_risky_count), + COLLECTD_PUTVAL_N_FORMAT(flow_not_detected_count) COLLECTD_PUTVAL_N_FORMAT(flow_total_bytes) + COLLECTD_PUTVAL_N_FORMAT(flow_risky_count), COLLECTD_PUTVAL_N(flow_new_count), COLLECTD_PUTVAL_N(flow_end_count), diff --git a/examples/c-collectd/plugin_nDPIsrvd.conf b/examples/c-collectd/plugin_nDPIsrvd.conf index eedc9b6c9..f3cc37f62 100644 --- a/examples/c-collectd/plugin_nDPIsrvd.conf +++ b/examples/c-collectd/plugin_nDPIsrvd.conf @@ -3,12 +3,12 @@ LoadPlugin exec <Plugin exec> Exec "ndpi" "/usr/bin/nDPIsrvd-collectd" # Exec "ndpi" "/usr/bin/nDPIsrvd-collectd" "-s" "/tmp/ndpid-distributor.sock" -# Exec "ndpi" "/usr/bin/nDPIsrvd-collectd" "-s" "127.0.0.1:7000" +# Exec "ndpi" "/tmp/nDPIsrvd-collectd" "-s" "127.0.0.1:7000" </Plugin> # Uncomment for testing -LoadPlugin write_log -LoadPlugin rrdtool -<Plugin rrdtool> - DataDir "nDPIsrvd-collectd" -</Plugin> +#LoadPlugin write_log +#LoadPlugin rrdtool +#<Plugin rrdtool> +# DataDir "nDPIsrvd-collectd" +#</Plugin> diff --git a/examples/c-collectd/plugin_nDPIsrvd_types.db b/examples/c-collectd/plugin_nDPIsrvd_types.db deleted file mode 100644 index a537f0824..000000000 --- a/examples/c-collectd/plugin_nDPIsrvd_types.db +++ /dev/null @@ -1,65 +0,0 @@ -# Add those types to collectd types.db -# e.g. `cat plugin_nDPIsrvd_types.db >>/usr/share/collectd/types.db' - -# flow event counters -flow_new_count value:GAUGE:0:U -flow_end_count value:GAUGE:0:U -flow_idle_count value:GAUGE:0:U -flow_guessed_count value:GAUGE:0:U -flow_detected_count value:GAUGE:0:U -flow_detection_update_count value:GAUGE:0:U -flow_not_detected_count value:GAUGE:0:U - -# flow additional counters -flow_total_bytes value:GAUGE:0:U -flow_risky_count value:GAUGE:0:U - -# flow breed counters -flow_breed_safe_count value:GAUGE:0:U -flow_breed_acceptable_count value:GAUGE:0:U -flow_breed_fun_count value:GAUGE:0:U -flow_breed_unsafe_count value:GAUGE:0:U -flow_breed_potentially_dangerous_count value:GAUGE:0:U -flow_breed_dangerous_count value:GAUGE:0:U -flow_breed_unrated_count value:GAUGE:0:U -flow_breed_unknown_count value:GAUGE:0:U - -# flow category counters -flow_category_media_count value:GAUGE:0:U -flow_category_vpn_count value:GAUGE:0:U -flow_category_email_count value:GAUGE:0:U -flow_category_data_transfer_count value:GAUGE:0:U -flow_category_web_count value:GAUGE:0:U -flow_category_social_network_count value:GAUGE:0:U -flow_category_download_count value:GAUGE:0:U -flow_category_game_count value:GAUGE:0:U -flow_category_chat_count value:GAUGE:0:U -flow_category_voip_count value:GAUGE:0:U -flow_category_database_count value:GAUGE:0:U -flow_category_remote_access_count value:GAUGE:0:U -flow_category_cloud_count value:GAUGE:0:U -flow_category_network_count value:GAUGE:0:U -flow_category_collaborative_count value:GAUGE:0:U -flow_category_rpc_count value:GAUGE:0:U -flow_category_streaming_count value:GAUGE:0:U -flow_category_system_count value:GAUGE:0:U -flow_category_software_update_count value:GAUGE:0:U -flow_category_music_count value:GAUGE:0:U -flow_category_video_count value:GAUGE:0:U -flow_category_shopping_count value:GAUGE:0:U -flow_category_productivity_count value:GAUGE:0:U -flow_category_file_sharing_count value:GAUGE:0:U -flow_category_mining_count value:GAUGE:0:U -flow_category_malware_count value:GAUGE:0:U -flow_category_advertisment_count value:GAUGE:0:U -flow_category_other_count value:GAUGE:0:U -flow_category_unknown_count value:GAUGE:0:U - -# flow l3 / l4 counters -flow_l3_ip4_count value:GAUGE:0:U -flow_l3_ip6_count value:GAUGE:0:U -flow_l3_other_count value:GAUGE:0:U -flow_l4_icmp_count value:GAUGE:0:U -flow_l4_tcp_count value:GAUGE:0:U -flow_l4_udp_count value:GAUGE:0:U -flow_l4_other_count value:GAUGE:0:U |