mirror of
https://github.com/munin-monitoring/contrib.git
synced 2018-11-08 00:59:34 +01:00
fixed CPU percent calculation
This commit is contained in:
parent
353c0fc063
commit
99a5c384b0
@ -25,7 +25,7 @@ then #is running
|
||||
MEMORYRSS=$(ps -p ${MC_PID} -o rss | cut -d'
|
||||
' -f2)
|
||||
MEMGiB=$(echo "scale=2;${MEMORYRSS}/1024/1024" | bc -l)
|
||||
CPUPERCENT=$(ps -p ${MC_PID} -o %cpu | sed -n 2p)
|
||||
CPUPERCENT=$(top -bp ${MC_PID} -n 1 | sed -n '$p' | tr -s ' ' | cut -d ' ' -f10)
|
||||
CPU=$(echo "scale=2;${CPUPERCENT}/100" | bc -l)
|
||||
else
|
||||
MEMGiB=0
|
||||
|
Loading…
Reference in New Issue
Block a user