sensu-plugins-dcos 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -2
- data/bin/check-dcos-component-health.rb +2 -2
- data/bin/check-dcos-container-count.rb +2 -0
- data/bin/check-dcos-container-metrics.rb +13 -9
- data/bin/check-dcos-metrics.rb +2 -0
- data/bin/check-dcos-ping.rb +3 -1
- data/bin/metrics-dcos-containers.rb +20 -15
- data/bin/metrics-dcos-host.rb +2 -0
- data/lib/sensu-plugins-dcos/common.rb +2 -0
- data/lib/sensu-plugins-dcos/version.rb +3 -1
- data/lib/sensu-plugins-dcos.rb +2 -0
- metadata +47 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a03eda3e661cc220f14f51940955d69351479d8
|
4
|
+
data.tar.gz: 243ecb43f6827b4787720c581a48bdb44b6307a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 00d554a5899608aa9c2dca86a516074411421cd9715ace71743d2a90037c933303e03b2e1b9821616468a1c236bbb3238046b5796bc60865180f93adbd9297c0
|
7
|
+
data.tar.gz: 715f1f6e7d1b62ffcae3d84074cac9b71bf514176ada02c729f2ef9632bc3ec0340f7c2954d5a3885c7aa9d5edf58aa0fa763393855ee0cf66cf02eec87335eb
|
data/CHANGELOG.md
CHANGED
@@ -4,17 +4,28 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
|
+
### [0.0.3] - 2017-08-12
|
8
|
+
### Changed
|
9
|
+
- switched from vagrant to docker testing as it's lighter weight (@majormoses)
|
10
|
+
- switched from bats to serverspec as it gives us more flexibility (@majormoses) (@luisdavim)
|
11
|
+
- upgraded rubocop and appeased it (@majormoses)
|
12
|
+
- standard `.rubocop.yml`, `CHANGELOG.md`, `Rakefile` files
|
13
|
+
|
14
|
+
### Removed
|
15
|
+
- removed various misc files from trnasfer such as circle-ci stuff (@majormoses)
|
16
|
+
|
7
17
|
|
8
18
|
## [0.0.2] - 2017-08-03
|
9
19
|
### Added
|
10
20
|
- New DC/OS Component Health check
|
11
21
|
- Extending get_value function to provide the ability to override field names
|
22
|
+
|
12
23
|
## [0.0.1] - 2017-04-18
|
13
24
|
|
14
25
|
### Added
|
15
26
|
- Initial release
|
16
27
|
|
17
|
-
|
18
|
-
[
|
28
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.0.3...HEAD
|
29
|
+
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.0.2...0.0.3
|
19
30
|
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-dcos/compare/0.0.1...0.0.2
|
20
31
|
[0.0.1]:https://github.com/sensu-plugins/sensu-plugins-dcos/compare/9c72afb596622f6c1a51f95281f52bd53791ede9...0.0.1
|
@@ -73,7 +73,7 @@ class CheckDcosComponentHealth < Sensu::Plugin::Check::CLI
|
|
73
73
|
if config[:component]
|
74
74
|
value = get_value(config[:url], config[:component], config[:filter], 'id', 'health', 'units')
|
75
75
|
message "#{config[:component]} = #{value}"
|
76
|
-
if value
|
76
|
+
if value.zero?
|
77
77
|
ok
|
78
78
|
else
|
79
79
|
critical
|
@@ -85,7 +85,7 @@ class CheckDcosComponentHealth < Sensu::Plugin::Check::CLI
|
|
85
85
|
failed += unit['health']
|
86
86
|
end
|
87
87
|
message "components.unhealthy = #{failed}"
|
88
|
-
if failed
|
88
|
+
if failed.zero?
|
89
89
|
ok
|
90
90
|
else
|
91
91
|
critical
|
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-dcos-metrics
|
4
6
|
#
|
@@ -117,17 +119,19 @@ class CheckDcosContainersApi < Sensu::Plugin::Check::CLI
|
|
117
119
|
db = Daybreak::DB.new '/tmp/dcos-metrics.db', default: 0
|
118
120
|
end
|
119
121
|
containers = get_data(config[:url])
|
120
|
-
containers.
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
db
|
122
|
+
unless containers.nil? || containers.empty?
|
123
|
+
containers.each do |container|
|
124
|
+
v = get_value("#{config[:url]}/#{container}", config[:metric], config[:filter])
|
125
|
+
if config[:delta]
|
126
|
+
prev_value = db["#{container}_#{config[:metric]}"]
|
127
|
+
db.lock do
|
128
|
+
db["#{container}_#{config[:metric]}"] = v
|
129
|
+
end
|
130
|
+
v -= prev_value
|
126
131
|
end
|
127
|
-
|
132
|
+
data[container] = v
|
128
133
|
end
|
129
|
-
|
130
|
-
end unless containers.nil? || containers.empty?
|
134
|
+
end
|
131
135
|
if config[:delta]
|
132
136
|
db.flush
|
133
137
|
db.compact
|
data/bin/check-dcos-metrics.rb
CHANGED
data/bin/check-dcos-ping.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
#! /usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
#
|
3
5
|
# check-dcos-ping
|
4
6
|
#
|
@@ -58,7 +60,7 @@ class CheckDcosPing < Sensu::Plugin::Check::CLI
|
|
58
60
|
def run
|
59
61
|
value = get_data(config[:url])['ok']
|
60
62
|
message "OK = #{value}"
|
61
|
-
if value
|
63
|
+
if value == true
|
62
64
|
ok
|
63
65
|
else
|
64
66
|
critical
|
@@ -79,25 +79,30 @@ class DCOSMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
79
79
|
|
80
80
|
def run
|
81
81
|
containers = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}")
|
82
|
-
containers.
|
83
|
-
|
84
|
-
|
85
|
-
all_metrics
|
82
|
+
unless containers.nil? || containers.empty? # rubocop:desable Style/MultilineIfModifier
|
83
|
+
containers.each do |container|
|
84
|
+
all_metrics = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}/#{container}")
|
85
|
+
if all_metrics.key?('datapoints')
|
86
|
+
all_metrics['datapoints'].each do |metric|
|
87
|
+
metric['name'].tr!('/', '.')
|
88
|
+
metric['name'].squeeze!('.')
|
89
|
+
output([config[:scheme], container, metric['unit'], metric['name']].join('.'), metric['value'])
|
90
|
+
end
|
91
|
+
end
|
92
|
+
app_metrics = get_data("http://#{config[:server]}:#{config[:port]}#{config[:uri]}/#{container}/app")
|
93
|
+
next if app_metrics['datapoints'].nil?
|
94
|
+
app_metrics['datapoints'].each do |metric|
|
95
|
+
unless metric['tags'].nil?
|
96
|
+
metric['tags'].each do |k, v|
|
97
|
+
metric['name'] = [metric['name'], k, v].join('.')
|
98
|
+
end
|
99
|
+
end
|
86
100
|
metric['name'].tr!('/', '.')
|
87
101
|
metric['name'].squeeze!('.')
|
88
|
-
output([config[:scheme], container, metric['unit'], metric['name']].join('.'), metric['value'])
|
102
|
+
output([config[:scheme], container, 'app', metric['unit'], metric['name']].join('.'), metric['value'])
|
89
103
|
end
|
90
104
|
end
|
91
|
-
|
92
|
-
app_metrics['datapoints'].each do |metric|
|
93
|
-
metric['tags'].each do |k, v|
|
94
|
-
metric['name'] = [metric['name'], k, v].join('.')
|
95
|
-
end unless metric['tags'].nil?
|
96
|
-
metric['name'].tr!('/', '.')
|
97
|
-
metric['name'].squeeze!('.')
|
98
|
-
output([config[:scheme], container, 'app', metric['unit'], metric['name']].join('.'), metric['value'])
|
99
|
-
end unless app_metrics['datapoints'].nil?
|
100
|
-
end unless containers.nil? || containers.empty?
|
105
|
+
end
|
101
106
|
ok
|
102
107
|
end
|
103
108
|
end
|
data/bin/metrics-dcos-host.rb
CHANGED
data/lib/sensu-plugins-dcos.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-dcos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PTC and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-08-
|
11
|
+
date: 2017-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -94,6 +94,26 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.3'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: mixlib-shellout
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "<"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.3.0
|
104
|
+
- - "~>"
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '2.2'
|
107
|
+
type: :development
|
108
|
+
prerelease: false
|
109
|
+
version_requirements: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - "<"
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: 2.3.0
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '2.2'
|
97
117
|
- !ruby/object:Gem::Dependency
|
98
118
|
name: pry
|
99
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,14 +176,14 @@ dependencies:
|
|
156
176
|
requirements:
|
157
177
|
- - "~>"
|
158
178
|
- !ruby/object:Gem::Version
|
159
|
-
version: 0.
|
179
|
+
version: 0.49.0
|
160
180
|
type: :development
|
161
181
|
prerelease: false
|
162
182
|
version_requirements: !ruby/object:Gem::Requirement
|
163
183
|
requirements:
|
164
184
|
- - "~>"
|
165
185
|
- !ruby/object:Gem::Version
|
166
|
-
version: 0.
|
186
|
+
version: 0.49.0
|
167
187
|
- !ruby/object:Gem::Dependency
|
168
188
|
name: yard
|
169
189
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +198,20 @@ dependencies:
|
|
178
198
|
- - "~>"
|
179
199
|
- !ruby/object:Gem::Version
|
180
200
|
version: '0.8'
|
201
|
+
- !ruby/object:Gem::Dependency
|
202
|
+
name: serverspec
|
203
|
+
requirement: !ruby/object:Gem::Requirement
|
204
|
+
requirements:
|
205
|
+
- - "~>"
|
206
|
+
- !ruby/object:Gem::Version
|
207
|
+
version: 2.36.1
|
208
|
+
type: :development
|
209
|
+
prerelease: false
|
210
|
+
version_requirements: !ruby/object:Gem::Requirement
|
211
|
+
requirements:
|
212
|
+
- - "~>"
|
213
|
+
- !ruby/object:Gem::Version
|
214
|
+
version: 2.36.1
|
181
215
|
- !ruby/object:Gem::Dependency
|
182
216
|
name: test-kitchen
|
183
217
|
requirement: !ruby/object:Gem::Requirement
|
@@ -193,19 +227,19 @@ dependencies:
|
|
193
227
|
- !ruby/object:Gem::Version
|
194
228
|
version: '1.6'
|
195
229
|
- !ruby/object:Gem::Dependency
|
196
|
-
name: kitchen-
|
230
|
+
name: kitchen-docker
|
197
231
|
requirement: !ruby/object:Gem::Requirement
|
198
232
|
requirements:
|
199
233
|
- - "~>"
|
200
234
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
235
|
+
version: '2.6'
|
202
236
|
type: :development
|
203
237
|
prerelease: false
|
204
238
|
version_requirements: !ruby/object:Gem::Requirement
|
205
239
|
requirements:
|
206
240
|
- - "~>"
|
207
241
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
242
|
+
version: '2.6'
|
209
243
|
- !ruby/object:Gem::Dependency
|
210
244
|
name: kitchen-localhost
|
211
245
|
requirement: !ruby/object:Gem::Requirement
|
@@ -239,13 +273,13 @@ description: |-
|
|
239
273
|
for monitoring and metrics collection.
|
240
274
|
email: "<sensu-users@googlegroups.com>"
|
241
275
|
executables:
|
242
|
-
- check-dcos-component-health.rb
|
243
|
-
- check-dcos-container-count.rb
|
244
|
-
- check-dcos-ping.rb
|
245
276
|
- check-dcos-metrics.rb
|
277
|
+
- metrics-dcos-host.rb
|
278
|
+
- check-dcos-container-count.rb
|
246
279
|
- check-dcos-container-metrics.rb
|
280
|
+
- check-dcos-component-health.rb
|
281
|
+
- check-dcos-ping.rb
|
247
282
|
- metrics-dcos-containers.rb
|
248
|
-
- metrics-dcos-host.rb
|
249
283
|
extensions: []
|
250
284
|
extra_rdoc_files: []
|
251
285
|
files:
|
@@ -264,7 +298,7 @@ files:
|
|
264
298
|
- lib/sensu-plugins-dcos/version.rb
|
265
299
|
homepage: https://github.com/PTC-Global/sensu-plugins-dcos
|
266
300
|
licenses:
|
267
|
-
-
|
301
|
+
- Apache-2.0
|
268
302
|
metadata:
|
269
303
|
maintainer: PTC
|
270
304
|
development_status: active
|
@@ -288,7 +322,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
322
|
version: '0'
|
289
323
|
requirements: []
|
290
324
|
rubyforge_project:
|
291
|
-
rubygems_version: 2.
|
325
|
+
rubygems_version: 2.6.11
|
292
326
|
signing_key:
|
293
327
|
specification_version: 4
|
294
328
|
summary: Sensu plugins for dcos-metrics checks and metrics
|