Newer system symlink /etc/mtab to /proc/mounts which makes root
filesystem seem mounted twice, once as type rootfs and once for the
real device.

When / is selected for df plugin, skip the rootfs mount-point as
real root is usually mounted right on top of it.

Not skipping it causes rrdtool to complain about two updates for the
same timestamp, the first entry for rootfs passes but rrdtool complains
when stats for the second occurrence for real filesystem is being
considered.

Signed-off-by: Bruno Prémont <[email protected]>
---
diff -NurpP collectd-5.0.1.orig/src/df.c collectd-5.0.1/src/df.c
--- collectd-5.0.1.orig/src/df.c        2011-10-14 22:49:49.000000000 +0200
+++ collectd-5.0.1/src/df.c     2011-11-01 18:21:04.124973135 +0100
@@ -228,6 +228,8 @@ static int df_read (void)
                {
                        if (strcmp (mnt_ptr->dir, "/") == 0)
                        {
+                               if (strcmp (mnt_ptr->type, "rootfs") == 0)
+                                       continue;
                                sstrncpy (disk_name, "root", sizeof 
(disk_name));
                        }
                        else

_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to