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

check_cpu - Use 2nd update of top

parent 942799a7
Branches
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@
# 2020-07-08 v1.2 <axel.hahn@iml.unibe.ch> FIX: set "ph." instead "ps."
# 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
# ======================================================================
......@@ -27,7 +28,7 @@ function showHelp(){
cat <<EOF
______________________________________________________________________
CHECK_CPU check cpu usage and cpu wait v1.4
CHECK_CPU check cpu usage and cpu wait v1.5
(c) Institute for Medical Education - Univerity of Bern
Licence: GNU GPL 3
......@@ -90,7 +91,9 @@ typeset -i iCriticalWait=` ph.getValueWithParam 50 i "$@"`
# hi : time spent servicing hardware interrupts
# si : time spent servicing software interrupts
# st : time stolen from this vm by the hypervisor
top -b -n 1 | head -5 | grep "^\%Cpu" >$tmpfile
# top -b -n 1 | head -5 | grep "^\%Cpu" >$tmpfile
# FIX read cpu from 2nd output of top
top -b -n 2 -d 0.1 | grep -i "^\%Cpu" | tail -1 >$tmpfile
cpuUser=` awk '{ print $2 }' $tmpfile`
cpuSystem=` awk '{ print $4 }' $tmpfile`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment