对web服务器做健康检查一般我们都是用curl库(不管是phpperl的还是shell的)伊宁网站优化perl的还是shell的)大致的方法一致:
代码如下:curl -I -s |head -1|awk ‘{ health = $2==”200″”server is ok”:”server is bad”}END{print health}’server is ok
标签: 连接printhttp