summaryrefslogtreecommitdiffstats
path: root/collectors/cgroups.plugin/sys_fs_cgroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/cgroups.plugin/sys_fs_cgroup.c')
-rw-r--r--collectors/cgroups.plugin/sys_fs_cgroup.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/collectors/cgroups.plugin/sys_fs_cgroup.c b/collectors/cgroups.plugin/sys_fs_cgroup.c
index 41079a43b4..66dfc2d6aa 100644
--- a/collectors/cgroups.plugin/sys_fs_cgroup.c
+++ b/collectors/cgroups.plugin/sys_fs_cgroup.c
@@ -893,7 +893,7 @@ static inline void cgroup_get_chart_name(struct cgroup *cg) {
snprintfz(command, CGROUP_CHARTID_LINE_MAX, "exec %s '%s'", cgroups_rename_script, cg->chart_id);
- debug(D_CGROUP, "executing command \"%s\" for cgroup '%s'", command, cg->id);
+ debug(D_CGROUP, "executing command \"%s\" for cgroup '%s'", command, cg->chart_id);
FILE *fp = mypopen(command, &cgroup_pid);
if(fp) {
// debug(D_CGROUP, "reading from command '%s' for cgroup '%s'", command, cg->id);
@@ -904,12 +904,16 @@ static inline void cgroup_get_chart_name(struct cgroup *cg) {
// debug(D_CGROUP, "closed command for cgroup '%s'", cg->id);
if(s && *s && *s != '\n') {
- debug(D_CGROUP, "cgroup '%s' should be renamed to '%s'", cg->id, s);
+ debug(D_CGROUP, "cgroup '%s' should be renamed to '%s'", cg->chart_id, s);
s = trim(s);
if (s) {
- if(likely(!name_error))
+ if(likely(name_error==0))
cg->pending_renames = 0;
+ else if (unlikely(name_error==3)) {
+ debug(D_CGROUP, "cgroup '%s' disabled based due to rename command output", cg->chart_id);
+ cg->enabled = 0;
+ }
if(likely(cg->pending_renames < 2)) {
freez(cg->chart_title);