diff --git a/check_php-fpm-status b/check_php-fpm-status index 13414137d701f94099f2663e5ad5da78ba580519..9ea1fbd6bdb08b2a0a1d4206729004262747f6ea 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