check_http but check the redirect?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jriker1
Posts: 115
Joined: Tue Dec 15, 2015 8:40 pm

check_http but check the redirect?

Post by jriker1 »

I have a windows 2012 essentials server with a web front end that allows me to access my network remotely. I've been checking it with Nagios to verify the site is up and if not and doesn't come back after several checks, reboots the server. Recently I went from Essentials 2012 R2 to 2016. 2016 is still working but has a problem where the system will sometimes go down, but present itself differently than it did when it went down in 2012 R2. So right now I'm basically doing:

check_http -H <external_facing_URL> -S -e "HTTP/1.1 302" -u "remote"

Problem that I'm seeing is the site according to https://httpstatus.io/ returns a 302 status and then I guess a 200 (httpstatus.io shows status codes 302 -> 200). I'm seeing the 302. OK no big deal, other than with Essentials 2016 it's no longer returning a dead page when down, it's returning an error 500. So again it returns a 302 and then a 500 (per httpstatus.io 302 -> 500). But I still get a 302 back from the request so the test things everything is good. For reference the error is HTTP/1.1 500 Internal Server Error. Any way to return that secondary error code? When I go to the /remote site it shows a webpage with an ASP issue but apparently whatever httpstatus.io is picking up, not seeing that thru check_http.

Thoughts?

Thanks.

JR
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_http but check the redirect?

Post by scottwilkerson »

you want to add the following to the command to tell it to follow the redirect

Code: Select all

-f follow
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked