summaryrefslogtreecommitdiffstats
path: root/collectors/cgroups.plugin
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2019-10-30 12:48:20 +0200
committerMarkos Fountoulakis <44345837+mfundul@users.noreply.github.com>2019-10-30 12:48:20 +0200
commite0814afa045cbc888bcd5e0d7709d6d7d8edef63 (patch)
tree17e7b3b8b366b8a6368ecc6823978e07d2f895a6 /collectors/cgroups.plugin
parent3fde0522c94ee239ed68760c9a7d5fd176290c25 (diff)
cgroup-network-helper doesn't work on Proxmox 6 (#7037)
Found that cgroup path does not contain 'emulator' subdirectory. - add a check for 'emulator' subdirectory - make 'c' variable contains full cgroup-path with 'cgroup.procs' filename
Diffstat (limited to 'collectors/cgroups.plugin')
-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 6905ce638c..eb839ef57e 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
}