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 +4 -4
- data/CHANGELOG.md +9 -1
- data/bin/handler-sensu-deregister.rb +20 -2
- data/lib/sensu-plugins-sensu/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b1dc08f3738b0fd95acffec934884652663144b
|
4
|
+
data.tar.gz: ead7c198234a2b20ddfa6b8fb4e14e2cd7dc6cd2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
-
|
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 "
|
43
|
+
puts "Completely unsure of what happened, status code: #{code}"
|
26
44
|
end
|
27
45
|
end
|
28
46
|
|
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.
|
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:
|
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
|
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:
|