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: Optionally return content #1559

Closed
towolf opened this issue Nov 9, 2018 · 4 comments
Closed

check_http: Optionally return content #1559

towolf opened this issue Nov 9, 2018 · 4 comments

Comments

@towolf
Copy link
Contributor

towolf commented Nov 9, 2018

When using check_http on an API with a healthz endpoint, this is basically useless:

image

I'd like to see the content that the HTTP request response is returning. It's actually stating that an API on the internet that it is using is down. So I can't do anything and can ignore this problem.

@towolf
Copy link
Contributor Author

towolf commented Nov 9, 2018

I know that I probably don't want to return long HTML page content, but a flag to also include the body text would be sweet and I can't really believe that this is not supported?

@towolf
Copy link
Contributor Author

towolf commented Nov 9, 2018

Here's another example:

./plugins/check_http -H lobby-api.example.com -u /health -S
HTTP OK: HTTP/1.1 200 OK - 746 bytes in 0,119 second response time |time=0,119410s;;;0,000000;10,000000 size=746B;;;0
{"status":"UP","database":{"status":"UP"},"migration":{"status":"UP"},"rabbitMQ":{"status":"UP"},"redis":{"status":"UP"}}

I will try to make a PR with an optional flag to return the content.

towolf added a commit to towolf/monitoring-plugins that referenced this issue Nov 9, 2018
This should help with figuring out ia problem at a glance when enabled for
healthz endpoints on web APIs, for example.

The content of the body can point to what the problem is and help with
diagnostics.

Fixes monitoring-plugins#1559
@towolf
Copy link
Contributor Author

towolf commented Nov 27, 2018

Thanks for merging.

Here's an example where this is useful, Gitlab:

Before

# /usr/lib/nagios/plugins/check_http -I 127.0.0.1 -S -u /-/liveness
HTTP OK: HTTP/1.1 200 OK - 654 bytes in 0,039 second response time |time=0,039068s;;;0,000000 size=654B;;;0

After

# ./check_http -I 127.0.0.1 -S -u /-/liveness -B
HTTP OK: HTTP/1.1 200 OK - 654 bytes in 0,039 second response time |time=0,039184s;;;0,000000;10,000000 size=654B;;;0
{"db_check":{"status":"ok"},"redis_check":{"status":"ok"},"cache_check":{"status":"ok"},"queues_check":{"status":"ok"},"shared_state_check":{"status":"ok"},"gitaly_check":{"status":"ok"}}

@towolf
Copy link
Contributor Author

towolf commented Nov 27, 2018

Now we just need a release ...

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

1 participant