检测CPU利用率的Shell脚本

来源:互联网 发布:儿童学编程 编辑:程序博客网 时间:2024/05/01 22:51

检测CPU利用率的SHELL脚本,当高于90%时报警。

#!/bin/bashcpu_idle=`top -b -n 1 | grep cpu | awk '{print $5}' | cut -f 1 -d "."`if (($cpu_idle < 20)); then   echo $CPU_idlefi


0 0
原创粉丝点击