diff --git a/check_proc_ressources b/check_proc_ressources index 02521b8a681627c727b687ff05a82be4acece873..ba3e48122c6a8bcc59b7c3fa340f7b40ecce509c 100755 --- a/check_proc_ressources +++ b/check_proc_ressources @@ -49,7 +49,7 @@ SYNTAX: check_proc_ressources -m METHOD [-w WARNLIMIT] [-c CRITICALLIMIT] -EXAMPLE: +OPTIONS: -h, --help show help diff --git a/check_proc_zombie b/check_proc_zombie index 31d98ef4ab98281cc8ea66b1a1515f3fbbd5f77e..ec342685954b9aea5a6dd9d70d52353db2ff4062 100755 --- a/check_proc_zombie +++ b/check_proc_zombie @@ -9,34 +9,60 @@ # ---------------------------------------------------------------------- # 2020-03-10 v1.0 <axel.hahn@iml.unibe.ch> # 2020-07-08 v1.1 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps." +# 2024-06-07 v1.2 <axel.hahn@unibe.ch> update help and add docs link # ====================================================================== - . `dirname $0`/inc_pluginfunctions tmpfile=/tmp/check_proc_zombie_$$ +export self_APPVERSION=1.2 + +# show help +function showHelp(){ + cat <<EOH +$( ph.showImlHelpHeader ) + +SYNTAX: + + check_proc_zombie [-h] [-w WARNLIMIT] [-c CRITICALLIMIT] + +OPTIONS: + + -h, --help + show help + + -c, --critical VALUE + critical value; default: $iCriticalLimit + + -w. --warning VALUE + warning limit value; default: $iWarnLimit + +EXAMPLE: + + check_proc_zombie -w 3 -c 15 + Show count of zombie processes mark as critical when there are 15 or + more zombie processes and warn on 3 or more. + +EOH +} + # ---------------------------------------------------------------------- # MAIN # ---------------------------------------------------------------------- -# --- check required tools -ph.require top +# set default / override from command line params +typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"` +typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"` # --- check param -h if [ "$1" = "-h" ]; then - echo " - usage: $0 [ -w value -c value -h ] - - -w Warning level - -c Critical level - -h this help - " + showHelp exit 0 fi -# set default / override from command line params -typeset -i iWarnLimit=` ph.getValueWithParam 1 w "$@"` -typeset -i iCriticalLimit=` ph.getValueWithParam 10 c "$@"` +# --- check required tools +ph.require ps +ph.require top # get cpu status i.e. # %Cpu(s): 33.3 us, 9.5 sy, 0.0 ni, 57.1 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st diff --git a/docs/20_Checks/_index.md b/docs/20_Checks/_index.md index 3faba3434b8cc75337d205aa5efe1736e886c7ba..83b0836dfa26f038d9b4f10e64bacdf1755db91d 100644 --- a/docs/20_Checks/_index.md +++ b/docs/20_Checks/_index.md @@ -42,7 +42,7 @@ There is one include script used by all checks: * [check_php-fpm-status](check_php-fpm-status.md) * [check_proc_mem](check_proc_mem.md) * [check_proc_ressources](check_proc_ressources.md) -* check_proc_zombie +* [check_proc_zombie](check_proc_zombie.md) * [check_psqlserver](check_psqlserver.md) * [check_rearbackup](check_rearbackup.md) * [check_reboot_required](check_reboot_required.md) diff --git a/docs/20_Checks/check_ceph_diskfree.md b/docs/20_Checks/check_ceph_diskfree.md index f07c47cf9e7cb2a2abd7c22fdc1585f0923bc768..811cf5c6ced2de9305e103037a66f8b492e4a3c7 100644 --- a/docs/20_Checks/check_ceph_diskfree.md +++ b/docs/20_Checks/check_ceph_diskfree.md @@ -2,7 +2,7 @@ ## Introduction -**check_cehp_diskfree** is a plugin to show the available and free diskspace. +**check_ceph_diskfree** is a plugin to show the available and free diskspace. It returns a single line for the status, data and performance data. ## Requirements diff --git a/docs/20_Checks/check_ceph_io.md b/docs/20_Checks/check_ceph_io.md index 31e4301c017a8eca9becb68ceb0d64c386b5e96a..550b7cfd21426fc03443f46327fd286a71ab3e93 100644 --- a/docs/20_Checks/check_ceph_io.md +++ b/docs/20_Checks/check_ceph_io.md @@ -2,7 +2,7 @@ ## Introduction -**check_cehp_io** is a plugin to show read and written bytes per second. +**check_ceph_io** is a plugin to show read and written bytes per second. It returns a single line for the status and performance data. ## Requirements diff --git a/docs/20_Checks/check_cronstatus.md b/docs/20_Checks/check_cronstatus.md index 45a3297a0aa5713c6b10beaabc753c8a7ff1710e..e03fbca0f49f7560bb6209defab37b717d8268b3 100644 --- a/docs/20_Checks/check_cronstatus.md +++ b/docs/20_Checks/check_cronstatus.md @@ -17,7 +17,7 @@ As output you get a summary of all checks followed by more detailed status per j * The cronwrapper must be installed * Your cronjob(s) must be changed to use the wrapper, eg.\ - `*/60 * * * * /opt/cronwrappre.sh 60 <YOUR_COMMAND>` + `*/60 * * * * /opt/cronwrapper/cronwrapper.sh 60 <YOUR_COMMAND>` 📄 Source: <https://github.com/axelhahn/cronwrapper>\ 📜 License: GNU GPL 3.0\ diff --git a/docs/20_Checks/check_mysqlserver.md b/docs/20_Checks/check_mysqlserver.md index bf1fc53e8849738857171f9c467f9882a15005b5..640b6441fa6d0dd1546f314f7709fa9ff29a1ed3 100644 --- a/docs/20_Checks/check_mysqlserver.md +++ b/docs/20_Checks/check_mysqlserver.md @@ -7,7 +7,7 @@ The kind of check is defined by a parameter `-m METHOD`. ## Requirements -* mysql (cli tool) +* ``mysql`` (mysql client as cli tool) * The icinga user needs to connect to the database server (see Installation). ## Syntax @@ -161,3 +161,7 @@ As root run ``` This drops the database user `icingaclient` and removes the config file `/etc/icingaclient/.my.cnf`. + +## Graph + +See templates for mysql graphs in <https://git-repo.iml.unibe.ch/iml-open-source/icinga-graphite-templates>. diff --git a/docs/20_Checks/check_php-fpm-status.md b/docs/20_Checks/check_php-fpm-status.md index cba83a57f2f9cb289bb9ba31caebe91804972d8d..8ca858e41f5c2ea3ac1f0ca3eba8df445be290e4 100644 --- a/docs/20_Checks/check_php-fpm-status.md +++ b/docs/20_Checks/check_php-fpm-status.md @@ -10,8 +10,7 @@ The check fetches several counters from php-fm-status page. * running PHP FPM service * enabled status page - -To enable a status page as http://localhost/fpm-status.php +To enable a status page as <http://localhost/fpm-status.php> * Set pm.status_path in your pool config eg. /etc/php/8.1/fpm/pool.d/www.conf @@ -28,7 +27,6 @@ pm.status_path = /fpm-status.php </Location> ``` - ## Syntax ```text @@ -79,7 +77,6 @@ check_php-fpm-status -u http://localhost/my-custom-fpm-statuspage.php ## Examples - `./check_php-fpm-status -u localhost/fpm-status.php` returns ```txt @@ -111,3 +108,7 @@ Workers: Running: 1 |php-fpm-active=2;;;0;0 php-fpm-maxactive=5;;;0;0 php-fpm-queue=0;;;0;0 php-fpm-maxqueue=0;;;0;0 php-fpm-slow=0;;;0;0 php-fpm-speed=1;;;0;0 php-fpm-idle=3;;;0;0 php-fpm-running=1;;;0;0 php-fpm-reading=1;;;0;0 ``` + +## Graph + +You can use the template <https://git-repo.iml.unibe.ch/iml-open-source/icinga-graphite-templates/-/blob/master/iml_php-fpm-status.ini>. diff --git a/docs/20_Checks/check_proc_zombie.md b/docs/20_Checks/check_proc_zombie.md new file mode 100644 index 0000000000000000000000000000000000000000..499c5a9eca19ff2c0c0deb773575021fb1f3d969 --- /dev/null +++ b/docs/20_Checks/check_proc_zombie.md @@ -0,0 +1,62 @@ +# Check_proc_zombie + +## Introduction + +**check_proc_zombie** is a plugin to show the count of zombie processes. +It sends performance data. + +## Requirements + +* `ps` +* `top` + +## Syntax + +```txt +$ check_proc_zombie -h +______________________________________________________________________ + +CHECK_PROC_ZOMBIE +v1.2 + +(c) Institute for Medical Education - University of Bern +Licence: GNU GPL 3 + +https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_proc_zombie.html +______________________________________________________________________ + +SYNTAX: + + check_proc_zombie [-h] [-w WARNLIMIT] [-c CRITICALLIMIT] + +OPTIONS: + + -h, --help + show help + + -c, --critical VALUE + critical value; default: 10 + + -w. --warning VALUE + warning limit value; default: 1 + +EXAMPLE: + + check_proc_zombie -w 3 -c 15 + Show count of zombie processes mark as critical when there are 15 or + more zombie processes and warn on 3 or more. + +``` + +### Parameters + +(none) + +## Examples + +`$ check_ceph_diskfree` returns + +```txt +OK: 0 ZOMBIE-Processes (total: 392 - running: 2 - sleeping: 390 - stopped: 0) + |proc-zombie=0;1;10;0 +``` diff --git a/docs/20_Checks/inc_pluginfunctions.md b/docs/20_Checks/inc_pluginfunctions.md index 3d29275cf92eb98935c43e59f245759ac780895e..1bcb056b63b877073b9acf759f96c9eb978678fe 100644 --- a/docs/20_Checks/inc_pluginfunctions.md +++ b/docs/20_Checks/inc_pluginfunctions.md @@ -1,6 +1,6 @@ # Shared functions -## Init +## Introduction All scripts start with sourcing a shared bash file