NagiosUnderCheck_httpThe specific ZT parameters are important. Let's take a look ..
// Display version
#./Check_http-V
Check_http v2053 (nagios-plugins 1.4.13)
//-H -U -P
(You cannot directly write a URL using-u. You must use-H when using-u. The URL with-u can be full or relative)
- #./check_http -H www.****.com
-
Http OK http/1.1 200 OK-106540 bytes in 1.833 seconds | time = 1.833151 s; 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 ; The first line of string returned by the server is expected to match
- # ./check_http -H www.laabaa.com -e "200 OK"
-
Http OK http/1.1 200 OK-106540 bytes in 1.736 seconds | time = 1.736245 s; 0.000000 size = 106540B; 0
- # ./check_http -H www.laabaa.com -e "200 notOK"
-
Http critical-Invalid HTTP response received ed from host: HTTP/1.1 200 OK
//-S ; Expected string in the page code
//-M; Last modified time of the page, such as 1 m, 1 h, and 1d (minutes, hours, days );
- # ./check_http -I 192.168.100.107 -u /cehq/zhishu.html -M 1m
-
Http critical-Last modified 1:11:40 ago
//-M : ; Minimum page size (bytes): maximum page size (bytes)
- # ./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 and-c; Define the alarm thresholds of warning and critical (unit: 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.001646 s; 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.001778 s; 0.000100; 0.000000 size = 3466B; 0
//-N; check a page access. In order to get a better response time, do not read the page body, 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.014826 s; 0.000000 size = 4300B; 0
//-A; access the authentication page with the user name and password:
- # ./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.004006 s; 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.004724 s; 0.000000 size = 911B; 0
//-T; connection timeout time (default: 10 seconds)
- #./check_http -H laabaa.com
-
Http OK http/1.1 200 OK-106540 bytes in 1.840 seconds | time = 1.839614 s; 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
The preceding commonly used parameters do not include post, header, and other related parameters.
When nagios is applied, we are more concerned about check_http. This function is very useful!