Merge branch 'collectd-4.8' into collectd-4.9
[collectd.git] / src / df.c
index 66daab2..9185ba4 100644 (file)
--- a/src/df.c
+++ b/src/df.c
@@ -1,6 +1,6 @@
 /**
  * collectd - src/df.c
- * Copyright (C) 2005-2007  Florian octo Forster
+ * Copyright (C) 2005-2009  Florian octo Forster
  * Copyright (C) 2009       Paul Sadauskas
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -51,7 +51,8 @@ static const char *config_keys[] =
        "FSType",
        "IgnoreSelected",
        "ReportByDevice",
-       "ReportReserved"
+       "ReportReserved",
+       "ReportInodes"
 };
 static int config_keys_num = STATIC_ARRAY_SIZE (config_keys);
 
@@ -61,6 +62,7 @@ static ignorelist_t *il_fstype = NULL;
 
 static _Bool by_device = false;
 static _Bool report_reserved = false;
+static _Bool report_inodes = false;
 
 static int df_init (void)
 {
@@ -128,6 +130,15 @@ static int df_config (const char *key, const char *value)
 
                return (0);
        }
+       else if (strcasecmp (key, "ReportInodes") == 0)
+       {
+               if (IS_TRUE (value))
+                       report_inodes = true;
+               else
+                       report_inodes = false;
+
+               return (0);
+       }
 
 
        return (-1);
@@ -292,6 +303,7 @@ static int df_read (void)
                }
 
                /* inode handling */
+               if (report_inodes)
                {
                        uint64_t inode_free;
                        uint64_t inode_reserved;