分类: LINUX
2012-11-21 10:15:08
nagios下的check_http ZT具体参数是一个比较重要的点,我带大家来看看。.
//显示版本
#./check_http -V
check_http v2053 (nagios-plugins 1.4.13)
//-H -u -p
(不能直接-u写URL,用-u时要用-H;-u带的URL可以写全或相对)
HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.833 seconds |time=1.833151s;;;0.000000 size=106540B;;;0
//-I
//-e ; 预期服务器返回的第一行字串匹配
HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.736 seconds |time=1.736245s;;;0.000000 size=106540B;;;0
HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 200 OK
//-s ; 预期页面代码中的字串
//-M ;检测页面的 Last modified时间,如1m,1h,1d等(分钟,小时,天);
HTTP CRITICAL - Last modified 1:11:40 ago
//-m :; 最小页面size(bytes):最大页面size(bytes)
HTTP WARNING: page size 3466 too large|size=3466B;100;0;0
//-w和-c;定义warning和critical的告警阀值(单元:seconds)
HTTP WARNING: - HTTP/1.1 200 OK - 0.002 second response time |time=0.001646s;0.000100;;0.000000 size=3466B;;;0
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:
HTTP OK: HTTP/1.1 200 OK - 4300 bytes in 0.015 second response time |time=0.014826s;;;0.000000 size=4300B;;;0
// -a; 以用户名密码访问一个需认证的页面:
HTTP WARNING: HTTP/1.1 401 Authorization Required - 717 bytes in 0.004 second response time |time=0.004006s;;;0.000000 size=717B;;;0
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)
HTTP OK HTTP/1.1 200 OK - 106540 bytes in 1.840 seconds |time=1.839614s;;;0.000000 size=106540B;;;0
CRITICAL - Socket timeout after 1 seconds
//-v;verbose,show details for command-line debugging
以上常用的,没有post、header等相关的参数。
在应用nagios时,我们得多关心下check_http,这个功能非常好用!