sensu-plugins-http icon indicating copy to clipboard operation
sensu-plugins-http copied to clipboard

Follow redirects option for check-http.rb

Open busseyl opened this issue 7 years ago • 1 comments

This is a feature request:

There are occasions where we need to monitor a HTTP endpoint that has a redirect. Currently, we set up two checks, one that confirms the first hop is a redirect (setting the redirect switch to return a OK status code), and one that confirms the second hop is 200 OK.

It would be beneficial to have this occur in just one check, where the option to follow the redirect(s) is included in the check-http.rb script. This way we can also use the additional functionality of checking output, etc in the output of the final hop.

It appears to me that there is already code in the check-head-redirect.rb script that would apply.

busseyl avatar May 09 '18 17:05 busseyl

That makes sense to me from a usability standpoint but I think that complicates the logic quite a bit and makes it less clear as to what is the issue. I am open to it but its not something I have any bandwidth or need for right now. If there would be shared logic we can abstract it into a library to avoid duplication across condition checking and metric gathering scripts.

majormoses avatar Sep 21 '18 21:09 majormoses