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

add custom HTTP headers to metrics-http-json.rb #177

Closed mblaettler closed 4 years ago

mblaettler commented 4 years ago

Added -H/--header flag to pass custom HTTP headers in metrics-http-json.rb. This makes it possible to use authentication token or any other function based on HTTP headers.

Pull Request Checklist

Is this in reference to an existing issue?

176

General

Purpose

Currently it is not possible to pass custom HTTP headers to the request. This would be nice, because it would enable to use Authentication tokens or any other function based on HTTP headers.

Known Compatibility Issues

mblaettler commented 4 years ago

I squashed your changes into my commit. There was also a change in Line 95&96 required.

In addition, I installed the plugin on our sensu instance to test it. It seems to work fine.

majormoses commented 4 years ago

I will try to get a release out tonight or tomorrow.

mblaettler commented 4 years ago

I will try to get a release out tonight or tomorrow.

Thank you very much. Have a nice day and stay healthy. :-)

majormoses commented 4 years ago

Sorry this slipped through I have cut a release and once CI passes it will be pushed to rubygems. I will check back later to make sure there are no hiccups.