diff --git a/check_onehost b/check_onehost index dbea3f7ba082d87d79e67449f7734c68476be64a..872671827a702f913e3a8133073cbcc21d3bcfee 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 "$@") diff --git a/check_onevm b/check_onevm index 14e4e2b7c98063a8113739ec870b6f847d42efdf..d25032402bf8cd4782b5a5f592bc3a5705a9030e 100755 --- a/check_onevm +++ b/check_onevm @@ -33,14 +33,14 @@ # STAT:done:Done:The VM is done. VMs in this state won’t be shown with onevm list but are kept in the database for accounting purposes. You can still get their information with the onevm show command. # ---------------------------------------------------------------------- # 2023-06-12 v1.0 <axel.hahn@unibe.ch> initial version -# 2023-06-15 v1.0 <axel.hahn@unibe.ch> fix output if no vm is running +# 2023-06-15 v1.1 <axel.hahn@unibe.ch> fix output if no vm is running +# 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 # new line NL=" @@ -53,21 +53,14 @@ showData=0 # ---------------------------------------------------------------------- function showHelp(){ + local _self; _self=$(basename $0) cat <<EOF -______________________________________________________________________ - -$self_APPNAME -v$self_APPVERSION - -(c) Institute for Medical Education - University of Bern -Licence: GNU GPL 3 -______________________________________________________________________ +$( ph.showImlHelpHeader ) Show count of vms in OpenNebula - listed by state and by host. It will go to warning if a non running state was found. It will go to critical if a vm is on failure. - SYNTAX: $(basename $0) @@ -88,9 +81,6 @@ function _add(){ # MAIN # ---------------------------------------------------------------------- -# --- check required tools -ph.require onehost - # --- check param -h case "$1" in "--help"|"-h") @@ -100,6 +90,9 @@ case "$1" in *) esac +# --- check required tools +ph.require onehost + # --- get data cmdout=$( sudo onevm list --csv 2>&1 ) diff --git a/docs/20_Checks/check_ceph_io.md b/docs/20_Checks/check_ceph_io.md index 5426c1f3611e34f31a6e394cfbc3016158c2d26d..9eed61977977ff5c3498dc26b0bdfc15e2aaa38a 100644 --- a/docs/20_Checks/check_ceph_io.md +++ b/docs/20_Checks/check_ceph_io.md @@ -9,6 +9,10 @@ It returns a single line for the status and performance data. * `ceph` binary and sudo permission on it to get the information +```txt +icingaclient ALL=(ALL) NOPASSWD: /bin/ceph +``` + ## Syntax ```txt diff --git a/docs/20_Checks/check_ceph_osd.md b/docs/20_Checks/check_ceph_osd.md index d1a09a65b9f716046b197207d0f0c8d081ab2942..5c4bf6000ff1f1c0a7d5c8965eabd0473c83341e 100644 --- a/docs/20_Checks/check_ceph_osd.md +++ b/docs/20_Checks/check_ceph_osd.md @@ -12,6 +12,10 @@ critical level. * `ceph` binary and sudo permission on it to get the information +```txt +icingaclient ALL=(ALL) NOPASSWD: /bin/ceph +``` + ## Syntax ```txt diff --git a/docs/20_Checks/check_onehost.md b/docs/20_Checks/check_onehost.md index 82359ce9507b6cc71e5aace75885e696dbf9c33b..e5c5e6d1d17b4409c7b03e3416c2afbb335e19dd 100644 --- a/docs/20_Checks/check_onehost.md +++ b/docs/20_Checks/check_onehost.md @@ -22,11 +22,13 @@ icingaclient ALL=(ALL) NOPASSWD: /bin/onehost ./check_onehost -h ______________________________________________________________________ -CHECK_ONEHOST +CHECK_ONEHOST v1.1 (c) Institute for Medical Education - University of Bern Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_onehost.html ______________________________________________________________________ show count of hosts in OpenNebula and warn if a host is down. diff --git a/docs/20_Checks/check_onevm.md b/docs/20_Checks/check_onevm.md index b269d0cd28ead15738002ff04df9fdef16b84ea0..e723da01e0a86c089a8642add7a147b812c8921f 100644 --- a/docs/20_Checks/check_onevm.md +++ b/docs/20_Checks/check_onevm.md @@ -22,18 +22,19 @@ icingaclient ALL=(ALL) NOPASSWD: /bin/onevm ./check_onevm -h ______________________________________________________________________ -CHECK_ONEVM -v1.1 +CHECK_ONEVM +v1.2 (c) Institute for Medical Education - University of Bern Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_onevm.html ______________________________________________________________________ Show count of vms in OpenNebula - listed by state and by host. It will go to warning if a non running state was found. It will go to critical if a vm is on failure. - SYNTAX: check_onevm