]> arthur.barton.de Git - netdata.git/blobdiff - src/proc_net_rpc_nfsd.c
Merge pull request #1788 from l2isbad/web_log_plugin_fix
[netdata.git] / src / proc_net_rpc_nfsd.c
index 2b75d09f0ef57009b6de122ea1480cecc83d98bc..969910f32c85b9ed46eebc0cd851fda546b3b7ea 100644 (file)
@@ -210,15 +210,14 @@ struct nfsd_procs nfsd4_ops_values[] = {
 
 
 int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
+    (void)dt;
     static procfile *ff = NULL;
     static int do_rc = -1, do_fh = -1, do_io = -1, do_th = -1, do_ra = -1, do_net = -1, do_rpc = -1, do_proc2 = -1, do_proc3 = -1, do_proc4 = -1, do_proc4ops = -1;
     static int ra_warning = 0, th_warning = 0, proc2_warning = 0, proc3_warning = 0, proc4_warning = 0, proc4ops_warning = 0;
 
-    if(dt) {};
-
     if(!ff) {
         char filename[FILENAME_MAX + 1];
-        snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/rpc/nfsd");
+        snprintfz(filename, FILENAME_MAX, "%s%s", netdata_configured_host_prefix, "/proc/net/rpc/nfsd");
         ff = procfile_open(config_get("plugin:proc:/proc/net/rpc/nfsd", "filename to monitor", filename), " \t", PROCFILE_FLAG_DEFAULT);
     }
     if(!ff) return 1;
@@ -239,7 +238,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
     if(do_proc4ops == -1) do_proc4ops = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v4 operations", 1);
 
     // if they are enabled, reset them to 1
-    // later we do them =2 to avoid doing strcmp for all lines
+    // later we do them =2 to avoid doing strcmp() for all lines
     if(do_rc) do_rc = 1;
     if(do_fh) do_fh = 1;
     if(do_io) do_io = 1;
@@ -252,7 +251,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
     if(do_proc4) do_proc4 = 1;
     if(do_proc4ops) do_proc4ops = 1;
 
-    uint32_t lines = procfile_lines(ff), l;
+    size_t lines = procfile_lines(ff), l;
 
     char *type;
     unsigned long long rc_hits = 0, rc_misses = 0, rc_nocache = 0;
@@ -264,14 +263,14 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
     unsigned long long rpc_calls = 0, rpc_bad_format = 0, rpc_bad_auth = 0, rpc_bad_client = 0;
 
     for(l = 0; l < lines ;l++) {
-        uint32_t words = procfile_linewords(ff, l);
+        size_t words = procfile_linewords(ff, l);
         if(!words) continue;
 
         type = procfile_lineword(ff, l, 0);
 
         if(do_rc == 1 && strcmp(type, "rc") == 0) {
             if(words < 4) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 4);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 4);
                 continue;
             }
 
@@ -285,7 +284,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_fh == 1 && strcmp(type, "fh") == 0) {
             if(words < 6) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 6);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
                 continue;
             }
 
@@ -301,7 +300,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_io == 1 && strcmp(type, "io") == 0) {
             if(words < 3) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 3);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 3);
                 continue;
             }
 
@@ -314,7 +313,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_th == 1 && strcmp(type, "th") == 0) {
             if(words < 13) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 13);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 13);
                 continue;
             }
 
@@ -345,7 +344,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_ra == 1 && strcmp(type, "ra") == 0) {
             if(words < 13) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 13);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 13);
                 continue;
             }
 
@@ -374,7 +373,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_net == 1 && strcmp(type, "net") == 0) {
             if(words < 5) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 5);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 5);
                 continue;
             }
 
@@ -389,7 +388,7 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
         }
         else if(do_rpc == 1 && strcmp(type, "rpc") == 0) {
             if(words < 6) {
-                error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 6);
+                error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 6);
                 continue;
             }