Only count running VM in total
This commit also fixes the way kvmstats counts running VM.
This commit is contained in:
parent
4b5c68ca57
commit
cfa1cf2261
2
kvmstats
2
kvmstats
|
@ -82,7 +82,7 @@ done >"$TMPFILE"
|
|||
(
|
||||
echo vm vcpu ram disk running
|
||||
cat "$TMPFILE"
|
||||
awk '{ vcpu += $2; ram += $3; disk += $4; running += length($5) } END { print "TOTAL", vcpu, ram, disk, running }' <"$TMPFILE"
|
||||
awk '/yes$/ { vcpu += $2; ram += $3; disk += $4; running++ } END { print "TOTAL(running)", vcpu, ram, disk, running }' <"$TMPFILE"
|
||||
if [ $SHOW_AVAIL ]
|
||||
then
|
||||
AV_CPU=$(awk '/^processor/ { cpu++ } END { print cpu }' /proc/cpuinfo)
|
||||
|
|
Loading…
Reference in a new issue