summaryrefslogtreecommitdiffstats
path: root/collectors/diskspace.plugin/plugin_diskspace.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-08 16:27:04 +0000
commita836a244a3d2bdd4da1ee2641e3e957850668cea (patch)
treecb87c75b3677fab7144f868435243f864048a1e6 /collectors/diskspace.plugin/plugin_diskspace.c
parentAdding upstream version 1.38.1. (diff)
downloadnetdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.tar.xz
netdata-a836a244a3d2bdd4da1ee2641e3e957850668cea.zip
Adding upstream version 1.39.0.upstream/1.39.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/diskspace.plugin/plugin_diskspace.c')
-rw-r--r--collectors/diskspace.plugin/plugin_diskspace.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c
index 743612ffb..2153494d9 100644
--- a/collectors/diskspace.plugin/plugin_diskspace.c
+++ b/collectors/diskspace.plugin/plugin_diskspace.c
@@ -6,6 +6,7 @@
#define DEFAULT_EXCLUDED_PATHS "/proc/* /sys/* /var/run/user/* /run/user/* /snap/* /var/lib/docker/*"
#define DEFAULT_EXCLUDED_FILESYSTEMS "*gvfs *gluster* *s3fs *ipfs *davfs2 *httpfs *sshfs *gdfs *moosefs fusectl autofs"
+#define DEFAULT_EXCLUDED_FILESYSTEMS_INODES "msdosfs msdos vfat overlayfs aufs* *unionfs"
#define CONFIG_SECTION_DISKSPACE "plugin:proc:diskspace"
#define MAX_STAT_USEC 10000LU
@@ -294,6 +295,7 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
static SIMPLE_PATTERN *excluded_mountpoints = NULL;
static SIMPLE_PATTERN *excluded_filesystems = NULL;
+ static SIMPLE_PATTERN *excluded_filesystems_inodes = NULL;
usec_t slow_timeout = MAX_STAT_USEC * update_every;
@@ -308,16 +310,22 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
}
excluded_mountpoints = simple_pattern_create(
- config_get(CONFIG_SECTION_DISKSPACE, "exclude space metrics on paths", DEFAULT_EXCLUDED_PATHS)
- , NULL
- , mode
- );
+ config_get(CONFIG_SECTION_DISKSPACE, "exclude space metrics on paths", DEFAULT_EXCLUDED_PATHS),
+ NULL,
+ mode,
+ true);
excluded_filesystems = simple_pattern_create(
- config_get(CONFIG_SECTION_DISKSPACE, "exclude space metrics on filesystems", DEFAULT_EXCLUDED_FILESYSTEMS)
- , NULL
- , SIMPLE_PATTERN_EXACT
- );
+ config_get(CONFIG_SECTION_DISKSPACE, "exclude space metrics on filesystems", DEFAULT_EXCLUDED_FILESYSTEMS),
+ NULL,
+ SIMPLE_PATTERN_EXACT,
+ true);
+
+ excluded_filesystems_inodes = simple_pattern_create(
+ config_get(CONFIG_SECTION_DISKSPACE, "exclude inode metrics on filesystems", DEFAULT_EXCLUDED_FILESYSTEMS_INODES),
+ NULL,
+ SIMPLE_PATTERN_EXACT,
+ true);
dict_mountpoints = dictionary_create_advanced(DICT_OPTION_NONE, &dictionary_stats_category_collectors, 0);
}
@@ -340,6 +348,9 @@ static inline void do_disk_space_stats(struct mountinfo *mi, int update_every) {
def_space = CONFIG_BOOLEAN_NO;
def_inodes = CONFIG_BOOLEAN_NO;
}
+ if (unlikely(simple_pattern_matches(excluded_filesystems_inodes, mi->filesystem))) {
+ def_inodes = CONFIG_BOOLEAN_NO;
+ }
// check if the mount point is a directory #2407
// but only when it is enabled by default #4491