summaryrefslogtreecommitdiffstats
path: root/collectors/nfacct.plugin/plugin_nfacct.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-09-03 10:23:38 +0000
commit574098461cd45be12a497afbdac6f93c58978387 (patch)
tree9eb60a5930b7c20d42f7fde1e234cae3968ed3d9 /collectors/nfacct.plugin/plugin_nfacct.c
parentAdding upstream version 1.16.1. (diff)
downloadnetdata-574098461cd45be12a497afbdac6f93c58978387.tar.xz
netdata-574098461cd45be12a497afbdac6f93c58978387.zip
Adding upstream version 1.17.0.upstream/1.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/nfacct.plugin/plugin_nfacct.c')
-rw-r--r--collectors/nfacct.plugin/plugin_nfacct.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/collectors/nfacct.plugin/plugin_nfacct.c b/collectors/nfacct.plugin/plugin_nfacct.c
index feec34b85..21c2e4aee 100644
--- a/collectors/nfacct.plugin/plugin_nfacct.c
+++ b/collectors/nfacct.plugin/plugin_nfacct.c
@@ -715,15 +715,18 @@ static void nfacct_send_metrics() {
printf("CHART netfilter.nfacct_packets '' 'Netfilter Accounting Packets' 'packets/s'\n");
printf("DIMENSION %s '' incremental 1 %d\n", d->name, nfacct_root.update_every);
}
- printf(
- "BEGIN netfilter.nfacct_packets\n"
- "SET %s = %lld\n"
- "END\n"
+ }
+ }
+ printf("BEGIN netfilter.nfacct_packets\n");
+ for(d = nfacct_root.nfacct_metrics; d ; d = d->next) {
+ if(likely(d->updated)) {
+ printf("SET %s = %lld\n"
, d->name
, (collected_number)d->pkts
);
}
}
+ printf("END\n");
// ----------------------------------------------------------------
@@ -743,15 +746,18 @@ static void nfacct_send_metrics() {
printf("CHART netfilter.nfacct_bytes '' 'Netfilter Accounting Bandwidth' 'kilobytes/s'\n");
printf("DIMENSION %s '' incremental 1 %d\n", d->name, 1000 * nfacct_root.update_every);
}
- printf(
- "BEGIN netfilter.nfacct_bytes\n"
- "SET %s = %lld\n"
- "END\n"
+ }
+ }
+ printf("BEGIN netfilter.nfacct_bytes\n");
+ for(d = nfacct_root.nfacct_metrics; d ; d = d->next) {
+ if(likely(d->updated)) {
+ printf("SET %s = %lld\n"
, d->name
, (collected_number)d->bytes
);
}
}
+ printf("END\n");
}
#endif // HAVE_LIBNETFILTER_ACCT