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

proc_zombie: add iml help and doc link

parent 90566eba
Branches
No related tags found
1 merge request!269Update docs
...@@ -49,7 +49,7 @@ SYNTAX: ...@@ -49,7 +49,7 @@ SYNTAX:
check_proc_ressources -m METHOD [-w WARNLIMIT] [-c CRITICALLIMIT] check_proc_ressources -m METHOD [-w WARNLIMIT] [-c CRITICALLIMIT]
EXAMPLE: OPTIONS:
-h, --help -h, --help
show help show help
......
...@@ -9,34 +9,64 @@ ...@@ -9,34 +9,64 @@
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2020-03-10 v1.0 <axel.hahn@iml.unibe.ch> # 2020-03-10 v1.0 <axel.hahn@iml.unibe.ch>
# 2020-07-08 v1.1 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps." # 2020-07-08 v1.1 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps."
# 2024-06-07 v1.2 <axel.hahn@unibe.ch> update help and add docs link
# ====================================================================== # ======================================================================
. `dirname $0`/inc_pluginfunctions . `dirname $0`/inc_pluginfunctions
tmpfile=/tmp/check_proc_zombie_$$ tmpfile=/tmp/check_proc_zombie_$$
export self_APPVERSION=1.2
# show help
function showHelp(){
cat <<EOH
$( ph.showImlHelpHeader )
SYNTAX:
check_proc_zombie [-h] [-w WARNLIMIT] [-c CRITICALLIMIT]
-h this help
-w Warning level
-c Critical level
OPTIONS:
-h, --help
show help
-c, --critical VALUE
critical value; default: $iCriticalLimit
-w. --warning VALUE
warning limit value; default: $iWarnLimit
EXAMPLE:
check_proc_zombie -w 3 -c 15
Show count of zombie processes mark as critical when there are 15 or
more zombie processes and warn on 3 or more.
EOH
}
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# MAIN # MAIN
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# --- check required tools # set default / override from command line params
ph.require top typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"`
typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"`
# --- check param -h # --- check param -h
if [ "$1" = "-h" ]; then if [ "$1" = "-h" ]; then
echo " showHelp
usage: $0 [ -w value -c value -h ]
-w Warning level
-c Critical level
-h this help
"
exit 0 exit 0
fi fi
# set default / override from command line params # --- check required tools
typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"` ph.require ps
typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"` ph.require top
# get cpu status i.e. # get cpu status i.e.
# %Cpu(s): 33.3 us, 9.5 sy, 0.0 ni, 57.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st # %Cpu(s): 33.3 us, 9.5 sy, 0.0 ni, 57.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment