projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mqtt, gps: add name parameter to plugin_thread_create()
[collectd.git]
/
src
/
iptables.c
diff --git
a/src/iptables.c
b/src/iptables.c
index
c0854b3
..
657b6ba
100644
(file)
--- a/
src/iptables.c
+++ b/
src/iptables.c
@@
-28,7
+28,6
@@
#include "common.h"
#include "plugin.h"
#include "common.h"
#include "plugin.h"
-#include "configfile.h"
#include <libiptc/libiptc.h>
#include <libiptc/libip6tc.h>
#include <libiptc/libiptc.h>
#include <libiptc/libip6tc.h>
@@
-243,7
+242,6
@@
static int submit6_match (const struct ip6t_entry_match *match,
int rule_num)
{
int status;
int rule_num)
{
int status;
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
/* Select the rules to collect */
value_list_t vl = VALUE_LIST_INIT;
/* Select the rules to collect */
@@
-261,9
+259,6
@@
static int submit6_match (const struct ip6t_entry_match *match,
return (0);
}
return (0);
}
- vl.values = values;
- vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "ip6tables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
sstrncpy (vl.plugin, "ip6tables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
@@
-286,16
+281,16
@@
static int submit6_match (const struct ip6t_entry_match *match,
}
sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type));
}
sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type));
- values[0].derive = (derive_t) entry->counters.bcnt;
+ vl.values = &(value_t) { .derive = (derive_t) entry->counters.bcnt };
+ vl.values_len = 1;
plugin_dispatch_values (&vl);
sstrncpy (vl.type, "ipt_packets", sizeof (vl.type));
plugin_dispatch_values (&vl);
sstrncpy (vl.type, "ipt_packets", sizeof (vl.type));
- v
alues[0].derive = (derive_t) entry->counters.pcnt
;
+ v
l.values = &(value_t) { .derive = (derive_t) entry->counters.pcnt }
;
plugin_dispatch_values (&vl);
return (0);
plugin_dispatch_values (&vl);
return (0);
-} /* int submit_match */
-
+} /* int submit6_match */
/* This needs to return `int' for IPT_MATCH_ITERATE to work. */
static int submit_match (const struct ipt_entry_match *match,
/* This needs to return `int' for IPT_MATCH_ITERATE to work. */
static int submit_match (const struct ipt_entry_match *match,
@@
-304,7
+299,6
@@
static int submit_match (const struct ipt_entry_match *match,
int rule_num)
{
int status;
int rule_num)
{
int status;
- value_t values[1];
value_list_t vl = VALUE_LIST_INIT;
/* Select the rules to collect */
value_list_t vl = VALUE_LIST_INIT;
/* Select the rules to collect */
@@
-322,9
+316,6
@@
static int submit_match (const struct ipt_entry_match *match,
return (0);
}
return (0);
}
- vl.values = values;
- vl.values_len = 1;
- sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
sstrncpy (vl.plugin, "iptables", sizeof (vl.plugin));
status = ssnprintf (vl.plugin_instance, sizeof (vl.plugin_instance),
@@
-347,11
+338,12
@@
static int submit_match (const struct ipt_entry_match *match,
}
sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type));
}
sstrncpy (vl.type, "ipt_bytes", sizeof (vl.type));
- values[0].derive = (derive_t) entry->counters.bcnt;
+ vl.values = &(value_t) { .derive = (derive_t) entry->counters.bcnt };
+ vl.values_len = 1;
plugin_dispatch_values (&vl);
sstrncpy (vl.type, "ipt_packets", sizeof (vl.type));
plugin_dispatch_values (&vl);
sstrncpy (vl.type, "ipt_packets", sizeof (vl.type));
- v
alues[0].derive = (derive_t) entry->counters.pcnt
;
+ v
l.values = &(value_t) { .derive = (derive_t) entry->counters.pcnt }
;
plugin_dispatch_values (&vl);
return (0);
plugin_dispatch_values (&vl);
return (0);
@@
-512,7
+504,7
@@
static int iptables_init (void)
WARNING ("iptables plugin: Running collectd as root, but the "
"CAP_NET_ADMIN capability is missing. The plugin's read "
"function will probably fail. Is your init system dropping "
WARNING ("iptables plugin: Running collectd as root, but the "
"CAP_NET_ADMIN capability is missing. The plugin's read "
"function will probably fail. Is your init system dropping "
- "capabilities
?");
+ "capabilities?");
else
WARNING ("iptables plugin: collectd doesn't have the CAP_NET_ADMIN "
"capability. If you don't want to run collectd as root, try "
else
WARNING ("iptables plugin: collectd doesn't have the CAP_NET_ADMIN "
"capability. If you don't want to run collectd as root, try "