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

check_cpu: show processes with status D to find cpu waits

parent 48c29f08
No related branches found
No related tags found
No related merge requests found
......@@ -14,6 +14,7 @@
# 2020-07-17 v1.3 <axel.hahn@iml.unibe.ch> use ph.require to check binaries
# 2021-02-10 v1.4 <axel.hahn@iml.unibe.ch> added critical io wait
# 2021-10-28 v1.5 <axel.hahn@iml.unibe.ch> Use 2nd update of top
# 2021-12-10 v1.6 <axel.hahn@iml.unibe.ch> show processes with status D to find cpu waits
# ======================================================================
......@@ -28,7 +29,7 @@ function showHelp(){
cat <<EOF
______________________________________________________________________
CHECK_CPU check cpu usage and cpu wait v1.5
CHECK_CPU check cpu usage and cpu wait v1.6
(c) Institute for Medical Education - Univerity of Bern
Licence: GNU GPL 3
......@@ -127,6 +128,13 @@ fi
# --- status output
ph.status "CPU-USAGE [%] ${cpuNonIdle} ... user: ${cpuUser} - system: ${cpuSystem} - idle: ${cpuIdle} - wait: ${cpuWait}"
# v1.6: show processes of cpu wait (status D in proces list)
plist=$( ps aux | awk '$8 ~ /(D|STAT)/ { print $0 }' )
echo "$plist" | grep "[0-9]" >/dev/null \
&& echo \
&& echo "For analysis of cpu waits - processes with status D:" \
&& echo "$plist"
echo "
Limits: usage warn at ${iWarnLimit} .. critical at ${iCriticalLimit} .. io wait limit ${iCriticalWait}
$sInfo
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment