From 3512bb1a50e2bf1a7f2998101fb5e7c5783bfa51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bruno=20Pr=C3=A9mont?= Date: Wed, 21 Mar 2012 21:34:00 +0100 Subject: [PATCH] df plugin: when checking / do it just once MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/df.c | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.11.0