2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Merge pull request #940 from RubenKelevra/add_systemd_net_for_tc

network.tc*: add the ability to detect systemd based network devices
This commit is contained in:
Lars Kruse 2018-09-10 20:39:36 +02:00 committed by GitHub
commit f96bcb415a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 7 deletions

View File

@ -61,7 +61,7 @@ case "$1" in
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
awk ' 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, /: */); split($0, a, /: */);
gsub(/^ +/,"",a[1]); gsub(/^ +/,"",a[1]);
if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev

View File

@ -32,12 +32,10 @@ case $1 in
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
awk ' 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, /: */); split($0, a, /: */);
gsub(/^ +/,"",a[1]); gsub(/^ +/,"",a[1]);
if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev 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 fi
exit 0 exit 0
;; ;;

View File

@ -32,12 +32,10 @@ case $1 in
suggest) suggest)
if [ -r /proc/net/dev ]; then if [ -r /proc/net/dev ]; then
awk ' 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, /: */); split($0, a, /: */);
gsub(/^ +/,"",a[1]); gsub(/^ +/,"",a[1]);
if (($2 > 0) || ($10 > 0)) print a[1]; }' /proc/net/dev 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 fi
exit 0 exit 0
;; ;;