X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fnfs.c;h=97d91259a338fae7973dfc9027cd7dc0e87a4b90;hp=e1987f1fc5db4fca16e30b5168d7f6bbd57ce46a;hb=0e1e19f9e05c1b6a17f4a534cd0abd592fcab02e;hpb=d486225f89ea52d8ed2b4242eba2ad94c409f837 diff --git a/src/nfs.c b/src/nfs.c index e1987f1f..97d91259 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -24,8 +24,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if HAVE_KSTAT_H #include @@ -322,7 +322,7 @@ static int nfs_config(const char *key, const char *value) { #if KERNEL_LINUX static int nfs_init(void) { return 0; } -/* #endif KERNEL_LINUX */ + /* #endif KERNEL_LINUX */ #elif HAVE_LIBKSTAT static int nfs_init(void) { @@ -519,7 +519,8 @@ static int nfs_submit_nfs4_client(const char *instance, char **fields, static void nfs_read_linux(FILE *fh, const char *inst) { char buffer[1024]; - char *fields[64]; + // The stats line is prefixed with type and number of fields, thus plus 2 + char *fields[MAX(NFS4_SERVER_MAX_PROC, NFS4_CLIENT_MAX_PROC) + 2]; int fields_num = 0; if (fh == NULL) @@ -593,7 +594,7 @@ static int nfs_read(void) { return 0; } -/* #endif KERNEL_LINUX */ + /* #endif KERNEL_LINUX */ #elif HAVE_LIBKSTAT static int nfs_read(void) {