diff --git a/check_netio b/check_netio index a42c5f3a3c7ff2ae304af2a77f02ad33c17bfe27..df97ce8a33166ba8e9615ad2cf65ebe3afa30b2d 100755 --- a/check_netio +++ b/check_netio @@ -11,13 +11,20 @@ # 2023-08-22 v1.3 <axel.hahn@unibe.ch> show status line with 2 digits after "." # 2023-09-22 v1.4 <axel.hahn@unibe.ch> fix syntax error -eq: unary operator expected # 2024-01-10 v1.5 <axel.hahn@unibe.ch> added regex filter for include and exclude +# 2024-03-04 v1.6 <axel.hahn@unibe.ch> remove Kubernetes interfaces # ====================================================================== . $( dirname $0 )/inc_pluginfunctions -export self_APPVERSION=1.5 +export self_APPVERSION=1.6 +# network data without non physical interfaces to be removed from /proc/net/dev +# - lo - local +# - bond - bonded interfaces +# - ppp - dialer connections +# - cali - Kubernetes interfaces +nonPhysicalInterfaces="(lo|bond.*|ppp.*|cali.*):" # ---------------------------------------------------------------------- # FUNCTIONS @@ -80,6 +87,8 @@ if [ $bOptHelp -eq 0 ]; then exit 0 fi +ph.require bc + typeset -i iCountInterfaces typeset -i iRead=0 @@ -89,7 +98,8 @@ typeset -i iSpeedTrans=0 typeset -i iTotalRead=0 typeset -i iTotalTrans=0 -data=$( cat /proc/net/dev | grep ":" | grep -vE "(lo|bond.*|ppp.*):") +# network data without non physical interfaces +data=$( cat /proc/net/dev | grep ":" | grep -vE "${nonPhysicalInterfaces}") sFilter=$( ph.getValueWithParam "." "f" "$@" ) sRemove=$( ph.getValueWithParam "SOMETHING_INVALID" "r" "$@" ) diff --git a/docs/20_Checks/check_netio.md b/docs/20_Checks/check_netio.md index ba5db8d20a4d349eed79db9c471614d22b644379..57391503d9ffef18dcfc8f4b84da1e436cd6d382 100644 --- a/docs/20_Checks/check_netio.md +++ b/docs/20_Checks/check_netio.md @@ -16,7 +16,7 @@ This plugin scans `/proc/net/dev` with the regex `eth|en[ops][0-9]*` to show a f ______________________________________________________________________ CHECK_NETIO -v1.5 +v1.6 (c) Institute for Medical Education - University of Bern Licence: GNU GPL 3