Noticed that the output isn't correct, e.g.
0.0%: user | 0.0%: nice | 0.0%: system | 99.3%: interrupt | : idle
.
The culprit is this part:
Code:
__freebsd() {
top -s ${DELAY} -d 2 0 \
| grep -m 1 CPU \
| sed 's/,//g' \
| awk '{ print $4": "$3" | "$6": "$5" | "$8": "$7" | "$10": "$9" | "$12": "$11 }'
}
The fix is
Code:
__freebsd() {
top -s ${DELAY} -d 2 0 \
| grep -m 1 CPU \
| sed 's/,//g' \
| awk '{ print $2": "$3" | "$4": "$5" | "$6": "$7" | "$8": "$9" | "$10": "$11 }'
}