diff options
author | Federico Ceratto <federico.ceratto@gmail.com> | 2018-03-27 21:28:21 +0000 |
---|---|---|
committer | Federico Ceratto <federico.ceratto@gmail.com> | 2018-03-27 21:28:21 +0000 |
commit | d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c (patch) | |
tree | faac99f51f182bb8c0a03e95e393d421ac9ddf42 /plugins.d/cgroup-network-helper.sh | |
parent | New upstream version 1.9.0+dfsg (diff) | |
download | netdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.tar.xz netdata-d4dd00f58a502c9ca4b63e36ce6bc7a9945dc63c.zip |
New upstream version 1.10.0+dfsgupstream/1.10.0+dfsg
Diffstat (limited to 'plugins.d/cgroup-network-helper.sh')
-rwxr-xr-x | plugins.d/cgroup-network-helper.sh | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins.d/cgroup-network-helper.sh b/plugins.d/cgroup-network-helper.sh index d93fe356..f0705998 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}")" @@ -68,13 +70,6 @@ debug() { 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 pid= @@ -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" |