#!/bin/bash

iowait=$(top -bn 1|awk -F'[ ,]+'  'NR==3{print $10}')

if [[ $(awk 'BEGIN{print('"${iowait}"'<'10')?0:1}') -eq 0 ]];then
    checkStatus=OK
    msg="当前系统IOWAIT为：${iowait}"
else
    checkStatus=fail
    msg="当前系统IOWAIT为：${iowait}"    
fi

echo "{\"checkValue\":\"${iowait}\", \"checkStatus\":\"${checkStatus}\", \"msg\":\"${msg}\"}"
