#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
#if !KERNEL_LINUX
#error "No applicable input method."
Each table/chain combo that will be queried goes into this list
*/
-static int old_files = 0;
+static int old_files;
static int conntrack_config(const char *key, const char *value) {
if (strcmp(key, "OldFiles") == 0)
char const *path = old_files ? CONNTRACK_FILE_OLD : CONNTRACK_FILE;
if (parse_value_file(path, &conntrack, DS_TYPE_GAUGE) != 0) {
ERROR("conntrack plugin: Reading \"%s\" failed.", path);
- return (-1);
+ return -1;
}
path = old_files ? CONNTRACK_MAX_FILE_OLD : CONNTRACK_MAX_FILE;
if (parse_value_file(path, &conntrack_max, DS_TYPE_GAUGE) != 0) {
ERROR("conntrack plugin: Reading \"%s\" failed.", path);
- return (-1);
+ return -1;
}
conntrack_pct.gauge = (conntrack.gauge / conntrack_max.gauge) * 100;
conntrack_submit("conntrack", "max", conntrack_max);
conntrack_submit("percent", "used", conntrack_pct);
- return (0);
+ return 0;
} /* static int conntrack_read */
void module_register(void) {