Skip to content
Snippets Groups Projects
Commit b50456ef authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

remove Kubernetes interfaces

parent b9c2973b
No related branches found
No related tags found
1 merge request!2487049 - Remove Kubernetes interfaces
...@@ -11,13 +11,20 @@ ...@@ -11,13 +11,20 @@
# 2023-08-22 v1.3 <axel.hahn@unibe.ch> show status line with 2 digits after "." # 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 # 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-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 . $( 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 # FUNCTIONS
...@@ -80,6 +87,8 @@ if [ $bOptHelp -eq 0 ]; then ...@@ -80,6 +87,8 @@ if [ $bOptHelp -eq 0 ]; then
exit 0 exit 0
fi fi
ph.require bc
typeset -i iCountInterfaces typeset -i iCountInterfaces
typeset -i iRead=0 typeset -i iRead=0
...@@ -89,7 +98,8 @@ typeset -i iSpeedTrans=0 ...@@ -89,7 +98,8 @@ typeset -i iSpeedTrans=0
typeset -i iTotalRead=0 typeset -i iTotalRead=0
typeset -i iTotalTrans=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" "$@" ) sFilter=$( ph.getValueWithParam "." "f" "$@" )
sRemove=$( ph.getValueWithParam "SOMETHING_INVALID" "r" "$@" ) sRemove=$( ph.getValueWithParam "SOMETHING_INVALID" "r" "$@" )
......
...@@ -16,7 +16,7 @@ This plugin scans `/proc/net/dev` with the regex `eth|en[ops][0-9]*` to show a f ...@@ -16,7 +16,7 @@ This plugin scans `/proc/net/dev` with the regex `eth|en[ops][0-9]*` to show a f
______________________________________________________________________ ______________________________________________________________________
CHECK_NETIO CHECK_NETIO
v1.5 v1.6
(c) Institute for Medical Education - University of Bern (c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3 Licence: GNU GPL 3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment