diff --git a/about b/about index fb90d58ba4587fa786dc0136074ec976dfcb75c0..44fb6f5d8568d0ff55821d08f04cd197460525ac 100755 --- a/about +++ b/about @@ -5,11 +5,14 @@ # ABOUT # # ---------------------------------------------------------------------- -# 2020-10-23 v1.0 <axel.hahn@iml.unibe.ch> initial version -# 2020-10-25 v1.1 <axel.hahn@iml.unibe.ch> show disks, show installed versions (WIP) +# 2023-10-23 v1.0 <axel.hahn@unibe.ch> initial version +# 2023-10-25 v1.1 <axel.hahn@unibe.ch> show disks, show installed versions (WIP) +# 2023-12-22 v1.2 <axel.hahn@unibe.ch> show help # ====================================================================== -. $( dirname $0 )/inc_pluginfunctions +. $(dirname $0)/inc_pluginfunctions + +export self_APPVERSION=1.2 . /etc/icingaclient/client.cfg 2>/dev/null @@ -22,6 +25,32 @@ # FUNCTIONS # ---------------------------------------------------------------------- +# show help text +function showHelp(){ + local _self; _self=$(basename $0) +cat <<EOF +$( ph.showImlHelpHeader ) + +About ... shows a short summary for the system: + + * operating system + * cpu + * ram + * diskspace + * checked services + +SYNTAX: + + $_self [-h] + +OPTIONS: + + -h, --help + this help + +EOF +} + function _section(){ echo ">>>>>>>>>> $*" } @@ -30,6 +59,13 @@ function _section(){ # MAIN # ---------------------------------------------------------------------- +# --- check param -h + +while [[ "$#" -gt 0 ]]; do case $1 in + -h|--help) showHelp; exit 0;; + *) echo "ERROR: Unknown parameter: $1"; showHelp; exit 1; +esac; done + _iCpu=$( grep -c "processor" /proc/cpuinfo ) _sCpuModel=$(grep "model name" /proc/cpuinfo | sort -u ) _iMem=$( grep "MemTotal:" /proc/meminfo | awk '{ print $2 }' )