From: Bruno Prémont Date: Wed, 21 Mar 2012 20:34:00 +0000 (+0100) Subject: df plugin: when checking / do it just once X-Git-Tag: collectd-5.0.5~7^2~1 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3512bb1;p=collectd.git df plugin: when checking / do it just once 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 Signed-off-by: Florian Forster --- diff --git a/src/df.c b/src/df.c index 22264d30..dc7be1eb 100644 --- a/src/df.c +++ b/src/df.c @@ -257,6 +257,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