From 40fa3e3b3074cca5629b966cc9e915190c986024 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Wed, 23 Aug 2023 16:09:32 +0200 Subject: [PATCH] onehost: update help; help without requirements --- check_onehost | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/check_onehost b/check_onehost index dbea3f7..8726718 100755 --- a/check_onehost +++ b/check_onehost @@ -9,33 +9,27 @@ # ---------------------------------------------------------------------- # 2023-06-09 v1.0 <axel.hahn@unibe.ch> initial version # 2023-06-12 v1.1 <axel.hahn@unibe.ch> show message if no sudo permissions on onehost command exist +# 2023-08-23 v1.2 <axel.hahn@unibe.ch> update help; show help without requirements # ====================================================================== . $(dirname $0)/inc_pluginfunctions -self_APPNAME=$( basename $0 | tr [:lower:] [:upper:] ) -self_APPVERSION=1.1 +self_APPVERSION=1.2 # ---------------------------------------------------------------------- # functions # ---------------------------------------------------------------------- function showHelp(){ + local _self; _self=$(basename $0) cat <<EOF -______________________________________________________________________ +$( ph.showImlHelpHeader ) -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ - -show count of hosts in OpenNebula and warn if a host is down. +Show count of hosts in OpenNebula and warn if a host is down. SYNTAX: -$(basename $0) [ -w value -c value -h ] +$_self [ -w value -c value -h ] -w VALUE cpu usage warning level (default: 1) -c VALUE cpu usage critical level (default: 2) @@ -46,7 +40,7 @@ PARAMETERS: None. EXAMPLE: -$(basename $0) -c 1 set to critical if the 1st host is off. +$_self -c 1 set to critical if the 1st host is off. EOF } @@ -54,9 +48,6 @@ EOF # MAIN # ---------------------------------------------------------------------- -# --- check required tools -ph.require onehost - # --- check param -h case "$1" in "--help"|"-h") @@ -66,6 +57,9 @@ case "$1" in *) esac +# --- check required tools +ph.require onehost + # --- set optional limits typeset -i iWarnLimit=$( ph.getValueWithParam 1 w "$@") typeset -i iCriticalLimit=$( ph.getValueWithParam 2 c "$@") -- GitLab