Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_http.rb: Whole response option prints whole response even if the check is successful #85

Open
mfornasa opened this issue Nov 17, 2017 · 2 comments

Comments

@mfornasa
Copy link

mfornasa commented Nov 17, 2017

    -w, --whole-response             Print whole output when check fails

-w prints HTTP body even if the check is successful.

@jplindquist
Copy link
Contributor

jplindquist commented Feb 2, 2018

To me, the option seems to imply that the whole response should be returned regardless of the response code when the check fails. Currently it looks like this setting only returns the body if the status != 2xx. I don't know if this is an old issue that's still valid or not, so I don't mean to hijack it, but I would like to also have this option include the body not only on when we get a non 2xx response, but also if the expected key is not found, or does not meet one of the conditions specified.

@majormoses Would you be open to a PR that updates how this option works to include the response on other failures as well?

@majormoses
Copy link
Member

majormoses commented Feb 2, 2018

Man that check is a mess, I guess that's what happens when you try to implement curl and every monitoring use case around it without proper design.

Based on the description of the check option I would assume that it should print the body when status != "ok" meaning for warning, critical, or unknown statuses which has nothing to do with status codes. The function that generates it should always return the whole body put that does not mean it is printed until the status is evaluated.

I think there are use cases to assert that something intentionally does not exist, that something redirects, etc which would be a non 200 response which leads me to think that this should be a per status configurable setting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants