Page 1 of 1
check_http ?
Posted: Fri May 23, 2014 10:22 am
by Sbergonzi
I'm configuring a URL check using check_http and it's erring. I can access the URL directly to a browser and it works fine, page displays with the text I'm searching for.
Code: Select all
Command: /usr/local/nagios/libexec/check_http -H <my DNS> -s "<string to check for>" -f ok -I <my IP> -u "<web page unprotected>" -p 80
OUTPUT: HTTP CRITICAL: HTTP/1.1 302 Moved Temporarily - string '<string to check for>' not found on '<my web page>' - 150 bytes in 0.157 second response time |time=0.156609s;;;0.000000 size=150B;;;0
Any thoughts?
Re: check_http ?
Posted: Fri May 23, 2014 10:29 am
by slansing
Well it looks like it can't find the string you are trying to match, unfortunately since you blocked it out, and we likely don't have access to that site, there is not a whole lot we can do to check this. A 302 indicates a redirection issue, are you checking the first page of the primary address that DNS is giving you? Or are you checking a page further down the rabbit hole which you are normally redirected to? check_http has usage output regarding follow/redirect that may be of assistance. Try running the plugin like so to see these options:
Code: Select all
/usr/local/nagios/libexec/check_http -h
Re: check_http ?
Posted: Fri May 23, 2014 11:16 am
by Sbergonzi
I've tried follow and that returns an SSL error, redirect isn't an option that I see for the -f parameter or any other parameter.
Code: Select all
OUTPUT: CRITICAL - Cannot make SSL connection.
The page is the first page of the DNS and the string does appear as quoted.
Re: check_http ?
Posted: Fri May 23, 2014 11:30 am
by abrist
Could you try changing -f ok to -f follow? (I am assuming the string you are looking for is on the redirected page)
Code: Select all
/usr/local/nagios/libexec/check_http -H <my DNS> -s "<string to check for>" -f follow -I <my IP> -u "<web page unprotected>" -p 80
Re: check_http ?
Posted: Fri May 23, 2014 11:33 am
by Sbergonzi
i did, that's when i get the SSL error
Re: check_http ?
Posted: Fri May 23, 2014 11:34 am
by abrist
Does the redirect force to 443? If so, don't specify a port, or try to change the port to 443:
Code: Select all
usr/local/nagios/libexec/check_http -H <my DNS> -s "<string to check for>" -f follow -I <my IP> -u "<web page unprotected>" -p 443
usr/local/nagios/libexec/check_http -H <my DNS> -s "<string to check for>" -f follow -I <my IP> -u "<web page unprotected>"
Re: check_http ?
Posted: Fri May 23, 2014 2:20 pm
by Sbergonzi
Sorry, I should have added that detail. I have tried those options.
Re: check_http ?
Posted: Fri May 23, 2014 4:19 pm
by Sbergonzi
i changed the IP to be the direct server IP vs. our load balanced IP and that worked ok. It seems that was causing it.
thanks!
Re: check_http ?
Posted: Tue May 27, 2014 9:13 am
by tmcdonald
Closing thread.