mirror of
https://github.com/netdata/netdata.git
synced 2025-04-28 14:42:31 +00:00
diskspace: don't collect inodes on msdosfs (#14809)
This commit is contained in:
parent
6e89962c6c
commit
c867772955
1 changed files with 19 additions and 4 deletions
|
@ -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,12 +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, true);
|
||||
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, true);
|
||||
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);
|
||||
}
|
||||
|
@ -336,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue