summaryrefslogtreecommitdiffstats
path: root/plugins.d/cgroup-name.sh
diff options
context:
space:
mode:
Diffstat (limited to 'plugins.d/cgroup-name.sh')
-rwxr-xr-xplugins.d/cgroup-name.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins.d/cgroup-name.sh b/plugins.d/cgroup-name.sh
index 9bb3bcab..a1e3abe0 100755
--- a/plugins.d/cgroup-name.sh
+++ b/plugins.d/cgroup-name.sh
@@ -98,6 +98,8 @@ if [ -z "${NAME}" ]
then
if [[ "${CGROUP}" =~ ^.*docker[-_/\.][a-fA-F0-9]+[-_\.]?.*$ ]]
then
+ # docker containers
+
DOCKERID="$( echo "${CGROUP}" | sed "s|^.*docker[-_/]\([a-fA-F0-9]\+\)[-_\.]\?.*$|\1|" )"
# echo "DOCKERID=${DOCKERID}"
@@ -117,6 +119,11 @@ if [ -z "${NAME}" ]
info "docker container '${DOCKERID}' is named '${NAME}'"
fi
fi
+ elif [[ "${CGROUP}" =~ machine.slice_machine.*-qemu ]]
+ then
+ # libvirtd / qemu virtual machines
+
+ NAME="$(echo ${CGROUP} | sed 's/machine.slice_machine.*-qemu//; s/\/x2d//; s/\/x2d/\-/g; s/\.scope//g')"
fi
[ -z "${NAME}" ] && NAME="${CGROUP}"