diff options
Diffstat (limited to 'collectors/cgroups.plugin/cgroup-name.sh.in')
-rwxr-xr-x | collectors/cgroups.plugin/cgroup-name.sh.in | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/collectors/cgroups.plugin/cgroup-name.sh.in b/collectors/cgroups.plugin/cgroup-name.sh.in index 3aebe2bf47..c470870b53 100755 --- a/collectors/cgroups.plugin/cgroup-name.sh.in +++ b/collectors/cgroups.plugin/cgroup-name.sh.in @@ -73,6 +73,7 @@ function docker_get_name() { fi if [ -z "${NAME}" ]; then warning "cannot find the name of docker container '${id}'" + NAME_NOT_FOUND=1 NAME="${id:0:12}" else info "docker container '${id}' is named '${NAME}'" @@ -95,6 +96,7 @@ function docker_validate_id() { DOCKER_HOST="${DOCKER_HOST:=/var/run/docker.sock}" CGROUP="${1}" +NAME_NOT_FOUND=0 NAME= # ----------------------------------------------------------------------------- @@ -174,3 +176,9 @@ fi info "cgroup '${CGROUP}' is called '${NAME}'" echo "${NAME}" + +if [ "${NAME_NOT_FOUND}" -eq 1 ]; then + exit 2 +else + exit 0 +fi |