summaryrefslogtreecommitdiffstats
path: root/collectors/cgroups.plugin/cgroup-network-helper.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-11-28 04:53:08 +0000
commit315e0143f65da3485dcbcd2f6a3172a351618aec (patch)
treeb713ae472cffab249c95917c6fb6d242d54e0a87 /collectors/cgroups.plugin/cgroup-network-helper.sh
parentAdding upstream version 1.18.1. (diff)
downloadnetdata-315e0143f65da3485dcbcd2f6a3172a351618aec.tar.xz
netdata-315e0143f65da3485dcbcd2f6a3172a351618aec.zip
Adding upstream version 1.19.0.upstream/1.19.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'collectors/cgroups.plugin/cgroup-network-helper.sh')
-rwxr-xr-xcollectors/cgroups.plugin/cgroup-network-helper.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/collectors/cgroups.plugin/cgroup-network-helper.sh b/collectors/cgroups.plugin/cgroup-network-helper.sh
index 6905ce638..eb839ef57 100755
--- a/collectors/cgroups.plugin/cgroup-network-helper.sh
+++ b/collectors/cgroups.plugin/cgroup-network-helper.sh
@@ -122,18 +122,20 @@ proc_pid_fdinfo_iff() {
find_tun_tap_interfaces_for_cgroup() {
local c="${1}" # the cgroup path
+ [ -d "${c}/emulator" ] && c="${c}/emulator" # check for 'emulator' subdirectory
+ c="${c}/cgroup.procs" # make full path
# for each pid of the cgroup
# find any tun/tap devices linked to the pid
- if [ -f "${c}/emulator/cgroup.procs" ]
+ if [ -f "${c}" ]
then
local p
- for p in $(< "${c}/emulator/cgroup.procs" )
+ for p in $(< "${c}" )
do
proc_pid_fdinfo_iff "${p}"
done
else
- debug "Cannot find file '${c}/emulator/cgroup.procs', not searching for tun/tap interfaces."
+ debug "Cannot find file '${c}', not searching for tun/tap interfaces."
fi
}