nagios plugins之 check_http ZT
nagios下的check_http ZT具體參數(shù)是一個(gè)比較重要的點(diǎn),我?guī)Т蠹襾?lái)看看。.
//顯示版本
#./check_http -V
check_http v2053 (nagios-plugins 1.4.13)
//-H
(不能直接-u寫(xiě)URL,用-u時(shí)要用-H;-u帶的URL可以寫(xiě)全或相對(duì))
- #./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
- #./check_http -H www.****.com -u /url1/url2/index.html
- #./check_http -H www.****.com -u http://www.****.com/url1/url2/index.html
- #./check_http -H www.****.com -p 80 -u http://www.****.com/url1/url2/index.html
//-I
- #./check_http -I xxx.xxx.xxx -u /url1/url2/index.html
//-e
- # ./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
- # ./check_http -H www.laabaa.com -e "200 notOK"
HTTP CRITICAL - Invalid HTTP response received from host: HTTP/1.1 200 OK
//-s
//-M
- # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -M 1m
HTTP CRITICAL - Last modified 1:11:40 ago
//-m
- # ./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)
- # ./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
- # ./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; 檢查一個(gè)頁(yè)面訪(fǎng)問(wèn),為了獲得較好的響應(yīng)時(shí)間,不讀取頁(yè)面體,no-body:
- # ./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; 以用戶(hù)名密碼訪(fǎng)問(wèn)一個(gè)需認(rèn)證的頁(yè)面:
- # ./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
- # ./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;連接超時(shí)的時(shí)間(default:10seconds)
- #./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
- #./check_http -H laabaa.com -t 1
CRITICAL - Socket timeout after 1 seconds
//-v;verbose,show details for command-line debugging
以上常用的,沒(méi)有post、header等相關(guān)的參數(shù)。
在應(yīng)用nagios時(shí),我們得多關(guān)心下check_http,這個(gè)功能非常好用!
【編輯推薦】
- Nagios圖形化Pnp 安裝和配置 ZT
- Redhat Nagios安裝詳解
- Nagios 配置文件解析
- Nagios安裝筆記
- Suse 9 安裝Nagios過(guò)程
- Nagios擴(kuò)展的主機(jī)和服務(wù)監(jiān)測(cè)