]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_net_snmp6.c
all required system headers in common.h; some progress on health variables
[netdata.git] / src / proc_net_snmp6.c
index e7fadf5737055ddaea94389ac8e5a53532e57838..0d770ddd49e978b79690e480fad9acbe178ee422 100644 (file)
@@ -1,17 +1,4 @@
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
 #include "common.h"
-#include "log.h"
-#include "appconfig.h"
-#include "procfile.h"
-#include "rrd.h"
-#include "plugin_proc.h"
 
 #define RRD_TYPE_NET_SNMP6                     "ipv6"
 #define RRD_TYPE_NET_SNMP6_LEN         strlen(RRD_TYPE_NET_SNMP6)
@@ -254,7 +241,7 @@ int do_proc_net_snmp6(int update_every, unsigned long long dt) {
 
        if(!ff) {
                char filename[FILENAME_MAX + 1];
-               snprintf(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/snmp6");
+               snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/snmp6");
                ff = procfile_open(config_get("plugin:proc:/proc/net/snmp6", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
        }
        if(!ff) return 1;
@@ -361,7 +348,7 @@ int do_proc_net_snmp6(int update_every, unsigned long long dt) {
        for(l = 0; l < lines ;l++) {
                words = procfile_linewords(ff, l);
                if(words < 2) {
-                       if(words) error("Cannot read /proc/net/snmp6 line %d. Expected 2 params, read %d.", l, words);
+                       if(words) error("Cannot read /proc/net/snmp6 line %u. Expected 2 params, read %u.", l, words);
                        continue;
                }