sensu-plugins-mesos 0.0.4 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +2 -3
- data/CHANGELOG.md +10 -3
- data/bin/check-chronos.rb +1 -1
- data/bin/check-marathon-task.rb +80 -0
- data/lib/sensu-plugins-mesos/version.rb +2 -2
- data.tar.gz.sig +0 -0
- metadata +5 -3
- metadata.gz.sig +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 84ee38fcb6677025bad5a58469d268e8d23f5168
|
4
|
+
data.tar.gz: cf5200233d9df4f9164e615465f6d8e62754709c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ef6b59be43efa0a5bbf8f82cbcb312e52660cfd09414908bff24028bbd1bda81488c2b9616b45a418bf3f57acbc333cae96e7c379f17163e9a3a359ed22fc2c
|
7
|
+
data.tar.gz: 0b254d5b6b13243362f14c9bb6b6f73d0c69d2e1215c480863d1ab39e31c5b200e47e835b95fe7f06ab0c0fa22abc12877ee815a3e1064f1863ddbfb8b7c8023
|
checksums.yaml.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
w�(�C!�[p��Y�
|
1
|
+
���И;ӻ�4�m�ẚ�)����X�b¼;����s�`U��X��ҡ�2h����'E�kAX-���.��S��aŲ����p���K��V��/T��s5���B���!��1�$�މ�'����4��w����-�Į�6��
|
2
|
+
;L�_���������ij�L�E0kA\�(v�y?��0�,y��$?���nl�
|
data/CHANGELOG.md
CHANGED
@@ -3,11 +3,13 @@ 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
|
-
|
7
|
-
- nothing
|
6
|
+
### [Unreeleased][unreleased]
|
8
7
|
|
9
|
-
## 0.0
|
8
|
+
## 0.1.0 - 2015-09-14
|
9
|
+
## Added
|
10
|
+
- Added a check comparing Marathon instances for a specific task against the configured minimum
|
10
11
|
|
12
|
+
## [0.0.4] - 2015-07-30
|
11
13
|
### Changed
|
12
14
|
- Mesos check supports multiple servers.
|
13
15
|
- Updated Rubocop to `0.32.1`
|
@@ -33,3 +35,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
33
35
|
|
34
36
|
### Added
|
35
37
|
- initial release
|
38
|
+
|
39
|
+
[unreleased]: https://github.com/sensu-plugins/sensu-plugins-mesos/compare/0.1.0...HEAD
|
40
|
+
[0.0.5]: https://github.com/sensu-plugins/sensu-plugins-mesos/compare/0.0.4...0.1.0
|
41
|
+
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-mesos/compare/0.0.2...0.0.4
|
42
|
+
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-mesos/compare/0.0.1...0.0.2
|
data/bin/check-chronos.rb
CHANGED
@@ -0,0 +1,80 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# check-marathon-task
|
4
|
+
#
|
5
|
+
# DESCRIPTION:
|
6
|
+
# This plugin checks that the given Mesos/Marathon task is running properly
|
7
|
+
#
|
8
|
+
# OUTPUT:
|
9
|
+
# plain text
|
10
|
+
#
|
11
|
+
# PLATFORMS:
|
12
|
+
# Linux
|
13
|
+
#
|
14
|
+
# DEPENDENCIES:
|
15
|
+
# gem: sensu-plugin
|
16
|
+
#
|
17
|
+
# USAGE:
|
18
|
+
# check-marathon-task.rb -s mesos-a,mesos-b,mesos-c -p 8080 -t mywebsite -i 5
|
19
|
+
# CheckMarathonTask OK: 5/5 mywebsite tasks running
|
20
|
+
#
|
21
|
+
# check-marathon-task.rb -s mesos-a,mesos-b,mesos-c -p 8080 -t mywebsite -i 5
|
22
|
+
# CheckMarathonTask CRITICAL: 3/5 mywebsite tasks running
|
23
|
+
#
|
24
|
+
# NOTES:
|
25
|
+
#
|
26
|
+
# LICENSE:
|
27
|
+
# Copyright 2015, Antoine POPINEAU (antoine.popineau@appscho.com)
|
28
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
29
|
+
# for details.
|
30
|
+
#
|
31
|
+
|
32
|
+
require 'sensu-plugin/check/cli'
|
33
|
+
require 'net/http'
|
34
|
+
require 'json'
|
35
|
+
|
36
|
+
class MarathonTaskCheck < Sensu::Plugin::Check::CLI
|
37
|
+
check_name 'CheckMarathonTask'
|
38
|
+
|
39
|
+
option :server, short: '-s SERVER', long: '--server SERVER', required: true
|
40
|
+
option :port, short: '-p PORT', long: '--port PORT', default: 8080
|
41
|
+
option :task, short: '-t TASK', long: '--task TASK', required: true
|
42
|
+
option :instances, short: '-i INSTANCES', long: '--instances INSTANCES', required: true, proc: proc(&:to_i)
|
43
|
+
|
44
|
+
def run
|
45
|
+
if config[:instances] == 0
|
46
|
+
unknown 'number of instances should be an integer'
|
47
|
+
end
|
48
|
+
|
49
|
+
failures = []
|
50
|
+
config[:server].split(',').each do |s|
|
51
|
+
begin
|
52
|
+
url = URI.parse("http://#{s}:#{config[:port]}/v2/tasks?state=running")
|
53
|
+
req = Net::HTTP::Get.new(url)
|
54
|
+
req.add_field('Accept', 'application/json')
|
55
|
+
r = Net::HTTP.new(url.host, url.port).start do |h|
|
56
|
+
h.request(req)
|
57
|
+
end
|
58
|
+
|
59
|
+
tasks = JSON.parse(r.body)['tasks']
|
60
|
+
tasks.select! do |t|
|
61
|
+
t['appId'] == "/#{config[:task]}"
|
62
|
+
end
|
63
|
+
|
64
|
+
message = "#{tasks.length}/#{config[:instances]} #{config[:task]} tasks running"
|
65
|
+
|
66
|
+
if tasks.length < config[:instances]
|
67
|
+
critical message
|
68
|
+
end
|
69
|
+
|
70
|
+
ok message
|
71
|
+
rescue Errno::ECONNREFUSED, SocketError
|
72
|
+
failures << "Marathon on #{s} could not be reached"
|
73
|
+
rescue
|
74
|
+
failures << "error caught trying to reach Marathon on #{s}"
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
unknown "marathon task state could not be retrieved:\n" << failures.join("\n")
|
79
|
+
end
|
80
|
+
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-mesos
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu Plugins and contributors
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
31
|
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rest-client
|
@@ -193,6 +193,7 @@ executables:
|
|
193
193
|
- metrics-marathon.rb
|
194
194
|
- check-mesos.rb
|
195
195
|
- check-marathon.rb
|
196
|
+
- check-marathon-task.rb
|
196
197
|
- check-chronos.rb
|
197
198
|
extensions: []
|
198
199
|
extra_rdoc_files: []
|
@@ -201,6 +202,7 @@ files:
|
|
201
202
|
- LICENSE
|
202
203
|
- README.md
|
203
204
|
- bin/check-chronos.rb
|
205
|
+
- bin/check-marathon-task.rb
|
204
206
|
- bin/check-marathon.rb
|
205
207
|
- bin/check-mesos.rb
|
206
208
|
- bin/metrics-marathon.rb
|
@@ -233,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
233
235
|
version: '0'
|
234
236
|
requirements: []
|
235
237
|
rubyforge_project:
|
236
|
-
rubygems_version: 2.4.
|
238
|
+
rubygems_version: 2.4.8
|
237
239
|
signing_key:
|
238
240
|
specification_version: 4
|
239
241
|
summary: Sensu plugins for checking mesos
|
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
�
|
2
|
-
�[
|
1
|
+
oݑ��r�\o������m���M㲠"H��k�1DZ[�dư���DISAo�*���c�CS��g���|����od�\ڜ���6t9��`�q��
|
2
|
+
�����1��i.�4�p��ʨL�q�B���%[=h� )�
|