sensu-plugins-sensu 1.0.0 → 1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04111b997fea6a2aa5d6a1659b03e99cb5d68bbf
4
- data.tar.gz: 54f75cddacfeefb9bf10fb0e159c3f17e66766f0
3
+ metadata.gz: 0b1dc08f3738b0fd95acffec934884652663144b
4
+ data.tar.gz: ead7c198234a2b20ddfa6b8fb4e14e2cd7dc6cd2
5
5
  SHA512:
6
- metadata.gz: acae33c98fbda17c612c842afba2916a320775d5815af897ecb5248a764fb0ea53328983a3b21db3b1f94848d4bbbbce55ade95d817924ff50b99e40b1475ece
7
- data.tar.gz: 0c32247f9a2778ae88d98b1360fb67082c02a6def6c249f863b613579b406a47263fafc6fd1b4d42fa2dd3a4fdcbd5d08b94e6a7fc83961b08f944e034373ba8
6
+ metadata.gz: cb26f7773c55f9b0cab1d852808fcbbf46efd1d67c340b6aed77e8da58216e75c6836fcab56c998d20c80707465265abf92da5b1d868e7399281f9d8edaba968
7
+ data.tar.gz: 7ad272ad84cb4fd0f199c86f6e1a9ed2600dbaaad3e9c66ec8a4167aa32a95185e938f51280eb4034ec79feeb3b9245dbc1fb5d1462ef1e64d77119a81346d77
data/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [1.1.0] - 2017-06-25
9
+ ### Added
10
+ - Add support for client invalidation on deregister handler (@Evesy)
11
+
12
+ ### Fixed
13
+ - handler-sensu-deregister.rb: Fix undefined variable in case of API error. (@cyrilgdn)
14
+
8
15
  ## [1.0.0] - 2016-07-13
9
16
  ### Added
10
17
  - metrics-events.rb: new plugin to track number of warnings/critical overtime
@@ -40,7 +47,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
40
47
  ### Added
41
48
  - initial release
42
49
 
43
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/1.0.0...HEAD
50
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/1.1.0...HEAD
51
+ [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/1.0.0...1.1.0
44
52
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/0.1.0...1.0.0
45
53
  [0.1.0]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/0.0.2...0.1.0
46
54
  [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-sensu/compare/0.0.1...0.0.2
@@ -4,12 +4,30 @@ require 'rubygems'
4
4
  require 'sensu-handler'
5
5
 
6
6
  class Deregister < Sensu::Handler
7
+ option :invalidate,
8
+ description: 'Invalidate Client',
9
+ short: '-i',
10
+ long: '--invalidate',
11
+ default: false
12
+
13
+ option :invalidate_expire,
14
+ description: 'Invalidate Duration (seconds)',
15
+ short: '-d duration',
16
+ long: '--duration duration',
17
+ required: false
18
+
7
19
  def handle
8
20
  delete_sensu_client!
9
21
  end
10
22
 
11
23
  def delete_sensu_client!
12
- response = api_request(:DELETE, '/clients/' + @event['client']['name']).code
24
+ if config[:invalidate] && config[:invalidate_expire]
25
+ response = api_request(:DELETE, '/clients/' + @event['client']['name'] + "?invalidate=#{config[:invalidate]}&#{config[:invalidate_expire]}").code
26
+ elsif config[:invalidate]
27
+ response = api_request(:DELETE, '/clients/' + @event['client']['name'] + "?invalidate=#{config[:invalidate]}").code
28
+ else
29
+ response = api_request(:DELETE, '/clients/' + @event['client']['name']).code
30
+ end
13
31
  deletion_status(response)
14
32
  end
15
33
 
@@ -22,7 +40,7 @@ class Deregister < Sensu::Handler
22
40
  when '500'
23
41
  puts "500: Miscellaneous error when deleting #{@event['client']['name']}"
24
42
  else
25
- puts "#{res}: Completely unsure of what happened!"
43
+ puts "Completely unsure of what happened, status code: #{code}"
26
44
  end
27
45
  end
28
46
 
@@ -2,7 +2,7 @@ module SensuPluginsSensu
2
2
  # This defines the version of the gem
3
3
  module Version
4
4
  MAJOR = 1
5
- MINOR = 0
5
+ MINOR = 1
6
6
  PATCH = 0
7
7
 
8
8
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-sensu
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.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: 2016-07-14 00:00:00.000000000 Z
11
+ date: 2017-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -227,9 +227,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
- rubygems_version: 2.5.1
230
+ rubygems_version: 2.4.5
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Sensu plugins for sensu
234
234
  test_files: []
235
- has_rdoc: