Page 1 of 1

check_http - bypass cert check on SSL AND follow HTML redire

Posted: Mon Dec 08, 2014 2:58 pm
by Jtessaro
I have two issues/questions with check_http

1. Due to the way some of our infrastructure is set up we have occasion instances where an internal site will still support an essential business function but will not have a valid SSL Certificate; these instances are normally temporary and exist during the decommission or upgrade periods for old internal processes. During this period we still want to be able to use Nagios to monitor the content of the web page to make sure things are loading as expected form databases or what have you. Is there a way to use check_http to monitor the content of a page that has a bad SSL Certificate?

2. We have not had any luck using check_http to check page content behind an HTML redirect. This is a real example with URLs changed for privacy:

this.that.com uses an HTML refresh (redirect) to redirect to http://www.this.com/tr/that/ which contains the following text: "Type the code".

Code: Select all

[root:libexec]# ./check_http -H this.that.com -s 'Type the code' -f follow -u "/" -4
HTTP CRITICAL: HTTP/1.1 200 OK - string 'Type the code' not found on 'http://this.that.com:80/' - 423 bytes in 0.042 second response time |time=0.041859s;;;0.000000 size=423B;;;0
As it turns out the above fails because check_http is trying to read the content of the redirect page (this.that.com), see below.

Code: Select all

[root:libexec]# ./check_http -H this.that.com -s 'Type the code' -f follow -u "/" -4 -v
GET / HTTP/1.1
User-Agent: check_http/v2.0.3 (nagios-plugins 2.0.3)
Connection: close
Host: this.that.com
Accept: */*


http://this.that.com:80/ is 423 characters
STATUS: HTTP/1.1 200 OK
**** HEADER ****
Date: Mon, 08 Dec 2014 19:50:52 GMT
Server: Apache/2.2.15 (CentOS)
Last-Modified: Tue, 14 Jan 2014 19:56:46 GMT
ETag: "40848-9b-4453297891b80"
Accept-Ranges: bytes
Content-Length: 155
Connection: close
Content-Type: text/html; charset=UTF-8
**** CONTENT ****
<html>
<META HTTP-EQUIV="Refresh" Content="0; URL=http://www.this.com/tr/that/">
<head>
<title>this Redirect</title>
</head>
<body>

</body>
</html>

HTTP CRITICAL: HTTP/1.1 200 OK - string 'Type the code' not found on 'http://this.that.com:80/' - 423 bytes in 0.042 second response time |time=0.042296s;;;0.000000 size=423B;;;0
Any suggestion on how to follow HTML redirect for webpage content checks?

Re: check_http - bypass cert check on SSL AND follow HTML re

Posted: Mon Dec 08, 2014 7:46 pm
by Box293
Jtessaro wrote:Is there a way to use check_http to monitor the content of a page that has a bad SSL Certificate?
An expired certificate does not affect the checking of content.

Code: Select all

Command:
./check_http -H testssl-expire.disig.sk -S -s 'The test site' -u /index.en.html

Output:
HTTP OK: HTTP/1.1 200 OK - 1642 bytes in 1.462 second response time |time=1.461676s;;;0.000000 size=1642B;;;0
Jtessaro wrote:We have not had any luck using check_http to check page content behind an HTML redirect.
What version do you have?

Code: Select all

./check_http -V