[collectd] nfs client stats

Jason Pepas cell at ices.utexas.edu
Thu Nov 3 00:30:54 CET 2005


On Wed, Nov 02, 2005 at 05:25:55PM -0600, Jason Pepas wrote:
> hmm, I am also getting a segfault.  here is the last of the strace output:
> 
> open("/proc/net/rpc/nfs", O_RDONLY)     = 4
> --- SIGSEGV (Segmentation fault) @ 0 (0) ---

ahh, of course:

--- nfs.c.orig  2005-11-02 17:28:42.000000000 -0600
+++ nfs.c       2005-11-02 17:29:12.000000000 -0600
@@ -264,13 +264,13 @@
 #if defined(KERNEL_LINUX)
        FILE *fh;

-       if (fopen ("/proc/net/rpc/nfs", "r") != NULL)
+       if ((fh = fopen ("/proc/net/rpc/nfs", "r")) != NULL)
        {
                nfs_read_stats_file (fh, "client");
                fclose (fh);
        }

-       if (fopen ("/proc/net/rpc/nfsd", "r") != NULL)
+       if ((fh = fopen ("/proc/net/rpc/nfsd", "r")) != NULL)
        {
                nfs_read_stats_file (fh, "server");
                fclose (fh);

-jason pepas



More information about the Collectd mailing list