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 }' ) diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md index 04adc02e6e43d8929d8c594dc1a4529b2139206b..c086de890b1fe51b92204b0326ee62c34832a428 100644 --- a/docs/20_Checks/_index.md +++ b/docs/20_Checks/_index.md @@ -7,6 +7,7 @@ There is one include script used by all checks: ## Check scripts +* [about](about.md) * [check_apache_requests](check_apache_requests.md) * [check_ceph_diskfree](check_ceph_diskfree.md) * [check_ceph_io](check_ceph_io.md) diff --git a/docs/20_Checks/about.md b/docs/20_Checks/about.md new file mode 100644 index 0000000000000000000000000000000000000000..4012e25234fee2cc7a83ee0e0e5d7d2e14c23d7f --- /dev/null +++ b/docs/20_Checks/about.md @@ -0,0 +1,74 @@ +# About + +## Introduction + +This check shows a short summary for the current system. +Its status is always OK. + +## Requirements + +Nothing special. + +## Syntax + +```txt +______________________________________________________________________ + +ABOUT +v1.2 + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/about.html +______________________________________________________________________ + +About ... shows a short summary for the system: + + * perating system + * cpu + * ram + * diskspace + * checked services + +SYNTAX: + + about [-h] + +OPTIONS: + + -h, --help + this help + +``` + +## Example + +```txt +# ./about +debian 12 / 16 cpu / 62.684 GB ram + +>>>>>>>>>> CPU: 16 +model name : Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz + +>>>>>>>>>> Memory +RAM total 65729512 kB +Swap 999420 kB + +>>>>>>>>>> Disks +Filesystem Size Used Avail Use% Mounted on +/dev/mapper/icinga--01--vg-root 218G 28G 179G 14% / +/dev/sda1 455M 105M 326M 25% /boot + +>>>>>>>>>> Services +Apache-httpd +Carbon-Cache +Cron +Cronjob-watcher +Icinga2 +Icinga-Director +Mariadb +PHP-FPM +Postfix +SSH +```