nagios下的check_http ZT具体参数是一个比较重要的点,我带大家来看看。.

//显示版本

#./check_http -V

check_http v2053 (nagios-plugins 1.4.13)

//-H -u -p

(不能直接-u写URL,用-u时要用-H;-u带的URL可以写全或相对)

  1. #./check_http -H www.****.com

HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.833 seconds |time=1.833151s;;;0.000000 size=106540B;;;0

  1. #./check_http -H www.****.com -u /url1/url2/index.html
  2. #./check_http -H www.****.com -u http://www.****.com/url1/url2/index.html
  3. #./check_http -H www.****.com -p 80 -u http://www.****.com/url1/url2/index.html

//-I

  1. #./check_http -I xxx.xxx.xxx -u /url1/url2/index.html

//-e ; 预期服务器返回的第一行字串匹配

  1. # ./check_http -H www.laabaa.com -e "200 OK"

HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.736 seconds |time=1.736245s;;;0.000000 size=106540B;;;0

  1. # ./check_http -H www.laabaa.com -e "200 notOK"

HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 200 OK

//-s ; 预期页面代码中的字串

//-M ;检测页面的 Last modified时间,如1m,1h,1d等(分钟,小时,天);

  1. # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -M 1m

HTTP CRITICAL - Last modified 1:11:40 ago

//-m :; 最小页面size(bytes):最大页面size(bytes)

  1. # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -m 100:200

HTTP WARNING: page size 3466 too large|size=3466B;100;0;0

//-w和-c;定义warning和critical的告警阀值(单元:seconds)

  1. # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -w 0.0001

HTTP WARNING: - HTTP/1.1 200 OK - 0.002 second response time |time=0.001646s;0.000100;;0.000000 size=3466B;;;0

  1. # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -c 0.0001

HTTP CRITICAL: - HTTP/1.1 200 OK - 0.002 second response time |time=0.001778s;;0.000100;0.000000 size=3466B;;;0

// -N; 检查一个页面访问,为了获得较好的响应时间,不读取页面体,no-body:

  1. # ./check_http -H www.ce.cn -u /index.shtml -N

HTTP OK: HTTP/1.1 200 OK - 4300 bytes in 0.015 second response time |time=0.014826s;;;0.000000 size=4300B;;;0

// -a; 以用户名密码访问一个需认证的页面:

  1. # ./check_http -I 10.10.10.32 -u /nagios/

HTTP WARNING: HTTP/1.1 401 Authorization Required - 717 bytes in 0.004 second response time |time=0.004006s;;;0.000000 size=717B;;;0

  1. # ./usr/lib/nagios/plugins/check_http -I 192.168.10.2 -u /nagios/ -a nagios:nagios

HTTP OK: HTTP/1.1 200 OK - 911 bytes in 0.005 second response time |time=0.004724s;;;0.000000 size=911B;;;0

//-t;连接超时的时间(default:10seconds)

  1. #./check_http -H laabaa.com

HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.840 seconds |time=1.839614s;;;0.000000 size=106540B;;;0

  1. #./check_http -H laabaa.com -t 1

CRITICAL - Socket timeout after 1 seconds

//-v;verbose,show details for command-line debugging

以上常用的,没有post、header等相关的参数。

在应用nagios时,我们得多关心下check_http,这个功能非常好用!

最新文章

  1. POJ1743 Musical Theme [后缀数组]
  2. VS2015 编译 Qwt6.1.3
  3. The Engine Document of JustWeEngine
  4. JAVA 常用框架和工具
  5. OpenCV imread读取图片,imshow展示图片,出现cv:Exception at memory location异常
  6. windows2003 单网卡 搭建vpn ,windows 2008 R2 类似吧。网上转的,自己加了点经验总结
  7. Servlet程序访问的流程
  8. arguments .length .callee caller
  9. CSS3 中的按钮效果与进度条
  10. ThreadLocal来管理事务
  11. ECMAScript 6 笔记(二)
  12. express+handlebars 快速搭建网站前后台
  13. ACM-ICPC 2018 徐州赛区网络预赛 J Maze Designer(最大生成树+LCA)
  14. 算法相关——Java排序算法之希尔排序(五)
  15. 为什么ssh 执行完命令以后 挂了, hang , stop respond
  16. 2.Yum仓库优化
  17. LeetCode 第 342 题(Power of Four)
  18. MySQL主从常见的架构
  19. JS-提取字符串—>>普通方法VS正则表达式
  20. 'qt_sql_default_connection' is still in use

热门文章

  1. PowerDesigner16.5 生成SQL脚本执行出错:collate chinese_prc_ci_as
  2. Visual Studio 2012下Box2D开发环境设置
  3. UITableView的简单使用
  4. OC2-重写
  5. javascript笔记——cookie解析
  6. Ubuntu将软件(Sublime Text 2为例)锁定到启动器
  7. 基础学习总结(三)--文本、SD卡数据读写
  8. 关于html5 -- plus Webview模块管理应用窗口界面
  9. Spark Streaming揭秘 Day18 空RDD判断及程序中止机制
  10. svn团队环境