监控web脚本一

[root@db01-51 scripts]# cat check_web.sh 
#!/bin/bash
if [ "`curl -I -s -w "%{http_code}\n" -o /dev/null www.baidu.com`" = "200" ]
  then
    echo "httpd is running"
  else
    echo "httpd is stopped"
fi

  

posted @ 2017-03-11 11:40  reborn枪  阅读(65)  评论(0)    收藏  举报