sensu-plugins-http 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +6 -1
 - data/bin/metrics-http-json.rb +16 -1
 - data/lib/sensu-plugins-http/version.rb +2 -2
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 787e9ab708f3f4df38809c9ee61e09f85ceb76fb15c26b9f78376e91bb6cc9e9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 2b28a731f62a4d274019a6a6fa545266d005b953b321fd9a22a500c2a9ede37e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: b293fb0d9c094e8ccb826a3c82108e099bb42d3776a1fbc6b1893ea39e2a64101166d3f74c2fc3adeaf618c7d7078f229e77ab5262cde3553733a205db238bc6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 8d62f5fd639e01c74c278910c223d145912bdfa4ecb16c4acb929d28bba9edffd65b5bb2cae878eec79feb37cee4290e5a62ddd02bf000bf5e613f3a543c5101
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -5,6 +5,10 @@ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            ## [Unreleased]
         
     | 
| 
       7 
7 
     | 
    
         | 
| 
      
 8 
     | 
    
         
            +
            ## [6.1.0] - 2020-04-03
         
     | 
| 
      
 9 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 10 
     | 
    
         
            +
            - `metrics-http-json.rb`: Added `-H/--header` flag to pass custom HTTP headers. (@mblaettler)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       8 
12 
     | 
    
         | 
| 
       9 
13 
     | 
    
         
             
            ## [6.0.1] - 2020-01-30
         
     | 
| 
       10 
14 
     | 
    
         
             
            ### Fixed
         
     | 
| 
         @@ -274,7 +278,8 @@ metrics-http-json.rb: Added debug option to see the processing of json data 
     | 
|
| 
       274 
278 
     | 
    
         
             
            ### Added
         
     | 
| 
       275 
279 
     | 
    
         
             
            - Initial release
         
     | 
| 
       276 
280 
     | 
    
         | 
| 
       277 
     | 
    
         
            -
            [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/6.0 
     | 
| 
      
 281 
     | 
    
         
            +
            [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-http/compare/6.1.0...HEAD
         
     | 
| 
      
 282 
     | 
    
         
            +
            [6.1.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/6.0.1...6.1.0
         
     | 
| 
       278 
283 
     | 
    
         
             
            [6.0.1]: https://github.com/sensu-plugins/sensu-plugins-http/compare/6.0.0...6.0.1
         
     | 
| 
       279 
284 
     | 
    
         
             
            [6.0.0]: https://github.com/sensu-plugins/sensu-plugins-http/compare/5.1.1...6.0.0
         
     | 
| 
       280 
285 
     | 
    
         
             
            [5.1.1]: https://github.com/sensu-plugins/sensu-plugins-http/compare/5.1.0...5.1.1
         
     | 
    
        data/bin/metrics-http-json.rb
    CHANGED
    
    | 
         @@ -60,6 +60,11 @@ class HttpJsonGraphite < Sensu::Plugin::Metric::CLI::Graphite 
     | 
|
| 
       60 
60 
     | 
    
         
             
                     short: '-m METRIC::JSONKEY',
         
     | 
| 
       61 
61 
     | 
    
         
             
                     long: '--metric METRIC::JSONKEY'
         
     | 
| 
       62 
62 
     | 
    
         | 
| 
      
 63 
     | 
    
         
            +
              option :headers,
         
     | 
| 
      
 64 
     | 
    
         
            +
                     description: 'Additional HTTP request headers to send. Example: Authorization:XYZ,User-Agent:ABC',
         
     | 
| 
      
 65 
     | 
    
         
            +
                     short: '-H HEADER1:val,HEADER2:val',
         
     | 
| 
      
 66 
     | 
    
         
            +
                     long: '--headers HEADER1:val,HEADER2:val'
         
     | 
| 
      
 67 
     | 
    
         
            +
             
     | 
| 
       63 
68 
     | 
    
         
             
              option :object,
         
     | 
| 
       64 
69 
     | 
    
         
             
                     description: 'The JSON object containing the data',
         
     | 
| 
       65 
70 
     | 
    
         
             
                     short: '-o OBJECT',
         
     | 
| 
         @@ -85,13 +90,23 @@ class HttpJsonGraphite < Sensu::Plugin::Metric::CLI::Graphite 
     | 
|
| 
       85 
90 
     | 
    
         
             
                if config[:object]
         
     | 
| 
       86 
91 
     | 
    
         
             
                  object = config[:object].to_s
         
     | 
| 
       87 
92 
     | 
    
         
             
                end
         
     | 
| 
      
 93 
     | 
    
         
            +
             
     | 
| 
      
 94 
     | 
    
         
            +
                header_dict = {}
         
     | 
| 
      
 95 
     | 
    
         
            +
                if config[:headers]
         
     | 
| 
      
 96 
     | 
    
         
            +
                  config[:headers].split(',').each do |header|
         
     | 
| 
      
 97 
     | 
    
         
            +
                    h, v = header.split(':', 2)
         
     | 
| 
      
 98 
     | 
    
         
            +
                    header_dict[h] = v.strip
         
     | 
| 
      
 99 
     | 
    
         
            +
                  end
         
     | 
| 
      
 100 
     | 
    
         
            +
                end
         
     | 
| 
      
 101 
     | 
    
         
            +
             
     | 
| 
       88 
102 
     | 
    
         
             
                # TODO: figure out what to do here
         
     | 
| 
       89 
103 
     | 
    
         
             
                url = URI.encode(config[:url].to_s) # rubocop:disable Lint/UriEscapeUnescape
         
     | 
| 
       90 
104 
     | 
    
         
             
                begin
         
     | 
| 
       91 
105 
     | 
    
         
             
                  r = RestClient::Request.execute(
         
     | 
| 
       92 
106 
     | 
    
         
             
                    url: url,
         
     | 
| 
       93 
107 
     | 
    
         
             
                    method: :get,
         
     | 
| 
       94 
     | 
    
         
            -
                    verify_ssl: !config[:insecure]
         
     | 
| 
      
 108 
     | 
    
         
            +
                    verify_ssl: !config[:insecure],
         
     | 
| 
      
 109 
     | 
    
         
            +
                    headers: header_dict
         
     | 
| 
       95 
110 
     | 
    
         
             
                  )
         
     | 
| 
       96 
111 
     | 
    
         | 
| 
       97 
112 
     | 
    
         
             
                  puts "Http response: #{r}" if config[:debug]
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: sensu-plugins-http
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 6.0 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 6.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sensu-Plugins and contributors
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2020- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2020-04-04 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: aws-sdk
         
     |