]> arthur.barton.de Git - netdata.git/commitdiff
disable by default processing cgroups -qemu subdirectories; #345
authorCosta Tsaousis <costa@tsaousis.gr>
Tue, 25 Oct 2016 08:26:14 +0000 (11:26 +0300)
committerCosta Tsaousis <costa@tsaousis.gr>
Tue, 25 Oct 2016 08:26:14 +0000 (11:26 +0300)
src/sys_fs_cgroup.c

index a0f8a9982bbf2f4de7c1954a9e94bf80a7b69679..5e49f33e8b5f866c426dd3a98f683f953233a485 100644 (file)
@@ -875,13 +875,20 @@ int find_dir_in_subdirs(const char *base, const char *this, void (*callback)(con
                 if(*r == '\0') r = "/";
                 else if (*r == '/') r++;
 
+                // do not decent in directories we are not interested
+                // https://github.com/firehol/netdata/issues/345
+                int def = 1;
+                size_t len = strlen(r);
+                if(len >  5 && !strncmp(&r[len -  5], "-qemu", 5))
+                    def = 0;
+
                 // we check for this option here
                 // so that the config will not have settings
                 // for leaf directories
                 char option[FILENAME_MAX + 1];
                 snprintfz(option, FILENAME_MAX, "search for cgroups under %s", r);
                 option[FILENAME_MAX] = '\0';
-                enabled = config_get_boolean("plugin:cgroups", option, 1);
+                enabled = config_get_boolean("plugin:cgroups", option, def);
             }
 
             if(enabled) {