X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fiptables.c;h=f6911221df8739f31d77710eb59802a4d9fff1d4;hb=89be8ccf23c003d22d112de0fe5417d747fa20a4;hp=a2ed4c731e11bda9dfa9d7af92d18a09f90ccd27;hpb=e5e5d99350fa54e22f07b90fbc3102df51565ad9;p=collectd.git diff --git a/src/iptables.c b/src/iptables.c index a2ed4c73..f6911221 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -28,15 +28,14 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" + +#include +#include #ifdef HAVE_SYS_CAPABILITY_H # include #endif -#include -#include - /* * iptc_handle_t was available before libiptc was officially available as a * shared library. Note, that when the shared lib was introduced, the API and @@ -505,14 +504,14 @@ static int iptables_shutdown (void) static int iptables_init (void) { -#ifdef HAVE_SYS_CAPABILITY_H +#if defined(HAVE_SYS_CAPABILITY_H) && defined(CAP_NET_ADMIN) if (check_capability (CAP_NET_ADMIN) != 0) { if (getuid () == 0) 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 "