From e0814afa045cbc888bcd5e0d7709d6d7d8edef63 Mon Sep 17 00:00:00 2001 From: Valery Kartel Date: Wed, 30 Oct 2019 12:48:20 +0200 Subject: 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 --- collectors/cgroups.plugin/cgroup-network-helper.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'collectors/cgroups.plugin') 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 } -- cgit v1.2.3