| #!/bin/bash |
| |
| |
| |
| |
| t_Log "Running $0 - a simple mpstat test to verify cpu load is being measured" |
| |
| |
| TMP=/tmp/mpstat.scratch |
| |
| |
| trap "[ -e $TMP ] && { /bin/rm -f $TMP; }" EXIT |
| |
| |
| /usr/bin/mpstat -P 0 1 5 >$TMP & |
| |
| |
| sleep 4 |
| |
| |
| /bin/dd if=/dev/urandom bs=1k count=10000 2>/dev/null|sha1sum -b - &>/dev/null |
| |
| |
| sleep 6 |
| |
| |
| |
| CPU_SYS_PCENT=$(awk '$6 ~ /[0-9]\./ {$6>a ? a=$6 : $6} END {print int(a)}' $TMP) |
| |
| |
| [ "$CPU_SYS_PCENT" -gt 5 ] || { t_Log "mpstat didn't log any CPU activity?!...that ain't good"; } |
| |
| t_CheckExitStatus $? |