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

update php-fpm check

parent 3a816614
No related branches found
No related tags found
No related merge requests found
...@@ -124,8 +124,8 @@ fi ...@@ -124,8 +124,8 @@ 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 ) typeset -i iSpeed=$( ph.perfdeltaspeed "fpm-accepted" $iConn )
# --- count slots # --- count slots
typeset -i iActive=$( _getvalue "active processes" ) typeset -i iActive=$( _getvalue "active processes" )
...@@ -140,41 +140,53 @@ typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal ) ...@@ -140,41 +140,53 @@ typeset -i iSlow=$( ph.perfdeltaspeed "fpm-slow" $iSlowTotal )
typeset -i iMaxChilds=$( _getvalue "max children reached") typeset -i iMaxChilds=$( _getvalue "max children reached")
# ----------------------------------------------------------------------
# set status
# ----------------------------------------------------------------------
# damn, count of slots is in the config only - not in status output # damn, count of slots is in the config only - not in status output
# iUsage=$iActive*100/$iSlots # iUsage=$iActive*100/$iSlots
# ph.setStatusByLimit $iUsage $iWarnLimit $iCriticalLimit # ph.setStatusByLimit $iUsage $iWarnLimit $iCriticalLimit
if [ $iQueue -gt 0 -o $iSlow -gt 0 -o $iIdle -eq 0 ]; then if [ $iQueue -gt 0 -o $iSlow -gt 0 ]; then
ph.setStatus warning ph.setStatus warning
fi fi
if [ $iMaxChilds -gt 0 ]; then if [ $iMaxChilds -gt 0 ]; then
# ph.setStatus critical # ph.setStatus critical
ph.setStatus warning ph.setStatus warning
fi
if [ $iIdle -eq 0 ]; then
ph.setStatus critical
fi fi
# --- output # ----------------------------------------------------------------------
# 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 sec ... slow: $iSlow req per sec (total: $iSlowTotal)"
echo
hint="HINT: the non-OK status is still erxperimmental. A warning can be a false positive.\n" hint="!! IMPORTSNT !! Any non-OK status is still experimmental."
if [ $iIdle -eq 0 ]; then if [ $iIdle -eq 0 ]; then
echo $hint echo $hint
echo "WARNING: $iIdle idle workers available." echo "WARNING: $iIdle idle workers available."
echo " Maybe there is a current peak only." echo " Maybe there is a current peak only."
echo " Or count of allowed workers (pm.max_children) or spare servers (pm.XXX_spare_servers) is too low." echo " Or count of allowed workers (pm.max_children) or spare servers (pm.XXX_spare_servers) is too low."
echo
fi
if [ $iMaxChilds -gt 0 ]; then
echo $hint
echo "WARNING: Max. count of children was reached: $iMaxChilds. Maximum of active workers was $iMaxActive - maybe count of allowed workers (pm.max_children) is too low."
echo
fi fi
if [ $iQueue -gt 0 ]; then if [ $iQueue -gt 0 ]; then
echo $hint echo $hint
echo "WARNING: $iQueue queued requests were found. Maximum of queued items is $iMaxQueue." echo "WARNING: $iQueue queued requests were found. Maximum of queued items is $iMaxQueue."
echo
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... $iSlowTotal since restart of fpm service."
echo
fi fi
if [ $iMaxChilds -gt 0 ]; then
echo $hint
echo "WARNING: max. children was reached $iMaxChilds. Maximum of active workers was $iMaxActive - maybe count of allowed workers (pm.max_children) is too low."
fi
echo
cat $tmpfile cat $tmpfile
echo echo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment