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;
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;
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;
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}
}
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;
}