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

Merge branch 'docker-checks' into 'master'

7049 - Remove Kubernetes interfaces

See merge request !248
parents b9c2973b b50456ef
No related branches found
No related tags found
1 merge request!2487049 - Remove Kubernetes interfaces
......@@ -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" "$@" )
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment