Skip to content
Snippets Groups Projects
Commit 3a7435ce authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

update php-fpm check - speed values based on a unit var

parent c708f1e2
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
tmpfile=/tmp/check_fpm_processes_1 tmpfile=/tmp/check_fpm_processes_1
defaulturl=localhost/status defaulturl=localhost/status
sDeltaunit="s"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# functions # functions
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
...@@ -82,8 +84,8 @@ For performance data it echos: ...@@ -82,8 +84,8 @@ For performance data it echos:
php-fpm-reading count of workers in state "Reading headers" php-fpm-reading count of workers in state "Reading headers"
php-fpm-queue count of items in the queue php-fpm-queue count of items in the queue
php-fpm-maxqueue max listen queue php-fpm-maxqueue max listen queue
php-fpm-slow slow requests per minute (since last execution of this check) php-fpm-slow slow requests per $sDeltaunit (since last execution of this check)
php-fpm-speed requests per minute (since last execution of this check) php-fpm-speed requests per $sDeltaunit (since last execution of this check)
SYNTAX: SYNTAX:
`basename $0` [-u URL] `basename $0` [-u URL]
...@@ -143,7 +145,7 @@ fi ...@@ -143,7 +145,7 @@ fi
# --- handled requests per sec # --- handled requests per sec
typeset -i iConn=$( _getvalue "accepted conn") typeset -i iConn=$( _getvalue "accepted conn")
typeset -i iSpeed=$( ph.perfdeltaspeed "fpm-accepted" $iConn "min") typeset -i iSpeed=$( ph.perfdeltaspeed "fpm-accepted" $iConn $sDeltaunit )
# --- count slots # --- count slots
typeset -i iActive=$( _getvalue "active processes" ) typeset -i iActive=$( _getvalue "active processes" )
...@@ -154,7 +156,7 @@ typeset -i iIdle=$( _getvalue "idle processes") ...@@ -154,7 +156,7 @@ typeset -i iIdle=$( _getvalue "idle processes")
typeset -i iQueue=$( _getvalue "listen queue len") typeset -i iQueue=$( _getvalue "listen queue len")
typeset -i iMaxQueue=$( _getvalue "max listen queue") typeset -i iMaxQueue=$( _getvalue "max listen queue")
typeset -i iSlowTotal=$( _getvalue "slow requests") typeset -i iSlowTotal=$( _getvalue "slow requests")
typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal "min" ) typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal $sDeltaunit )
typeset -i iMaxChilds=$( _getvalue "max children reached") typeset -i iMaxChilds=$( _getvalue "max children reached")
...@@ -186,7 +188,7 @@ fi ...@@ -186,7 +188,7 @@ fi
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# output # output
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
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)" 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 echo Worker states: Running: $iWorkerRunning .. Reading headers: $iWorkerReading .. Idle: $iWorkerIdle
echo echo
hint="!! IMPORTANT !! Any non-OK status is still experimmental." hint="!! IMPORTANT !! Any non-OK status is still experimmental."
...@@ -216,7 +218,7 @@ if [ $iQueue -gt 0 ]; then ...@@ -216,7 +218,7 @@ if [ $iQueue -gt 0 ]; then
fi fi
if [ $iSlow -gt 0 ]; then if [ $iSlow -gt 0 ]; then
echo $hint echo $hint
echo "WARNING: $iSlow slow requests were found... $iSlowTotal since restart of fpm service." echo "WARNING: $iSlow slow requests were found per $sDeltaunit ... $iSlowTotal since restart of fpm service."
echo echo
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment