sensu-plugins-consul 1.3.0 → 1.4.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 +7 -1
- data/bin/check-consul-service-health.rb +23 -2
- data/lib/sensu-plugins-consul/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f48a4e2a7f877e1ff1d36c560af2c6c672115508
|
4
|
+
data.tar.gz: 22a6edf01988e00527ca92efb884e798c659fdae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e07791c312aee3b4261354e5ec29cd62f765c75b55f9c97518bd4556e2dbd54f24c6b338f92e9b6e29d878cd33764d85d17bffa7d508c15e8883d6355bbd373f
|
7
|
+
data.tar.gz: 5f3d40cbfd0095c2c1f43bbb6278f555cc72573d3fd32a12c0658de51c1edebce1151bcaba530f9785ea744d15823af52dd97776f4e612b5336706ce0947a6eb
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
|
-
#Change Log
|
1
|
+
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
|
8
|
+
## [1.4.0] 2017-08-05
|
9
|
+
### Added
|
10
|
+
- `check-consul-service-health` now accept a `--node` argument that will check all autodiscovered consul services running on the specified node (@psyhomb)
|
11
|
+
|
7
12
|
## [1.3.0] 2017-05-05
|
8
13
|
### Added
|
9
14
|
- `check-consul-failures`, `check-consul-leader`, `check-consul-members`, and `check-consul-servers` now accept a --scheme parameter (@akatch)
|
@@ -76,6 +81,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
76
81
|
- initial release
|
77
82
|
|
78
83
|
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.3.0...HEAD
|
84
|
+
[1.4.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.3.0...1.4.0
|
79
85
|
[1.3.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/2.1.0...1.3.0
|
80
86
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.1.0...1.2.0
|
81
87
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-consul/compare/1.0.0...1.1.0
|
@@ -42,6 +42,11 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
|
|
42
42
|
long: '--consul SERVER',
|
43
43
|
default: 'http://localhost:8500'
|
44
44
|
|
45
|
+
option :nodename,
|
46
|
+
description: 'check all consul services running on the specified node',
|
47
|
+
short: '-n NODENAME',
|
48
|
+
long: '--node NODENAME'
|
49
|
+
|
45
50
|
option :service,
|
46
51
|
description: 'a service managed by consul',
|
47
52
|
short: '-s SERVICE',
|
@@ -74,6 +79,19 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
|
|
74
79
|
end
|
75
80
|
end
|
76
81
|
return services
|
82
|
+
elsif config[:nodename]
|
83
|
+
data = []
|
84
|
+
begin
|
85
|
+
services = Diplomat::Node.get(config[:nodename]).Services.keys
|
86
|
+
rescue
|
87
|
+
services = []
|
88
|
+
end
|
89
|
+
services.each do |service|
|
90
|
+
Diplomat::Health.checks(service).each do |check|
|
91
|
+
data.push(check) if check.Node == config[:nodename]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
return data
|
77
95
|
elsif config[:all]
|
78
96
|
Diplomat::Health.state('any')
|
79
97
|
else
|
@@ -94,7 +112,7 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
|
|
94
112
|
found = false
|
95
113
|
warnings = false
|
96
114
|
criticals = false
|
97
|
-
checks =
|
115
|
+
checks = []
|
98
116
|
|
99
117
|
# Process all of the nonpassing service checks
|
100
118
|
acquire_service_data.each do |d|
|
@@ -105,7 +123,10 @@ class CheckConsulServiceHealth < Sensu::Plugin::Check::CLI
|
|
105
123
|
# If we are passing do nothing
|
106
124
|
next if checkStatus == 'passing'
|
107
125
|
|
108
|
-
checks
|
126
|
+
checks.push(
|
127
|
+
checkId => d['Output'],
|
128
|
+
'Status' => checkStatus
|
129
|
+
)
|
109
130
|
|
110
131
|
warnings = true if %w(warning).include? checkStatus
|
111
132
|
criticals = true if %w(critical unknown).include? checkStatus
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-consul
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.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: 2017-05
|
11
|
+
date: 2017-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|