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

netstat: update help; small fixes

parent 866c5178
No related branches found
No related tags found
1 merge request!1336468 docs and harmonize
......@@ -9,46 +9,42 @@
# ----------------------------------------------------------------------
# 2020-07-08 v1.0 <axel.hahn@iml.unibe.ch>
# 2022-10-25 v1.1 <axel.hahn@unibe.ch> shell fixes; no tmpfiles; IML look
# 2023-08-22 v1.2 <axel.hahn@unibe.ch> update help; small shell fixes
# ======================================================================
. $( dirname $0 )/inc_pluginfunctions
self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] )
self_APPVERSION=1.1
export self_APPVERSION=1.2
# ----------------------------------------------------------------------
# functions
# ----------------------------------------------------------------------
function showHelp(){
local _self; _self=$(basename $0)
cat <<EOF
______________________________________________________________________
$self_APPNAME
v$self_APPVERSION
(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3
______________________________________________________________________
$( ph.showImlHelpHeader )
Count number of network connections.
SYNTAX:
$(basename $0) [ -w value -c value -h ]
$_self [ -w value -c value -h ]
-w VALUE cpu usage warning level (default: 75)
-c VALUE cpu usage critical level (default: 90)
-w VALUE warning level for connectios total
-c VALUE critical level
-h or --help show this help.
PARAMETERS:
None.
EXAMPLE:
$(basename $0) -w 60 -c 80 -p 40
EXAMPLES:
$_self Show count of current connections
If there is no -w and -c then the result is always OK.
$_self -w 400 -c 500
Show count of connections incl. limits for warning
and critical.
EOF
}
......@@ -69,8 +65,8 @@ case "$1" in
esac
# --- set optional limits
typeset -i iWarnLimit=$( ph.getValueWithParam 0 w "$@")
typeset -i iCriticalLimit=$( ph.getValueWithParam 0 c "$@")
typeset -i iWarnLimit; iWarnLimit=$( ph.getValueWithParam 0 w "$@")
typeset -i iCriticalLimit; iCriticalLimit=$( ph.getValueWithParam 0 c "$@")
# --- count all connections
typeset -i iTotal=0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment