Closed kcwu closed 8 years ago
I'm using FreeBSD and have more than one disk installed. My iostat output is
tty ada0 ada1 ada2 cpu tin tout KB/t tps MB/s KB/t tps MB/s KB/t tps MB/s us ni sy in id 0 1692 5.00 5 0.02 0.00 0 0.00 0.00 0 0.00 26 0 2 1 71
Following is correct command to get cpu usage. I guess the command of other platforms may need to fix as well.
iostat -c 2 | tail -n 1 | awk '{usage=100-$NF} END {printf("%5.1f%%", usage)}'
@kcwu Thanks for the report.
I'm using FreeBSD and have more than one disk installed. My iostat output is
Following is correct command to get cpu usage. I guess the command of other platforms may need to fix as well.