OOM(Out of Memory)的机器僵而不死,对应用来说是最大的伤害,所以我们需要有一种有效的监控手段来判断机器是否是OOM。 OOM机器的特征
OOM时机器状态的猜测
OOM监控脚本 #/bin/bash ips=' 192.168.1.1 192.168.1.2 192.168.1.3 ' for i in $ips do #判断是否能ping通 if ping -c2 -w5 $i 2>/dev/null ; then #用nc判断22端口是否能否响应,使用nc -w参数设定nc 超时时间 if echo 'hello' | nc -w 10 $i 22 | grep -q 'OpenSSH' ; then echo "$ip is oom" fi fi done 转载请保留固定链接: https://linuxeye.com/Linux/2119.html |