@cryptotaxi247 / netdata-1 / commits / 1f4197b82

disable by default processing cgroups -qemu subdirectories; #345

Costa Tsaousis committed Oct 25, 2016 at 11:26 UTC 1f4197b8254ffe36631daf03417b86262e54add7
1 file changed +8 -1
src/sys_fs_cgroup.c
+8 -1
@@ -875,13 +875,20 @@ int find_dir_in_subdirs(const char *base, const char *this, void (*callback)(con
875 if(*r == '\0') r = "/";
876 else if (*r == '/') r++;
877
878 + // do not decent in directories we are not interested
879 + // https://github.com/firehol/netdata/issues/345
880 + int def = 1;
881 + size_t len = strlen(r);
882 + if(len > 5 && !strncmp(&r[len - 5], "-qemu", 5))
883 + def = 0;
884 +
885 // we check for this option here
886 // so that the config will not have settings
887 // for leaf directories
888 char option[FILENAME_MAX + 1];
889 snprintfz(option, FILENAME_MAX, "search for cgroups under %s", r);
890 option[FILENAME_MAX] = '\0';
884 - enabled = config_get_boolean("plugin:cgroups", option, 1);
891 + enabled = config_get_boolean("plugin:cgroups", option, def);
892 }
893
894 if(enabled) {