diff --git a/check_proc_ressources b/check_proc_ressources index 02521b8a681627c727b687ff05a82be4acece873..ba3e48122c6a8bcc59b7c3fa340f7b40ecce509c 100755 --- a/check_proc_ressources +++ b/check_proc_ressources @@ -49,7 +49,7 @@ SYNTAX: check_proc_ressources -m METHOD [-w WARNLIMIT] [-c CRITICALLIMIT] -EXAMPLE: +OPTIONS: -h, --help show help diff --git a/check_proc_zombie b/check_proc_zombie index 31d98ef4ab98281cc8ea66b1a1515f3fbbd5f77e..8a3c44d1183aa2325025cced066fabca67305cde 100755 --- a/check_proc_zombie +++ b/check_proc_zombie @@ -9,34 +9,64 @@ # ---------------------------------------------------------------------- # 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." +# 2024-06-07 v1.2 <axel.hahn@unibe.ch> update help and add docs link # ====================================================================== - . `dirname $0`/inc_pluginfunctions 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 # ---------------------------------------------------------------------- -# --- check required tools -ph.require top +# set default / override from command line params +typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"` +typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"` # --- check param -h if [ "$1" = "-h" ]; then - echo " - usage: $0 [ -w value -c value -h ] - - -w Warning level - -c Critical level - -h this help - " + showHelp exit 0 fi -# set default / override from command line params -typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"` -typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"` +# --- check required tools +ph.require ps +ph.require top # 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