diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /collectors/nfacct.plugin/plugin_nfacct.c | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-a64a253794ac64cb40befee54db53bde17dd0d49.tar.xz netdata-a64a253794ac64cb40befee54db53bde17dd0d49.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/nfacct.plugin/plugin_nfacct.c (renamed from src/plugin_nfacct.c) | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/src/plugin_nfacct.c b/collectors/nfacct.plugin/plugin_nfacct.c index 02815ef04..7d42dd189 100644 --- a/src/plugin_nfacct.c +++ b/collectors/nfacct.plugin/plugin_nfacct.c @@ -1,6 +1,10 @@ -#include "common.h" +// SPDX-License-Identifier: GPL-3.0-or-later -#ifdef INTERNAL_PLUGIN_NFACCT +#include "plugin_nfacct.h" + +#if defined(INTERNAL_PLUGIN_NFACCT) + +#define PLUGIN_NFACCT_NAME "nfacct.plugin" #ifdef HAVE_LIBMNL #include <libmnl/libmnl.h> @@ -19,7 +23,7 @@ static inline size_t mnl_buffer_size() { #define DO_NFSTAT 1 #define RRD_TYPE_NET_STAT_NETFILTER "netfilter" -#define RRD_TYPE_NET_STAT_CONNTRACK "netlink" // FIXME: should be "conntrack" when merged with the /proc plugin +#define RRD_TYPE_NET_STAT_CONNTRACK "netlink" #include <linux/netfilter/nfnetlink_conntrack.h> @@ -302,9 +306,9 @@ static void nfstat_send_metrics() { , NULL , "Connection Tracker New Connections" , "connections/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3001 + , NETDATA_CHART_PRIO_NETFILTER_NEW , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -338,9 +342,9 @@ static void nfstat_send_metrics() { , NULL , "Connection Tracker Changes" , "changes/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3002 + , NETDATA_CHART_PRIO_NETFILTER_CHANGES , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -375,9 +379,9 @@ static void nfstat_send_metrics() { , NULL , "Connection Tracker Searches" , "searches/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3010 + , NETDATA_CHART_PRIO_NETFILTER_SEARCH , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -412,9 +416,9 @@ static void nfstat_send_metrics() { , NULL , "Connection Tracker Errors" , "events/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3005 + , NETDATA_CHART_PRIO_NETFILTER_ERRORS , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -451,9 +455,9 @@ static void nfstat_send_metrics() { , NULL , "Connection Tracker Expectations" , "expectations/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3003 + , NETDATA_CHART_PRIO_NETFILTER_EXPECT , nfstat_root.update_every , RRDSET_TYPE_LINE ); @@ -590,7 +594,7 @@ static void nfacct_cleanup() { nfacct_root.buf = NULL; nfacct_root.buf_size = 0; - // FIXME: cleanup the metrics linked list + // TODO: cleanup the metrics linked list } static int nfacct_callback(const struct nlmsghdr *nlh, void *data) { @@ -671,9 +675,9 @@ static void nfacct_send_metrics() { , NULL , "Netfilter Accounting Packets" , "packets/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3206 + , NETDATA_CHART_PRIO_NETFILTER_PACKETS , nfacct_root.update_every , RRDSET_TYPE_STACKED ); @@ -714,9 +718,9 @@ static void nfacct_send_metrics() { , NULL , "Netfilter Accounting Bandwidth" , "kilobytes/s" - , "nfacct" + , PLUGIN_NFACCT_NAME , NULL - , 3207 + , NETDATA_CHART_PRIO_NETFILTER_BYTES , nfacct_root.update_every , RRDSET_TYPE_STACKED ); @@ -788,7 +792,6 @@ void *nfacct_main(void *ptr) { heartbeat_t hb; heartbeat_init(&hb); for(;;) { - heartbeat_dt_usec(&hb); heartbeat_next(&hb, step); if(unlikely(netdata_exit)) break; |