]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_net_netstat.c
fix typo in the installer help
[netdata.git] / src / proc_net_netstat.c
index 8741a71c94fb36f9e724edb61cc2faee9e8a716c..2235e79b0251bb3408b84c4c62b9fff1c9e53f9d 100644 (file)
@@ -195,7 +195,7 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
 
     if(unlikely(!ff)) {
         char filename[FILENAME_MAX + 1];
-        snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/netstat");
+        snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/netstat");
         ff = procfile_open(config_get("plugin:proc:/proc/net/netstat", "filename to monitor", filename), " \t:", PROCFILE_FLAG_DEFAULT);
         if(unlikely(!ff)) return 1;
     }
@@ -206,6 +206,9 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
     size_t lines = procfile_lines(ff), l;
     size_t words;
 
+    arl_begin(arl_ipext);
+    arl_begin(arl_tcpext);
+
     for(l = 0; l < lines ;l++) {
         char *key = procfile_lineword(ff, l, 0);
         uint32_t hash = simple_hash(key);
@@ -219,7 +222,6 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
                 continue;
             }
 
-            arl_begin(arl_ipext);
             parse_line_pair(ff, arl_ipext, h, l);
 
             RRDSET *st;
@@ -371,7 +373,6 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
                 continue;
             }
 
-            arl_begin(arl_tcpext);
             parse_line_pair(ff, arl_tcpext, h, l);
 
             RRDSET *st;