]> 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 c104160ce7761c96c9a6d56525804f9cb3ebb63d..2235e79b0251bb3408b84c4c62b9fff1c9e53f9d 100644 (file)
@@ -112,8 +112,8 @@ int do_proc_net_netstat(int update_every, usec_t dt) {
         do_tcpext_connaborts = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP connection aborts", CONFIG_ONDEMAND_ONDEMAND);
         do_tcpext_memory     = config_get_boolean_ondemand("plugin:proc:/proc/net/netstat", "TCP memory pressures", CONFIG_ONDEMAND_ONDEMAND);
 
-        arl_ipext  = arl_create(NULL, 60);
-        arl_tcpext = arl_create(NULL, 60);
+        arl_ipext  = arl_create("netstat/ipext", NULL, 60);
+        arl_tcpext = arl_create("netstat/tcpext", NULL, 60);
 
         // --------------------------------------------------------------------
         // IPv4
@@ -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;