From 64c4b8624ed1e19696dc0497db1fba700840879c Mon Sep 17 00:00:00 2001
From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch>
Date: Thu, 23 Dec 2021 15:48:10 +0100
Subject: [PATCH] remove switch to warning level if just one slow request was
 detected

---
 check_php-fpm-status | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/check_php-fpm-status b/check_php-fpm-status
index 7a10de6..9045ecc 100755
--- a/check_php-fpm-status
+++ b/check_php-fpm-status
@@ -8,6 +8,7 @@
 # ----------------------------------------------------------------------
 # 2021-09-22  v0.1  <axel.hahn@iml.unibe.ch>  initial version
 # 2021-10-01  v0.2  <axel.hahn@iml.unibe.ch>  fetch full status as json
+# 2021-12-23  v0.4  <axel.hahn@iml.unibe.ch>  remove switch to warning level if just one slow request was detected
 # ======================================================================
 
 . `dirname $0`/inc_pluginfunctions
@@ -173,9 +174,15 @@ typeset -i iWorkerIdle=$(    _getWorkerOfState "Idle"            | wc -l )
 # damn, count of slots is in the config only - not in status output
 # iUsage=$iActive*100/$iSlots
 # ph.setStatusByLimit $iUsage $iWarnLimit $iCriticalLimit
-if [ $iQueue -gt 0 -o $iSlow -gt 0 ]; then
+if [ $iQueue -gt 0 ]; then
     ph.setStatus warning
 fi
+
+# remove switch to warning level if just one slow request was detected
+# if [ $iSlow -gt 0 ]; then
+#     ph.setStatus warning
+# fi
+
 if [ $iMaxChilds -gt 0 ]; then
     # ph.setStatus critical
     ph.setStatus warning
@@ -227,8 +234,8 @@ if [ $iQueue -gt 0 ]; then
     echo
 fi
 if [ $iSlow -gt 0 ]; then
-    echo $hint
-    echo "WARNING: $iSlow slow requests per $sDeltaunit were found  ($iSlowPercent%)... total $iSlowTotal slow req were detected (since last start of fpm service)."
+    # echo $hint
+    echo "HINT: $iSlow slow requests per $sDeltaunit were found  ($iSlowPercent%)... total $iSlowTotal slow req were detected (since last start of fpm service)."
     echo
 fi
 
-- 
GitLab