check_http follow redirect error
Posted: Wed Oct 20, 2010 3:01 pm
I am monitoring web pages which get redirected and search for a string on the final page.
The link starts off at "http://www.conedsolutions.com/sapphire/default.asp" which gets redirected to "http://www.conedsolutions.com/ces_enroll/default.aspx".
The check command is as follows ( $HOSTNAME$ = http://www.conedsolutions.com ):
check_http -H $HOSTNAME$ -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today"
The test always returns an error that the string was not found. From a web browser the links work correctly.
From the command line I see the following:
./check_http -H http://www.conedsolutions.com -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today"
HTTP CRITICAL - string not found|time=0.147702s;5.000000;10.000000;0.000000 size=460B;;;0
If I run it in debug mode, I see the reference to the final location but it never actually goes there.
./check_http -H http://www.conedsolutions.com -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today" -v
GET /Sapphire/default.asp HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/Sapphire/default.asp is 337 characters
STATUS: HTTP/1.1 302 Object Moved
**** HEADER ****
Location: https://www.conedsolutions.com/CES_Enroll/Sapphire
Server: Microsoft-IIS/5.0
Content-Type: text/html
Content-Length: 173
**** CONTENT ****
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.conedsolutions.com/CES_Enro ... </a></body>
Redirection to https://www.conedsolutions.com:443/CES_Enroll/Sapphire
GET /CES_Enroll/Sapphire HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/CES_Enroll/Sapphire is 339 characters
STATUS: HTTP/1.1 302 Object Moved
**** HEADER ****
Location: https://www.conedsolutions.com/CES_Enroll/Sapphire/
Server: Microsoft-IIS/5.0
Content-Type: text/html
Content-Length: 174
**** CONTENT ****
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.conedsolutions.com/CES_Enro ... </a></body>
Redirection to https://www.conedsolutions.com:443/CES_Enroll/Sapphire/
GET /CES_Enroll/Sapphire/ HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/CES_Enroll/Sapphire/ is 460 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: Microsoft-IIS/5.0
Date: Wed, 20 Oct 2010 19:35:49 GMT
X-Powered-By: ASP.NET
X-UA-Compatible: IE=7
Connection: Keep-Alive
Content-Length: 237
Content-Type: text/html
Cache-control: private
**** CONTENT ****
<html>
<head>
</head>
<body>
<form name=t id=t action=/CES_Enroll/Default.aspx method=post ><input type=hidden name=AGENT value=177 ><input type=hidden name=PROMO value= ></form><script>t.submit();</script>
</body>
</html>
HTTP CRITICAL - string not found|time=0.134249s;5.000000;10.000000;0.000000 size=460B;;;0
The link starts off at "http://www.conedsolutions.com/sapphire/default.asp" which gets redirected to "http://www.conedsolutions.com/ces_enroll/default.aspx".
The check command is as follows ( $HOSTNAME$ = http://www.conedsolutions.com ):
check_http -H $HOSTNAME$ -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today"
The test always returns an error that the string was not found. From a web browser the links work correctly.
From the command line I see the following:
./check_http -H http://www.conedsolutions.com -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today"
HTTP CRITICAL - string not found|time=0.147702s;5.000000;10.000000;0.000000 size=460B;;;0
If I run it in debug mode, I see the reference to the final location but it never actually goes there.
./check_http -H http://www.conedsolutions.com -f follow -u "/Sapphire/default.asp" -S -w 5 -c 10 -s "Sign up today" -v
GET /Sapphire/default.asp HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/Sapphire/default.asp is 337 characters
STATUS: HTTP/1.1 302 Object Moved
**** HEADER ****
Location: https://www.conedsolutions.com/CES_Enroll/Sapphire
Server: Microsoft-IIS/5.0
Content-Type: text/html
Content-Length: 173
**** CONTENT ****
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.conedsolutions.com/CES_Enro ... </a></body>
Redirection to https://www.conedsolutions.com:443/CES_Enroll/Sapphire
GET /CES_Enroll/Sapphire HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/CES_Enroll/Sapphire is 339 characters
STATUS: HTTP/1.1 302 Object Moved
**** HEADER ****
Location: https://www.conedsolutions.com/CES_Enroll/Sapphire/
Server: Microsoft-IIS/5.0
Content-Type: text/html
Content-Length: 174
**** CONTENT ****
<head><title>Document Moved</title></head>
<body><h1>Object Moved</h1>This document may be found <a HREF="https://www.conedsolutions.com/CES_Enro ... </a></body>
Redirection to https://www.conedsolutions.com:443/CES_Enroll/Sapphire/
GET /CES_Enroll/Sapphire/ HTTP/1.0
User-Agent: check_http/v2053 (nagios-plugins 1.4.13)
Connection: close
Host: http://www.conedsolutions.com
https://www.conedsolutions.com:443/CES_Enroll/Sapphire/ is 460 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Server: Microsoft-IIS/5.0
Date: Wed, 20 Oct 2010 19:35:49 GMT
X-Powered-By: ASP.NET
X-UA-Compatible: IE=7
Connection: Keep-Alive
Content-Length: 237
Content-Type: text/html
Cache-control: private
**** CONTENT ****
<html>
<head>
</head>
<body>
<form name=t id=t action=/CES_Enroll/Default.aspx method=post ><input type=hidden name=AGENT value=177 ><input type=hidden name=PROMO value= ></form><script>t.submit();</script>
</body>
</html>
HTTP CRITICAL - string not found|time=0.134249s;5.000000;10.000000;0.000000 size=460B;;;0