From 3a816614f5cc1290abe64f15b51f82f36bd889bf Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Thu, 23 Sep 2021 16:04:54 +0200 Subject: [PATCH] update php-fpm check --- check_php-fpm-status | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/check_php-fpm-status b/check_php-fpm-status index 10d267d..1eafd3b 100755 --- a/check_php-fpm-status +++ b/check_php-fpm-status @@ -64,8 +64,8 @@ For performance data it eachos: php-fpm-idle count of idle workers php-fpm-queue count of items in the queue php-fpm-maxqueue max listen queue - php-fpm-slow slow requests - php-fpm-speed requests per second (since last execution) + php-fpm-slow slow requests per second (since last execution of this check) + php-fpm-speed requests per second (since last execution of this check) SYNTAX: `basename $0` [-u URL] @@ -135,7 +135,8 @@ typeset -i iIdle=$( _getvalue "idle processes") # --- experimental: generate warning / error typeset -i iQueue=$( _getvalue "listen queue len") typeset -i iMaxQueue=$( _getvalue "max listen queue") -typeset -i iSlow=$( _getvalue "slow requests") +typeset -i iSlowTotal=$( _getvalue "slow requests") +typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal ) typeset -i iMaxChilds=$( _getvalue "max children reached") @@ -152,9 +153,9 @@ fi # --- output -ph.status "PHP-FPM: active: $iActive (max: $iMaxActive) .. wait: $iIdle .. queue: $iQueue (max: $iMaxQueue) .. speed: $iSpeed req per sec" +ph.status "PHP-FPM: active: $iActive (max: $iMaxActive) .. idle workers: $iIdle .. queue: $iQueue (max: $iMaxQueue) .. speed: $iSpeed req per sec ... slow: $iSlow req per sec (total: $iSlowTotal)" -hint="HINT: the non-OK status is still erxperimmental. A warning can be a false positive.\n\n" +hint="HINT: the non-OK status is still erxperimmental. A warning can be a false positive.\n" if [ $iIdle -eq 0 ]; then echo $hint echo "WARNING: $iIdle idle workers available." @@ -163,15 +164,15 @@ if [ $iIdle -eq 0 ]; then fi if [ $iQueue -gt 0 ]; then echo $hint - echo "WARNING: $iQueue queued requests were found." + echo "WARNING: $iQueue queued requests were found. Maximum of queued items is $iMaxQueue." fi if [ $iSlow -gt 0 ]; then echo $hint - echo "WARNING: $iSlow slow requests were found." + echo "WARNING: $iSlow slow requests were found... $iSlowTotal since restart of fpm service." fi if [ $iMaxChilds -gt 0 ]; then echo $hint - echo "WARNING: max. children was reached $iMaxChilds. Max. active were $iMaxActive workers - maybe count of allowed workers (pm.max_children) is too low." + echo "WARNING: max. children was reached $iMaxChilds. Maximum of active workers was $iMaxActive - maybe count of allowed workers (pm.max_children) is too low." fi echo cat $tmpfile -- GitLab