造价通
更新时间:2024.04.27
shell脚本之cpu监控

格式:pdf

大小:297KB

页数: 4页

使用的 VMware 下的 redhat6.3 系统虚拟机 程序如下: #!/bin/bash while true do cpu_idle=`vmstat |awk 'NR==3 { print $0 }' |awk '{ printf $(NF-2) }'` if [ $cpu_idle -lt 20 ] then echo "Warning,CPU is going to reach the limit." |mail -s "CPU warning" root@localhost else : fi sleep 120 done While 是死循环语句,该脚本在执行时 do 和 done 部分会无限执行 ( 1 ) vmstat 命 令 可 以 查 看 CPU、 内 存 、 swap 分 区 等 等 使 用 情 况 。 如 图 : 这里 cpu 下的 id

shell脚本之cpu监控 (2)

格式:pdf

大小:297KB

页数: 4页

使用的 VMware 下的 redhat6.3 系统虚拟机 程序如下: #!/bin/bash while true do cpu_idle=`vmstat |awk 'NR==3 { print $0 }' |awk '{ printf $(NF-2) }'` if [ $cpu_idle -lt 20 ] then echo "Warning,CPU is going to reach the limit." |mail -s "CPU warning" root@localhost else : fi sleep 120 done While 是死循环语句,该脚本在执行时 do 和 done 部分会无限执行 ( 1 ) vmstat 命 令 可 以 查 看 CPU、 内 存 、 swap 分 区 等 等 使 用 情 况 。 如 图 : 这里 cpu 下的 id

热门知识

SHELL特灵克

最新知识

SHELL特灵克
点击加载更多>>
SHELL特灵克相关专题

分类检索: