sensu-plugins / sensu-plugins-http

This plugin provides native HTTP instrumentation for monitoring and metrics collection, including: response code, JSON response, HTTP last modified, SSL expiry, and metrics via `curl`.
http://sensu-plugins.io
MIT License
30 stars 97 forks source link

check-http: accept multiple http status codes #98

Closed psviderski closed 6 years ago

psviderski commented 6 years ago

Pull Request Checklist

Is this in reference to an existing issue? https://github.com/sensu-plugins/sensu-plugins-http/issues/89

General

Purpose

Allow --response-code option to accept not only a single HTTP status code but also a comma-separated list of codes. In the later case expect a response with status code equal to any one from the list.

Known Compatibility Issues

majormoses commented 6 years ago

Thanks for your contribution to Sensu plugins! Without people like you submitting PRs we couldn't run the project. I will review it shortly.

majormoses commented 6 years ago

sorry looks l never finished reviewing, looking now.

majormoses commented 6 years ago

after reviewing #99 I am wondering if regex might be a better solution. Let me know what you think.

majormoses commented 6 years ago

As I have not heard back from you and #99 implemented something that unlocks your use case I am gonna close this out.

You should be able to specify multiple status codes via regex in: https://rubygems.org/gems/sensu-plugins-http/versions/2.11.0