5 unsigned long long value;
9 struct nfsd_procs nfsd_proc2_values[] = {
11 { "getattr", 0ULL, 0 },
12 { "setattr", 0ULL, 0 },
14 { "lookup", 0ULL, 0 },
15 { "readlink", 0ULL, 0 },
17 { "wrcache", 0ULL, 0 },
19 { "create", 0ULL, 0 },
20 { "remove", 0ULL, 0 },
21 { "rename", 0ULL, 0 },
23 { "symlink", 0ULL, 0 },
26 { "readdir", 0ULL, 0 },
27 { "fsstat", 0ULL, 0 },
33 struct nfsd_procs nfsd_proc3_values[] = {
35 { "getattr", 0ULL, 0 },
36 { "setattr", 0ULL, 0 },
37 { "lookup", 0ULL, 0 },
38 { "access", 0ULL, 0 },
39 { "readlink", 0ULL, 0 },
42 { "create", 0ULL, 0 },
44 { "symlink", 0ULL, 0 },
46 { "remove", 0ULL, 0 },
48 { "rename", 0ULL, 0 },
50 { "readdir", 0ULL, 0 },
51 { "readdirplus", 0ULL, 0 },
52 { "fsstat", 0ULL, 0 },
53 { "fsinfo", 0ULL, 0 },
54 { "pathconf", 0ULL, 0 },
55 { "commit", 0ULL, 0 },
61 struct nfsd_procs nfsd_proc4_values[] = {
65 { "commit", 0ULL, 0 },
67 { "open_conf", 0ULL, 0 },
68 { "open_noat", 0ULL, 0 },
69 { "open_dgrd", 0ULL, 0 },
71 { "setattr", 0ULL, 0 },
72 { "fsinfo", 0ULL, 0 },
74 { "setclntid", 0ULL, 0 },
75 { "confirm", 0ULL, 0 },
79 { "access", 0ULL, 0 },
80 { "getattr", 0ULL, 0 },
81 { "lookup", 0ULL, 0 },
82 { "lookup_root", 0ULL, 0 },
83 { "remove", 0ULL, 0 },
84 { "rename", 0ULL, 0 },
86 { "symlink", 0ULL, 0 },
87 { "create", 0ULL, 0 },
88 { "pathconf", 0ULL, 0 },
89 { "statfs", 0ULL, 0 },
90 { "readlink", 0ULL, 0 },
91 { "readdir", 0ULL, 0 },
92 { "server_caps", 0ULL, 0 },
93 { "delegreturn", 0ULL, 0 },
94 { "getacl", 0ULL, 0 },
95 { "setacl", 0ULL, 0 },
96 { "fs_locations", 0ULL, 0 },
97 { "rel_lkowner", 0ULL, 0 },
98 { "secinfo", 0ULL, 0 },
99 { "fsid_present", 0ULL, 0 },
101 /* nfsv4.1 client ops */
102 { "exchange_id", 0ULL, 0 },
103 { "create_session", 0ULL, 0 },
104 { "destroy_session", 0ULL, 0 },
105 { "sequence", 0ULL, 0 },
106 { "get_lease_time", 0ULL, 0 },
107 { "reclaim_comp", 0ULL, 0 },
108 { "layoutget", 0ULL, 0 },
109 { "getdevinfo", 0ULL, 0 },
110 { "layoutcommit", 0ULL, 0 },
111 { "layoutreturn", 0ULL, 0 },
112 { "secinfo_no", 0ULL, 0 },
113 { "test_stateid", 0ULL, 0 },
114 { "free_stateid", 0ULL, 0 },
115 { "getdevicelist", 0ULL, 0 },
116 { "bind_conn_to_ses", 0ULL, 0 },
117 { "destroy_clientid", 0ULL, 0 },
119 /* nfsv4.2 client ops */
121 { "allocate", 0ULL, 0 },
122 { "deallocate", 0ULL, 0 },
123 { "layoutstats", 0ULL, 0 },
124 { "clone", 0ULL, 0 },
130 struct nfsd_procs nfsd4_ops_values[] = {
131 { "unused_op0", 0ULL, 0},
132 { "unused_op1", 0ULL, 0},
133 { "future_op2", 0ULL, 0},
134 { "access", 0ULL, 0},
136 { "commit", 0ULL, 0},
137 { "create", 0ULL, 0},
138 { "delegpurge", 0ULL, 0},
139 { "delegreturn", 0ULL, 0},
140 { "getattr", 0ULL, 0},
146 { "lookup", 0ULL, 0},
147 { "lookup_root", 0ULL, 0},
148 { "nverify", 0ULL, 0},
150 { "openattr", 0ULL, 0},
151 { "open_confirm", 0ULL, 0},
152 { "open_downgrade", 0ULL, 0},
154 { "putpubfh", 0ULL, 0},
155 { "putrootfh", 0ULL, 0},
157 { "readdir", 0ULL, 0},
158 { "readlink", 0ULL, 0},
159 { "remove", 0ULL, 0},
160 { "rename", 0ULL, 0},
162 { "restorefh", 0ULL, 0},
163 { "savefh", 0ULL, 0},
164 { "secinfo", 0ULL, 0},
165 { "setattr", 0ULL, 0},
166 { "setclientid", 0ULL, 0},
167 { "setclientid_confirm", 0ULL, 0},
168 { "verify", 0ULL, 0},
170 { "release_lockowner", 0ULL, 0},
173 { "backchannel_ctl", 0ULL, 0},
174 { "bind_conn_to_session", 0ULL, 0},
175 { "exchange_id", 0ULL, 0},
176 { "create_session", 0ULL, 0},
177 { "destroy_session", 0ULL, 0},
178 { "free_stateid", 0ULL, 0},
179 { "get_dir_delegation", 0ULL, 0},
180 { "getdeviceinfo", 0ULL, 0},
181 { "getdevicelist", 0ULL, 0},
182 { "layoutcommit", 0ULL, 0},
183 { "layoutget", 0ULL, 0},
184 { "layoutreturn", 0ULL, 0},
185 { "secinfo_no_name", 0ULL, 0},
186 { "sequence", 0ULL, 0},
187 { "set_ssv", 0ULL, 0},
188 { "test_stateid", 0ULL, 0},
189 { "want_delegation", 0ULL, 0},
190 { "destroy_clientid", 0ULL, 0},
191 { "reclaim_complete", 0ULL, 0},
194 { "allocate", 0ULL, 0},
196 { "copy_notify", 0ULL, 0},
197 { "deallocate", 0ULL, 0},
198 { "ioadvise", 0ULL, 0},
199 { "layouterror", 0ULL, 0},
200 { "layoutstats", 0ULL, 0},
201 { "offload_cancel", 0ULL, 0},
202 { "offload_status", 0ULL, 0},
203 { "read_plus", 0ULL, 0},
205 { "write_same", 0ULL, 0},
212 int do_proc_net_rpc_nfsd(int update_every, unsigned long long dt) {
213 static procfile *ff = NULL;
214 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;
215 static int ra_warning = 0, th_warning = 0, proc2_warning = 0, proc3_warning = 0, proc4_warning = 0, proc4ops_warning = 0;
220 char filename[FILENAME_MAX + 1];
221 snprintfz(filename, FILENAME_MAX, "%s%s", global_host_prefix, "/proc/net/rpc/nfsd");
222 ff = procfile_open(config_get("plugin:proc:/proc/net/rpc/nfsd", "filename to monitor", filename), " \t", PROCFILE_FLAG_DEFAULT);
226 ff = procfile_readall(ff);
227 if(!ff) return 0; // we return 0, so that we will retry to open it next time
229 if(do_rc == -1) do_rc = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "read cache", 1);
230 if(do_fh == -1) do_fh = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "file handles", 1);
231 if(do_io == -1) do_io = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "I/O", 1);
232 if(do_th == -1) do_th = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "threads", 1);
233 if(do_ra == -1) do_ra = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "read ahead", 1);
234 if(do_net == -1) do_net = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "network", 1);
235 if(do_rpc == -1) do_rpc = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "rpc", 1);
236 if(do_proc2 == -1) do_proc2 = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v2 procedures", 1);
237 if(do_proc3 == -1) do_proc3 = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v3 procedures", 1);
238 if(do_proc4 == -1) do_proc4 = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v4 procedures", 1);
239 if(do_proc4ops == -1) do_proc4ops = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v4 operations", 1);
241 // if they are enabled, reset them to 1
242 // later we do them =2 to avoid doing strcmp for all lines
248 if(do_net) do_net = 1;
249 if(do_rpc) do_rpc = 1;
250 if(do_proc2) do_proc2 = 1;
251 if(do_proc3) do_proc3 = 1;
252 if(do_proc4) do_proc4 = 1;
253 if(do_proc4ops) do_proc4ops = 1;
255 uint32_t lines = procfile_lines(ff), l;
259 unsigned long long rc_hits = 0, rc_misses = 0, rc_nocache = 0;
260 unsigned long long fh_stale = 0, fh_total_lookups = 0, fh_anonymous_lookups = 0, fh_dir_not_in_dcache = 0, fh_non_dir_not_in_dcache = 0;
261 unsigned long long io_read = 0, io_write = 0;
262 unsigned long long th_threads = 0, th_fullcnt = 0, th_hist10 = 0, th_hist20 = 0, th_hist30 = 0, th_hist40 = 0, th_hist50 = 0, th_hist60 = 0, th_hist70 = 0, th_hist80 = 0, th_hist90 = 0, th_hist100 = 0;
263 unsigned long long ra_size = 0, ra_hist10 = 0, ra_hist20 = 0, ra_hist30 = 0, ra_hist40 = 0, ra_hist50 = 0, ra_hist60 = 0, ra_hist70 = 0, ra_hist80 = 0, ra_hist90 = 0, ra_hist100 = 0, ra_none = 0;
264 unsigned long long net_count = 0, net_udp_count = 0, net_tcp_count = 0, net_tcp_connections = 0;
265 unsigned long long rpc_calls = 0, rpc_bad_format = 0, rpc_bad_auth = 0, rpc_bad_client = 0;
267 for(l = 0; l < lines ;l++) {
268 words = procfile_linewords(ff, l);
271 type = procfile_lineword(ff, l, 0);
273 if(do_rc == 1 && strcmp(type, "rc") == 0) {
275 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 4);
279 rc_hits = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
280 rc_misses = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
281 rc_nocache = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
283 unsigned long long sum = rc_hits + rc_misses + rc_nocache;
284 if(sum == 0ULL) do_rc = -1;
287 else if(do_fh == 1 && strcmp(type, "fh") == 0) {
289 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 6);
293 fh_stale = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
294 fh_total_lookups = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
295 fh_anonymous_lookups = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
296 fh_dir_not_in_dcache = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
297 fh_non_dir_not_in_dcache = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
299 unsigned long long sum = fh_stale + fh_total_lookups + fh_anonymous_lookups + fh_dir_not_in_dcache + fh_non_dir_not_in_dcache;
300 if(sum == 0ULL) do_fh = -1;
303 else if(do_io == 1 && strcmp(type, "io") == 0) {
305 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 3);
309 io_read = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
310 io_write = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
312 unsigned long long sum = io_read + io_write;
313 if(sum == 0ULL) do_io = -1;
316 else if(do_th == 1 && strcmp(type, "th") == 0) {
318 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 13);
322 th_threads = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
323 th_fullcnt = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
324 th_hist10 = (unsigned long long)(atof(procfile_lineword(ff, l, 3)) * 1000.0);
325 th_hist20 = (unsigned long long)(atof(procfile_lineword(ff, l, 4)) * 1000.0);
326 th_hist30 = (unsigned long long)(atof(procfile_lineword(ff, l, 5)) * 1000.0);
327 th_hist40 = (unsigned long long)(atof(procfile_lineword(ff, l, 6)) * 1000.0);
328 th_hist50 = (unsigned long long)(atof(procfile_lineword(ff, l, 7)) * 1000.0);
329 th_hist60 = (unsigned long long)(atof(procfile_lineword(ff, l, 8)) * 1000.0);
330 th_hist70 = (unsigned long long)(atof(procfile_lineword(ff, l, 9)) * 1000.0);
331 th_hist80 = (unsigned long long)(atof(procfile_lineword(ff, l, 10)) * 1000.0);
332 th_hist90 = (unsigned long long)(atof(procfile_lineword(ff, l, 11)) * 1000.0);
333 th_hist100 = (unsigned long long)(atof(procfile_lineword(ff, l, 12)) * 1000.0);
335 // threads histogram has been disabled on recent kernels
336 // http://permalink.gmane.org/gmane.linux.nfs/24528
337 unsigned long long sum = th_hist10 + th_hist20 + th_hist30 + th_hist40 + th_hist50 + th_hist60 + th_hist70 + th_hist80 + th_hist90 + th_hist100;
340 info("Disabling /proc/net/rpc/nfsd threads histogram. It seems unused on this machine. It will be enabled automatically when found with data in it.");
347 else if(do_ra == 1 && strcmp(type, "ra") == 0) {
349 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 13);
353 ra_size = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
354 ra_hist10 = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
355 ra_hist20 = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
356 ra_hist30 = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
357 ra_hist40 = strtoull(procfile_lineword(ff, l, 5), NULL, 10);
358 ra_hist50 = strtoull(procfile_lineword(ff, l, 6), NULL, 10);
359 ra_hist60 = strtoull(procfile_lineword(ff, l, 7), NULL, 10);
360 ra_hist70 = strtoull(procfile_lineword(ff, l, 8), NULL, 10);
361 ra_hist80 = strtoull(procfile_lineword(ff, l, 9), NULL, 10);
362 ra_hist90 = strtoull(procfile_lineword(ff, l, 10), NULL, 10);
363 ra_hist100 = strtoull(procfile_lineword(ff, l, 11), NULL, 10);
364 ra_none = strtoull(procfile_lineword(ff, l, 12), NULL, 10);
366 unsigned long long sum = ra_hist10 + ra_hist20 + ra_hist30 + ra_hist40 + ra_hist50 + ra_hist60 + ra_hist70 + ra_hist80 + ra_hist90 + ra_hist100 + ra_none;
369 info("Disabling /proc/net/rpc/nfsd read ahead histogram. It seems unused on this machine. It will be enabled automatically when found with data in it.");
376 else if(do_net == 1 && strcmp(type, "net") == 0) {
378 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 5);
382 net_count = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
383 net_udp_count = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
384 net_tcp_count = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
385 net_tcp_connections = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
387 unsigned long long sum = net_count + net_udp_count + net_tcp_count + net_tcp_connections;
388 if(sum == 0ULL) do_net = -1;
391 else if(do_rpc == 1 && strcmp(type, "rpc") == 0) {
393 error("%s line of /proc/net/rpc/nfsd has %u words, expected %d", type, words, 6);
397 rpc_calls = strtoull(procfile_lineword(ff, l, 1), NULL, 10);
398 rpc_bad_format = strtoull(procfile_lineword(ff, l, 2), NULL, 10);
399 rpc_bad_auth = strtoull(procfile_lineword(ff, l, 3), NULL, 10);
400 rpc_bad_client = strtoull(procfile_lineword(ff, l, 4), NULL, 10);
402 unsigned long long sum = rpc_calls + rpc_bad_format + rpc_bad_auth + rpc_bad_client;
403 if(sum == 0ULL) do_rpc = -1;
406 else if(do_proc2 == 1 && strcmp(type, "proc2") == 0) {
407 // the first number is the count of numbers present
408 // so we start for word 2
410 unsigned long long sum = 0;
412 for(i = 0, j = 2; j < words && nfsd_proc2_values[i].name[0] ; i++, j++) {
413 nfsd_proc2_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
414 nfsd_proc2_values[i].present = 1;
415 sum += nfsd_proc2_values[i].value;
420 error("Disabling /proc/net/rpc/nfsd v2 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
427 else if(do_proc3 == 1 && strcmp(type, "proc3") == 0) {
428 // the first number is the count of numbers present
429 // so we start for word 2
431 unsigned long long sum = 0;
433 for(i = 0, j = 2; j < words && nfsd_proc3_values[i].name[0] ; i++, j++) {
434 nfsd_proc3_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
435 nfsd_proc3_values[i].present = 1;
436 sum += nfsd_proc3_values[i].value;
441 info("Disabling /proc/net/rpc/nfsd v3 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
448 else if(do_proc4 == 1 && strcmp(type, "proc4") == 0) {
449 // the first number is the count of numbers present
450 // so we start for word 2
452 unsigned long long sum = 0;
454 for(i = 0, j = 2; j < words && nfsd_proc4_values[i].name[0] ; i++, j++) {
455 nfsd_proc4_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
456 nfsd_proc4_values[i].present = 1;
457 sum += nfsd_proc4_values[i].value;
462 info("Disabling /proc/net/rpc/nfsd v4 procedure calls chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
469 else if(do_proc4ops == 1 && strcmp(type, "proc4ops") == 0) {
470 // the first number is the count of numbers present
471 // so we start for word 2
473 unsigned long long sum = 0;
475 for(i = 0, j = 2; j < words && nfsd4_ops_values[i].name[0] ; i++, j++) {
476 nfsd4_ops_values[i].value = strtoull(procfile_lineword(ff, l, j), NULL, 10);
477 nfsd4_ops_values[i].present = 1;
478 sum += nfsd4_ops_values[i].value;
482 if(!proc4ops_warning) {
483 info("Disabling /proc/net/rpc/nfsd v4 operations chart. It seems unused on this machine. It will be enabled automatically when found with data in it.");
484 proc4ops_warning = 1;
488 else do_proc4ops = 2;
494 // --------------------------------------------------------------------
497 st = rrdset_find_bytype("nfsd", "readcache");
499 st = rrdset_create("nfsd", "readcache", NULL, "cache", NULL, "NFS Server Read Cache", "reads/s", 5000, update_every, RRDSET_TYPE_STACKED);
501 rrddim_add(st, "hits", NULL, 1, 1, RRDDIM_INCREMENTAL);
502 rrddim_add(st, "misses", NULL, 1, 1, RRDDIM_INCREMENTAL);
503 rrddim_add(st, "nocache", NULL, 1, 1, RRDDIM_INCREMENTAL);
505 else rrdset_next(st);
507 rrddim_set(st, "hits", rc_hits);
508 rrddim_set(st, "misses", rc_misses);
509 rrddim_set(st, "nocache", rc_nocache);
513 // --------------------------------------------------------------------
516 st = rrdset_find_bytype("nfsd", "filehandles");
518 st = rrdset_create("nfsd", "filehandles", NULL, "filehandles", NULL, "NFS Server File Handles", "handles/s", 5001, update_every, RRDSET_TYPE_LINE);
521 rrddim_add(st, "stale", NULL, 1, 1, RRDDIM_ABSOLUTE);
522 rrddim_add(st, "total_lookups", NULL, 1, 1, RRDDIM_INCREMENTAL);
523 rrddim_add(st, "anonymous_lookups", NULL, 1, 1, RRDDIM_INCREMENTAL);
524 rrddim_add(st, "dir_not_in_dcache", NULL, -1, 1, RRDDIM_INCREMENTAL);
525 rrddim_add(st, "non_dir_not_in_dcache", NULL, -1, 1, RRDDIM_INCREMENTAL);
527 else rrdset_next(st);
529 rrddim_set(st, "stale", fh_stale);
530 rrddim_set(st, "total_lookups", fh_total_lookups);
531 rrddim_set(st, "anonymous_lookups", fh_anonymous_lookups);
532 rrddim_set(st, "dir_not_in_dcache", fh_dir_not_in_dcache);
533 rrddim_set(st, "non_dir_not_in_dcache", fh_non_dir_not_in_dcache);
537 // --------------------------------------------------------------------
540 st = rrdset_find_bytype("nfsd", "io");
542 st = rrdset_create("nfsd", "io", NULL, "io", NULL, "NFS Server I/O", "kilobytes/s", 5002, update_every, RRDSET_TYPE_AREA);
544 rrddim_add(st, "read", NULL, 1, 1000, RRDDIM_INCREMENTAL);
545 rrddim_add(st, "write", NULL, -1, 1000, RRDDIM_INCREMENTAL);
547 else rrdset_next(st);
549 rrddim_set(st, "read", io_read);
550 rrddim_set(st, "write", io_write);
554 // --------------------------------------------------------------------
557 st = rrdset_find_bytype("nfsd", "threads");
559 st = rrdset_create("nfsd", "threads", NULL, "threads", NULL, "NFS Server Threads", "threads", 5003, update_every, RRDSET_TYPE_LINE);
561 rrddim_add(st, "threads", NULL, 1, 1, RRDDIM_ABSOLUTE);
563 else rrdset_next(st);
565 rrddim_set(st, "threads", th_threads);
568 st = rrdset_find_bytype("nfsd", "threads_fullcnt");
570 st = rrdset_create("nfsd", "threads_fullcnt", NULL, "threads", NULL, "NFS Server Threads Full Count", "ops/s", 5004, update_every, RRDSET_TYPE_LINE);
572 rrddim_add(st, "full_count", NULL, 1, 1, RRDDIM_INCREMENTAL);
574 else rrdset_next(st);
576 rrddim_set(st, "full_count", th_fullcnt);
579 st = rrdset_find_bytype("nfsd", "threads_histogram");
581 st = rrdset_create("nfsd", "threads_histogram", NULL, "threads", NULL, "NFS Server Threads Usage Histogram", "percentage", 5005, update_every, RRDSET_TYPE_LINE);
583 rrddim_add(st, "0%-10%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
584 rrddim_add(st, "10%-20%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
585 rrddim_add(st, "20%-30%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
586 rrddim_add(st, "30%-40%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
587 rrddim_add(st, "40%-50%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
588 rrddim_add(st, "50%-60%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
589 rrddim_add(st, "60%-70%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
590 rrddim_add(st, "70%-80%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
591 rrddim_add(st, "80%-90%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
592 rrddim_add(st, "90%-100%", NULL, 1, 1000, RRDDIM_ABSOLUTE);
594 else rrdset_next(st);
596 rrddim_set(st, "0%-10%", th_hist10);
597 rrddim_set(st, "10%-20%", th_hist20);
598 rrddim_set(st, "20%-30%", th_hist30);
599 rrddim_set(st, "30%-40%", th_hist40);
600 rrddim_set(st, "40%-50%", th_hist50);
601 rrddim_set(st, "50%-60%", th_hist60);
602 rrddim_set(st, "60%-70%", th_hist70);
603 rrddim_set(st, "70%-80%", th_hist80);
604 rrddim_set(st, "80%-90%", th_hist90);
605 rrddim_set(st, "90%-100%", th_hist100);
609 // --------------------------------------------------------------------
612 st = rrdset_find_bytype("nfsd", "readahead");
614 st = rrdset_create("nfsd", "readahead", NULL, "readahead", NULL, "NFS Server Read Ahead Depth", "percentage", 5005, update_every, RRDSET_TYPE_STACKED);
616 rrddim_add(st, "10%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
617 rrddim_add(st, "20%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
618 rrddim_add(st, "30%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
619 rrddim_add(st, "40%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
620 rrddim_add(st, "50%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
621 rrddim_add(st, "60%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
622 rrddim_add(st, "70%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
623 rrddim_add(st, "80%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
624 rrddim_add(st, "90%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
625 rrddim_add(st, "100%", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
626 rrddim_add(st, "misses", NULL, 1, 1, RRDDIM_PCENT_OVER_DIFF_TOTAL);
628 else rrdset_next(st);
633 rrddim_set(st, "10%", ra_hist10);
634 rrddim_set(st, "20%", ra_hist20);
635 rrddim_set(st, "30%", ra_hist30);
636 rrddim_set(st, "40%", ra_hist40);
637 rrddim_set(st, "50%", ra_hist50);
638 rrddim_set(st, "60%", ra_hist60);
639 rrddim_set(st, "70%", ra_hist70);
640 rrddim_set(st, "80%", ra_hist80);
641 rrddim_set(st, "90%", ra_hist90);
642 rrddim_set(st, "100%", ra_hist100);
643 rrddim_set(st, "misses", ra_none);
647 // --------------------------------------------------------------------
650 st = rrdset_find_bytype("nfsd", "net");
652 st = rrdset_create("nfsd", "net", NULL, "network", NULL, "NFS Server Network Statistics", "packets/s", 5007, update_every, RRDSET_TYPE_STACKED);
655 rrddim_add(st, "udp", NULL, 1, 1, RRDDIM_INCREMENTAL);
656 rrddim_add(st, "tcp", NULL, 1, 1, RRDDIM_INCREMENTAL);
658 else rrdset_next(st);
660 // ignore net_count, net_tcp_connections
662 if(net_tcp_connections) {};
664 rrddim_set(st, "udp", net_udp_count);
665 rrddim_set(st, "tcp", net_tcp_count);
669 // --------------------------------------------------------------------
672 st = rrdset_find_bytype("nfsd", "rpc");
674 st = rrdset_create("nfsd", "rpc", NULL, "rpc", NULL, "NFS Server Remote Procedure Calls Statistics", "calls/s", 5008, update_every, RRDSET_TYPE_LINE);
677 rrddim_add(st, "calls", NULL, 1, 1, RRDDIM_INCREMENTAL);
678 rrddim_add(st, "bad_format", NULL, -1, 1, RRDDIM_INCREMENTAL);
679 rrddim_add(st, "bad_auth", NULL, -1, 1, RRDDIM_INCREMENTAL);
681 else rrdset_next(st);
683 // ignore rpc_bad_client
684 if(rpc_bad_client) {};
686 rrddim_set(st, "calls", rpc_calls);
687 rrddim_set(st, "bad_format", rpc_bad_format);
688 rrddim_set(st, "bad_auth", rpc_bad_auth);
692 // --------------------------------------------------------------------
696 st = rrdset_find_bytype("nfsd", "proc2");
698 st = rrdset_create("nfsd", "proc2", NULL, "nfsv2rpc", NULL, "NFS v2 Server Remote Procedure Calls", "calls/s", 5009, update_every, RRDSET_TYPE_STACKED);
700 for(i = 0; nfsd_proc2_values[i].present ; i++)
701 rrddim_add(st, nfsd_proc2_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
703 else rrdset_next(st);
705 for(i = 0; nfsd_proc2_values[i].present ; i++)
706 rrddim_set(st, nfsd_proc2_values[i].name, nfsd_proc2_values[i].value);
711 // --------------------------------------------------------------------
715 st = rrdset_find_bytype("nfsd", "proc3");
717 st = rrdset_create("nfsd", "proc3", NULL, "nfsv3rpc", NULL, "NFS v3 Server Remote Procedure Calls", "calls/s", 5010, update_every, RRDSET_TYPE_STACKED);
719 for(i = 0; nfsd_proc3_values[i].present ; i++)
720 rrddim_add(st, nfsd_proc3_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
722 else rrdset_next(st);
724 for(i = 0; nfsd_proc3_values[i].present ; i++)
725 rrddim_set(st, nfsd_proc3_values[i].name, nfsd_proc3_values[i].value);
730 // --------------------------------------------------------------------
734 st = rrdset_find_bytype("nfsd", "proc4");
736 st = rrdset_create("nfsd", "proc4", NULL, "nfsv4rpc", NULL, "NFS v4 Server Remote Procedure Calls", "calls/s", 5011, update_every, RRDSET_TYPE_STACKED);
738 for(i = 0; nfsd_proc4_values[i].present ; i++)
739 rrddim_add(st, nfsd_proc4_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
741 else rrdset_next(st);
743 for(i = 0; nfsd_proc4_values[i].present ; i++)
744 rrddim_set(st, nfsd_proc4_values[i].name, nfsd_proc4_values[i].value);
749 // --------------------------------------------------------------------
751 if(do_proc4ops == 2) {
753 st = rrdset_find_bytype("nfsd", "proc4ops");
755 st = rrdset_create("nfsd", "proc4ops", NULL, "nfsv2ops", NULL, "NFS v4 Server Operations", "operations/s", 5012, update_every, RRDSET_TYPE_STACKED);
757 for(i = 0; nfsd4_ops_values[i].present ; i++)
758 rrddim_add(st, nfsd4_ops_values[i].name, NULL, 1, 1, RRDDIM_INCREMENTAL);
760 else rrdset_next(st);
762 for(i = 0; nfsd4_ops_values[i].present ; i++)
763 rrddim_set(st, nfsd4_ops_values[i].name, nfsd4_ops_values[i].value);