本文共 470 字,大约阅读时间需要 1 分钟。
#!/bin/bash
#jian kongServer () { timeout=10faile=0success=0while truedo/usr/bin/wget --timeout=$timeout --tries=1 -q -o /dev/nullif [ $? -ne 0 ]thenlet faile=faile+1success=0elsefaile=0success=1fiif [ $success -ge 1 ]thenexit 0fiif [ $faile -ge 2 ]thenCritical="IMS is wrong,please fix it"echo $Critical | mail -s "servers is wrong" zhangsan@hhh.com orgexitfidone}Serverecho "$$" >/var/run/web.pid转载于:https://blog.51cto.com/13588698/2152977