2
0
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:
Leandro Späth 2016-06-29 17:38:42 +02:00 committed by Lars Kruse
parent 353c0fc063
commit 99a5c384b0

View File

@ -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