[root@rhel6 ~]# curl -I -s -w "%{http_code}\n" -o /dev/null http://127.0.0.1
[root@rhel6 ~]# curl -I http://127.0.0.1 2>/dev/null | head -1 | egrep "200|300|301"
HTTP/1.1 OK
#!/bin/bash

if [ $# -ne  ];then
echo $"Usage $0 url"
exit
fi while true;do
res=`curl -o /dev/null --connect-timeout -s -w "%{http_code}" $|grep -E -w "200|301|302"|wc -l`
if [ $res -ne ];then
echo "$1 is down."
else
echo "$1 is ok."
fi
sleep
done

Options:

  -I/--head          Show document info only

  -s/--silent        Silent mode. Don't output anything

  -w/--write-out <format> What to output after completion

  -o/--output <file> Write output to <file> instead of stdout

  -k/--insecure    turn off curl's verification of the certificate

  --retry <num>   Retry request <num> times if transient problems occur

  --connect-timeout <seconds> Maximum time allowed for connection

最新文章

  1. win7下装ubuntu14.04双系统
  2. doxygen的使用(一)配置并生成文档
  3. emmet插件快捷键:
  4. lumen 错误&amp;日志
  5. SqlServer中使用Select语句给变量赋值的时候需要注意的一个问题
  6. Android布局_网格布局GirdLayout
  7. Android实现button一边圆角一边直角
  8. tty/pts 相关指令
  9. Arcengine 开发,FeatureClass新增feature时“The Geometry has no z-value”或&quot;The Geometry has null z-value&quot;的解决方案
  10. SQLite数据转换成sql server数据
  11. 开源的.Net ORM微型框架SuperHelper
  12. Python-老男孩-02_装饰器_面向对象_封装_继承_异常_接口_数据库
  13. c# 操作数据库
  14. Windows ML,系统内置的机器学习平台初探
  15. Django 系列博客(八)
  16. Do-Now—团队Scrum 冲刺博客五
  17. Spring Cloud学习笔记--Spring Boot初次搭建
  18. WPF的Style的TargetType不同写法的异同
  19. 005.KVM日常管理2-virt管理
  20. chorme 浏览器记住密码后input黄色背景处理

热门文章

  1. lvs+keepalived+bind实现负载均衡高可用智能dns
  2. js 元素Dom新建并插入页面createElement
  3. 方法return外部链接
  4. 在Linux中配置DNS的正确方式
  5. use-svn-cmd(Linux)
  6. C++编译错误C2365
  7. Hibernate 中的DetachedCriteria。
  8. 06 nginx Location详解之精准匹配
  9. saltstack之文件管理
  10. bugzilla部署记录