From d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Tue, 27 Mar 2018 22:28:21 +0100 Subject: New upstream version 1.10.0+dfsg --- plugins.d/cgroup-network-helper.sh | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'plugins.d/cgroup-network-helper.sh') diff --git a/plugins.d/cgroup-network-helper.sh b/plugins.d/cgroup-network-helper.sh index d93fe356a..f07059986 100755 --- a/plugins.d/cgroup-network-helper.sh +++ b/plugins.d/cgroup-network-helper.sh @@ -22,7 +22,9 @@ # ----------------------------------------------------------------------------- -export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin" +# the system path is cleared by cgroup-network +[ -f /etc/profile ] && source /etc/profile + export LC_ALL=C PROGRAM_NAME="$(basename "${0}")" @@ -67,13 +69,6 @@ debug() { [ $(( ${BASH_VERSINFO[0]} )) -lt 4 ] && \ fatal "BASH version 4 or later is required (this is ${BASH_VERSION})." -# ----------------------------------------------------------------------------- -# defaults to allow running this script by hand - -[ -z "${NETDATA_PLUGINS_DIR}" ] && NETDATA_PLUGINS_DIR="$(dirname "${0}")" -[ -z "${NETDATA_CONFIG_DIR}" ] && NETDATA_CONFIG_DIR="$(dirname "${0}")/../../../../etc/netdata" -[ -z "${NETDATA_CACHE_DIR}" ] && NETDATA_CACHE_DIR="$(dirname "${0}")/../../../../var/cache/netdata" - # ----------------------------------------------------------------------------- # parse the arguments @@ -172,7 +167,7 @@ virsh_find_all_interfaces_for_cgroup() { # match only 'network' interfaces from virsh output set_source "virsh" - "${virsh}" domiflist ${d} |\ + "${virsh}" -r domiflist ${d} |\ sed -n \ -e "s|^\([^[:space:]]\+\)[[:space:]]\+network[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+[^[:space:]]\+[[:space:]]\+[^[:space:]]\+$|\1 \1_\2|p" \ -e "s|^\([^[:space:]]\+\)[[:space:]]\+bridge[[:space:]]\+\([^[:space:]]\+\)[[:space:]]\+[^[:space:]]\+[[:space:]]\+[^[:space:]]\+$|\1 \1_\2|p" -- cgit v1.2.3