From f3347821e5b3c8d1ac3f4ee51625204234ced407 Mon Sep 17 00:00:00 2001 From: RubenKelevra Date: Mon, 10 Sep 2018 20:03:22 +0200 Subject: [PATCH] network.tc*: add the ability to detect systemd based network device names --- plugins/network/tc_ | 2 +- plugins/network/tc_drops_ | 4 +--- plugins/network/tc_packets_ | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/plugins/network/tc_ b/plugins/network/tc_ index 9933edd2..d08e24b0 100755 --- a/plugins/network/tc_ +++ b/plugins/network/tc_ @@ -61,7 +61,7 @@ case "$1" in suggest) if [ -r /proc/net/dev ]; then awk ' - /^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:/ { + /^ *(eth|tap|bond|wlan|ath|ra|sw|eno|ens|enp|wlp|wl)[0-9]*/ { split($0, a, /: */); gsub(/^ +/,"",a[1]); if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev diff --git a/plugins/network/tc_drops_ b/plugins/network/tc_drops_ index 8906080c..9f9925a3 100755 --- a/plugins/network/tc_drops_ +++ b/plugins/network/tc_drops_ @@ -32,12 +32,10 @@ case $1 in suggest) if [ -r /proc/net/dev ]; then awk ' - /^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:/ { + /^ *(eth|tap|bond|wlan|ath|ra|sw|eno|ens|enp|wlp|wl)[0-9]*/ { split($0, a, /: */); gsub(/^ +/,"",a[1]); if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev - -# egrep '^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' fi exit 0 ;; diff --git a/plugins/network/tc_packets_ b/plugins/network/tc_packets_ index 0c5cadc2..b272abdb 100755 --- a/plugins/network/tc_packets_ +++ b/plugins/network/tc_packets_ @@ -32,12 +32,10 @@ case $1 in suggest) if [ -r /proc/net/dev ]; then awk ' - /^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:/ { + /^ *(eth|tap|bond|wlan|ath|ra|sw|eno|ens|enp|wlp|wl)[0-9]*/ { split($0, a, /: */); gsub(/^ +/,"",a[1]); if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev - -# egrep '^ *(eth|tap|bond|wlan|ath|ra|sw)[0-9]+:' /proc/net/dev | cut -f1 -d: | sed 's/ //g' fi exit 0 ;;