From c708f1e227f946fe4c85b1bf1932a55c40a4ef4f Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Fri, 1 Oct 2021 14:13:26 +0200
Subject: [PATCH] update php-fpm check - speed values in items per min instead
 of sec

---
 check_php-fpm-status | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/check_php-fpm-status b/check_php-fpm-status
index 6e4d048..bfa9053 100755
--- a/check_php-fpm-status
+++ b/check_php-fpm-status
@@ -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 
 status page.
-For performance data it eachos:
+For performance data it echos:
 
     php-fpm-active     count of active workers
     php-fpm-maxactive  max active processes (sum of idle + running + reading)
@@ -82,8 +82,8 @@ For performance data it eachos:
     php-fpm-reading    count of workers in state "Reading headers"
     php-fpm-queue      count of items in the queue
     php-fpm-maxqueue   max listen queue
-    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)
+    php-fpm-slow       slow requests per minute (since last execution of this check)
+    php-fpm-speed      requests per minute (since last execution of this check)
 
 SYNTAX:
 `basename $0` [-u URL]
@@ -143,7 +143,7 @@ fi
 
 # --- handled requests per sec
 typeset -i iConn=$(      _getvalue "accepted conn")
-typeset -i iSpeed=$(     ph.perfdeltaspeed "fpm-accepted" $iConn )
+typeset -i iSpeed=$(     ph.perfdeltaspeed "fpm-accepted" $iConn "min")
 
 # --- count slots
 typeset -i iActive=$(    _getvalue "active processes" )
@@ -154,7 +154,7 @@ typeset -i iIdle=$(      _getvalue "idle processes")
 typeset -i iQueue=$(     _getvalue "listen queue len")
 typeset -i iMaxQueue=$(  _getvalue "max listen queue")
 typeset -i iSlowTotal=$( _getvalue "slow requests")
-typeset -i iSlow=$(      ph.perfdeltaspeed "fpm-slow" $iSlowTotal )
+typeset -i iSlow=$(      ph.perfdeltaspeed "fpm-slow" $iSlowTotal "min"  )
 typeset -i iMaxChilds=$( _getvalue "max children reached")
 
 
@@ -186,7 +186,7 @@ fi
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------
-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)"
+ph.status "PHP-FPM: active: $iActive (max: $iMaxActive) .. idle workers: $iIdle .. queue: $iQueue (max: $iMaxQueue) .. speed: $iSpeed req per min ... slow: $iSlow req per min (total: $iSlowTotal)"
 echo Worker states: Running: $iWorkerRunning .. Reading headers: $iWorkerReading .. Idle: $iWorkerIdle
 echo
 hint="!! IMPORTANT !! Any non-OK status is still experimmental."
-- 
GitLab