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

about: add help

parent 309c9c71
No related branches found
No related tags found
1 merge request!2256908 check rearbackup
...@@ -5,11 +5,14 @@ ...@@ -5,11 +5,14 @@
# ABOUT # ABOUT
# #
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# 2020-10-23 v1.0 <axel.hahn@iml.unibe.ch> initial version # 2023-10-23 v1.0 <axel.hahn@unibe.ch> initial version
# 2020-10-25 v1.1 <axel.hahn@iml.unibe.ch> show disks, show installed versions (WIP) # 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 . /etc/icingaclient/client.cfg 2>/dev/null
...@@ -22,6 +25,32 @@ ...@@ -22,6 +25,32 @@
# FUNCTIONS # 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(){ function _section(){
echo ">>>>>>>>>> $*" echo ">>>>>>>>>> $*"
} }
...@@ -30,6 +59,13 @@ function _section(){ ...@@ -30,6 +59,13 @@ function _section(){
# MAIN # 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 ) _iCpu=$( grep -c "processor" /proc/cpuinfo )
_sCpuModel=$(grep "model name" /proc/cpuinfo | sort -u ) _sCpuModel=$(grep "model name" /proc/cpuinfo | sort -u )
_iMem=$( grep "MemTotal:" /proc/meminfo | awk '{ print $2 }' ) _iMem=$( grep "MemTotal:" /proc/meminfo | awk '{ print $2 }' )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment