mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
fixed CPU percent calculation
This commit is contained in:
parent
353c0fc063
commit
99a5c384b0
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue