diff --git a/check_php-fpm-status b/check_php-fpm-status index 10d267d3f6353768ffdbbc439461008dff5de033..1eafd3b511af214e545cd7d995f16f93148cf3ba 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