diff --git a/check_cpu b/check_cpu index 581d1e52fefde924dc11cf4bc16ff126a7045518..a91949c8883b7e2de46aa2d99efa23de31e6d589 100755 --- a/check_cpu +++ b/check_cpu @@ -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