Code

More improvementa on the ignorelist functionality.
[collectd.git] / src / df.c
index 8cc9f2eb440615610ed13ca82eb2500e02a08469..b88ed7da562db7982f7490ea21c9bbf1e37ea9b9 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -1,6 +1,6 @@
 /**
  * collectd - src/df.c
- * Copyright (C) 2005  Florian octo Forster
+ * Copyright (C) 2005,2006  Florian octo Forster
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
 #endif
 
 #if HAVE_STATVFS
+# if HAVE_SYS_STATVFS_H
+#  include <sys/statvfs.h>
+# endif
 # define STATANYFS statvfs
 # define BLOCKSIZE(s) ((s).f_frsize ? (s).f_frsize : (s).f_bsize)
 #elif HAVE_STATFS
+# if HAVE_SYS_STATFS_H
+#  include <sys/statfs.h>
+# endif
 # define STATANYFS statfs
 # define BLOCKSIZE(s) (s).f_bsize
 #endif
@@ -45,8 +51,8 @@ static char *filename_template = "df-%s.rrd";
 
 static char *ds_def[] =
 {
-       "DS:used:GAUGE:25:0:U",
-       "DS:free:GAUGE:25:0:U",
+       "DS:used:GAUGE:"COLLECTD_HEARTBEAT":0:U",
+       "DS:free:GAUGE:"COLLECTD_HEARTBEAT":0:U",
        NULL
 };
 static int ds_num = 2;
@@ -88,7 +94,12 @@ static void df_submit (char *df_name,
 
 static void df_read (void)
 {
-       struct STATANYFS statbuf;
+#if HAVE_STATVFS
+       struct statvfs statbuf;
+#elif HAVE_STATFS
+       struct statfs statbuf;
+#endif
+       /* struct STATANYFS statbuf; */
        cu_mount_t *mnt_list;
        cu_mount_t *mnt_ptr;
 
@@ -99,10 +110,7 @@ static void df_read (void)
 
        mnt_list = NULL;
        if (cu_mount_getlist (&mnt_list) == NULL)
-       {
-               syslog (LOG_WARNING, "cu_mount_getlist returned `NULL'");
                return;
-       }
 
        for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next)
        {