From 24de0e5b68c0a5b6f3c3c3b1c7c5c58e2e934514 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Fri, 1 Oct 2021 16:15:56 +0200 Subject: [PATCH] update php-fpm check - smal changes in output --- check_php-fpm-status | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/check_php-fpm-status b/check_php-fpm-status index 1341413..9ea1fbd 100755 --- a/check_php-fpm-status +++ b/check_php-fpm-status @@ -15,7 +15,7 @@ tmpfile=/tmp/check_fpm_processes_1 defaulturl=localhost/status -sDeltaunit="s" +sDeltaunit="min" # ---------------------------------------------------------------------- # functions @@ -73,7 +73,7 @@ ______________________________________________________________________ The check fetches several counters from php-fm-status page. -It shows a short status in a single line and then the dump of the +It shows a short service status in a single line and then the dump of the status page. For performance data it echos: @@ -158,6 +158,7 @@ typeset -i iMaxQueue=$( _getvalue "max listen queue") typeset -i iSlowTotal=$( _getvalue "slow requests") typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal $sDeltaunit ) typeset -i iMaxChilds=$( _getvalue "max children reached") +typeset -i iSlowPercent=$iSpeed*100/$iSlow typeset -i iWorkerRunning=$( _getWorkerOfState "Running" | wc -l ) @@ -188,9 +189,15 @@ fi # ---------------------------------------------------------------------- # output # ---------------------------------------------------------------------- -ph.status "PHP-FPM: active: $iActive (max: $iMaxActive) .. idle workers: $iIdle .. queue: $iQueue (max: $iMaxQueue) .. speed: $iSpeed req per $sDeltaunit ... slow: $iSlow req per $sDeltaunit (total: $iSlowTotal)" -echo Worker states: Running: $iWorkerRunning .. Reading headers: $iWorkerReading .. Idle: $iWorkerIdle +ph.status "PHP-FPM service: active: $iActive (max: $iMaxActive) .. idle workers: $iIdle .. queue: $iQueue .. speed: $iSpeed req per $sDeltaunit ... slow: $iSlow req per $sDeltaunit ($iSlowPercent %; total: $iSlowTotal)" +echo "Workers: Running: $iWorkerRunning" +echo " Reading headers: $iWorkerReading" +echo " Idle: $iWorkerIdle" echo +echo " Waiting for a worker (queue): $iQueue (max: $iMaxQueue)" +echo + +# ----- output hints on warning level hint="!! IMPORTANT !! Any non-OK status is still experimmental." if [ $iWorkerIdle -eq 0 ]; then echo $hint -- GitLab