sensu-plugins-mesos 0.0.3 → 0.0.4

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: 3e6e4221a8ad3d0a610338b4ae2f38f1ff088e43
4
- data.tar.gz: 71dbf0404d1ec3db552e5ffdf9cc96b977f0d1c2
3
+ metadata.gz: 368c0c89263c458dfe42fd499983aee29d6d7d39
4
+ data.tar.gz: bc40066db959fbe01f289e4bdd6b08136c143311
5
5
  SHA512:
6
- metadata.gz: 56b268a9694abcfea19ec63d577127f453141cbd8649921f003788d25bed30f8286c5a4265f62616b03404a623a0a1280a8e4a987e4b27ac6d9aac45b4d33697
7
- data.tar.gz: 2318e560ed0a6ffc32b547a2f703d53fa720a3751a7d3dbf7372e6dbb47685a3f26b033e90da1962ab9cb7c03fcde865cc5e824da3bdf36fa5d3f04acb24dfe6
6
+ metadata.gz: 5b41b53619692666219cb8e526623acb4f89f4da3181fd8deb6f221d570d2dc26ef84731e35d11bda5397836b254835949d1e060be3bdb10e30ae9a97f8a9fed
7
+ data.tar.gz: 06ef46242e0de5190909919d844cc35ce47a7f76e3b5629085bd148feb86edc97d62d11cca65986de8d486c4fa63a9e60e24455b1b5dc9f0e389416007783718
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -3,9 +3,26 @@ 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
- ## Unreleased][unreleased]
6
+ ## Unreleased
7
+ - nothing
8
+
9
+ ## 0.0.4 - 2015-07-30
10
+
11
+ ### Changed
12
+ - Mesos check supports multiple servers.
13
+ - Updated Rubocop to `0.32.1`
14
+ - Updated documentation links in README and CONTRIBUTING
15
+ - Removed unused tasks from the Rakefile
16
+ - Set all deps to alpha order
17
+
18
+ ### Added
19
+ - Basic chronos check.
20
+
21
+ ### Fixed
22
+ - Only create binstubs for Ruby scripts
7
23
 
8
24
  ## [0.0.2] - 2015-07-14
25
+
9
26
  ### Changed
10
27
  - updated sensu-plugin gem to 1.2.0
11
28
 
@@ -16,4 +33,3 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
16
33
 
17
34
  ### Added
18
35
  - initial release
19
-
data/README.md CHANGED
@@ -10,6 +10,7 @@
10
10
  ## Functionality
11
11
 
12
12
  ## Files
13
+ * bin/check-chronos.rb
13
14
  * bin/check-marathon.rb
14
15
  * bin/check-mesos.rb
15
16
  * bin/metrics-marathon.rb
@@ -19,6 +20,6 @@
19
20
 
20
21
  ## Installation
21
22
 
22
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
23
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
23
24
 
24
25
  ## Notes
@@ -0,0 +1,73 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-chronos
4
+ #
5
+ # DESCRIPTION:
6
+ # This plugin checks that Chronos can query the existing job graph.
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ # gem: rest-client
17
+ #
18
+ # USAGE:
19
+ # #YELLOW
20
+ #
21
+ # NOTES:
22
+ #
23
+ # LICENSE:
24
+ # Copyright 2015, Tom Stockton (tom@stocktons.org.uk)
25
+ # Released under the same terms as Sensu (the MIT license); see LICENSE
26
+ # for details.
27
+ #
28
+
29
+ require 'sensu-plugin/check/cli'
30
+ require 'rest-client'
31
+
32
+ class ChronosNodeStatus < Sensu::Plugin::Check::CLI
33
+ option :server,
34
+ description: 'Chronos hosts, comma separated',
35
+ short: '-s SERVER',
36
+ long: '--server SERVER',
37
+ default: 'localhost'
38
+
39
+ option :port,
40
+ description: 'Chronos port',
41
+ short: '-p PORT',
42
+ long: '--port PORT',
43
+ default: '80'
44
+
45
+ option :timeout,
46
+ description: 'timeout in seconds',
47
+ short: '-t TIMEOUT',
48
+ long: '--timeout TIMEOUT',
49
+ proc: proc(&:to_i),
50
+ default: 5
51
+
52
+ def run
53
+ servers = config[:server]
54
+ failures = []
55
+ servers.split(',').each do |server|
56
+ begin
57
+ r = RestClient::Resource.new("http://#{server}:#{config[:port]}/scheduler/jobs", timeout: config[:timeout]).get
58
+ if r.code != 200
59
+ failures << "Chronos on #{server} is not responding"
60
+ end
61
+ rescue Errno::ECONNREFUSED, RestClient::ResourceNotFound, SocketError
62
+ failures << "Chronos on #{server} is not responding"
63
+ rescue RestClient::RequestTimeout
64
+ failures << "Chronos on #{server} connection timed out"
65
+ end
66
+ end
67
+ if failures.empty?
68
+ ok "Chronos is running on #{servers}"
69
+ else
70
+ critical failures.join("\n")
71
+ end
72
+ end
73
+ end
@@ -31,11 +31,18 @@ require 'rest-client'
31
31
 
32
32
  class MarathonNodeStatus < Sensu::Plugin::Check::CLI
33
33
  option :server,
34
- description: 'Marathon Host',
35
- short: '-s SERVER',
36
- long: '--server SERVER',
34
+ description: 'Marathon servers, comma separated',
35
+ short: '-s SERVER1,SERVER2,...',
36
+ long: '--server SERVER1,SERVER2,...',
37
37
  default: 'localhost'
38
38
 
39
+ option :port,
40
+ description: 'Marathon port',
41
+ short: '-p PORT',
42
+ long: '--port PORT',
43
+ required: false,
44
+ default: '8080'
45
+
39
46
  option :timeout,
40
47
  description: 'timeout in seconds',
41
48
  short: '-t TIMEOUT',
@@ -44,15 +51,24 @@ class MarathonNodeStatus < Sensu::Plugin::Check::CLI
44
51
  default: 5
45
52
 
46
53
  def run
47
- r = RestClient::Resource.new("http://#{config[:server]}:8080/ping", timeout: config[:timeout]).get
48
- if r.code == 200
49
- ok 'Marathon Service is up'
54
+ servers = config[:server]
55
+ failures = []
56
+ servers.split(',').each do |server|
57
+ begin
58
+ r = RestClient::Resource.new("http://#{server}:#{config[:port]}/ping", timeout: config[:timeout]).get
59
+ if r.code != 200
60
+ failures << "Marathon Service on #{server} is not responding"
61
+ end
62
+ rescue Errno::ECONNREFUSED, RestClient::ResourceNotFound, SocketError
63
+ failures << "Marathon Service on #{server} is not responding"
64
+ rescue RestClient::RequestTimeout
65
+ failures << "Marathon Service on #{server} connection timed out"
66
+ end
67
+ end
68
+ if failures.empty?
69
+ ok "Marathon Service is up on #{servers}"
50
70
  else
51
- critical 'Marathon Service is not responding'
71
+ critical failures.join("\n")
52
72
  end
53
- rescue Errno::ECONNREFUSED
54
- critical 'Marathon Service is not responding'
55
- rescue RestClient::RequestTimeout
56
- critical 'Marathon Service Connection timed out'
57
73
  end
58
74
  end
data/bin/check-mesos.rb CHANGED
@@ -29,11 +29,15 @@
29
29
  require 'sensu-plugin/check/cli'
30
30
  require 'rest-client'
31
31
 
32
+ # Mesos default ports are defined here: http://mesos.apache.org/documentation/latest/configuration
33
+ MASTER_DEFAULT_PORT = '5050'
34
+ SLAVE_DEFAULT_PORT = '5051'
35
+
32
36
  class MesosNodeStatus < Sensu::Plugin::Check::CLI
33
37
  option :server,
34
- description: 'Mesos Host',
35
- short: '-s SERVER',
36
- long: '--server SERVER',
38
+ description: 'Mesos servers, comma separated',
39
+ short: '-s SERVER1,SERVER2,...',
40
+ long: '--server SERVER1,SERVER2,...',
37
41
  default: 'localhost'
38
42
 
39
43
  option :mode,
@@ -42,6 +46,12 @@ class MesosNodeStatus < Sensu::Plugin::Check::CLI
42
46
  long: '--mode MODE',
43
47
  required: true
44
48
 
49
+ option :port,
50
+ description: "port (default #{MASTER_DEFAULT_PORT} for master, #{SLAVE_DEFAULT_PORT} for slave)",
51
+ short: '-p PORT',
52
+ long: '--port PORT',
53
+ required: false
54
+
45
55
  option :timeout,
46
56
  description: 'timeout in seconds',
47
57
  short: '-t TIMEOUT',
@@ -50,25 +60,33 @@ class MesosNodeStatus < Sensu::Plugin::Check::CLI
50
60
  default: 5
51
61
 
52
62
  def run
53
- case config[:mode]
63
+ mode = config[:mode]
64
+ servers = config[:server]
65
+ case mode
54
66
  when 'master'
55
- port = '5050'
67
+ port = config[:port] || MASTER_DEFAULT_PORT
56
68
  uri = '/master/health'
57
69
  when 'slave'
58
- port = '5051'
70
+ port = config[:port] || SLAVE_DEFAULT_PORT
59
71
  uri = '/slave(1)/health'
60
72
  end
61
- begin
62
- r = RestClient::Resource.new("http://#{config[:server]}:#{port}#{uri}", timeout: config[:timeout]).get
63
- if r.code == 200
64
- ok "Mesos #{config[:mode]} is up"
65
- else
66
- critical "Mesos #{config[:mode]} is not responding"
73
+ failures = []
74
+ servers.split(',').each do |server|
75
+ begin
76
+ r = RestClient::Resource.new("http://#{server}:#{port}#{uri}", timeout: config[:timeout]).get
77
+ if r.code != 200
78
+ failures << "#{config[:mode]} on #{server} is not responding"
79
+ end
80
+ rescue Errno::ECONNREFUSED, RestClient::ResourceNotFound, SocketError
81
+ failures << "Mesos #{mode} on #{server} is not responding"
82
+ rescue RestClient::RequestTimeout
83
+ failures << "Mesos #{mode} on #{server} connection timed out"
67
84
  end
68
- rescue Errno::ECONNREFUSED
69
- critical "Mesos #{config[:mode]} is not responding"
70
- rescue RestClient::RequestTimeout
71
- critical "Mesos #{config[:mode]} Connection timed out"
85
+ end
86
+ if failures.empty?
87
+ ok "Mesos #{mode} is running on #{servers}"
88
+ else
89
+ critical failures.join("\n")
72
90
  end
73
91
  end
74
92
  end
@@ -2,7 +2,7 @@ module SensuPluginsMesos
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
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.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu Plugins and contributors
@@ -30,92 +30,92 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
33
+ date: 2015-07-30 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
- name: sensu-plugin
36
+ name: rest-client
37
37
  requirement: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 1.2.0
41
+ version: 1.8.0
42
42
  type: :runtime
43
43
  prerelease: false
44
44
  version_requirements: !ruby/object:Gem::Requirement
45
45
  requirements:
46
46
  - - '='
47
47
  - !ruby/object:Gem::Version
48
- version: 1.2.0
48
+ version: 1.8.0
49
49
  - !ruby/object:Gem::Dependency
50
- name: rest-client
50
+ name: sensu-plugin
51
51
  requirement: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - '='
54
54
  - !ruby/object:Gem::Version
55
- version: 1.8.0
55
+ version: 1.2.0
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - '='
61
61
  - !ruby/object:Gem::Version
62
- version: 1.8.0
62
+ version: 1.2.0
63
63
  - !ruby/object:Gem::Dependency
64
- name: codeclimate-test-reporter
64
+ name: bundler
65
65
  requirement: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '0.4'
69
+ version: '1.7'
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '0.4'
76
+ version: '1.7'
77
77
  - !ruby/object:Gem::Dependency
78
- name: rubocop
78
+ name: codeclimate-test-reporter
79
79
  requirement: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - '='
81
+ - - "~>"
82
82
  - !ruby/object:Gem::Version
83
- version: '0.30'
83
+ version: '0.4'
84
84
  type: :development
85
85
  prerelease: false
86
86
  version_requirements: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - '='
88
+ - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.30'
90
+ version: '0.4'
91
91
  - !ruby/object:Gem::Dependency
92
- name: rspec
92
+ name: github-markup
93
93
  requirement: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '3.1'
97
+ version: '1.3'
98
98
  type: :development
99
99
  prerelease: false
100
100
  version_requirements: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '3.1'
104
+ version: '1.3'
105
105
  - !ruby/object:Gem::Dependency
106
- name: bundler
106
+ name: pry
107
107
  requirement: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '1.7'
111
+ version: '0.10'
112
112
  type: :development
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '1.7'
118
+ version: '0.10'
119
119
  - !ruby/object:Gem::Dependency
120
120
  name: rake
121
121
  requirement: !ruby/object:Gem::Requirement
@@ -131,61 +131,61 @@ dependencies:
131
131
  - !ruby/object:Gem::Version
132
132
  version: '10.0'
133
133
  - !ruby/object:Gem::Dependency
134
- name: github-markup
134
+ name: redcarpet
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '1.3'
139
+ version: '3.2'
140
140
  type: :development
141
141
  prerelease: false
142
142
  version_requirements: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
- version: '1.3'
146
+ version: '3.2'
147
147
  - !ruby/object:Gem::Dependency
148
- name: redcarpet
148
+ name: rspec
149
149
  requirement: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - "~>"
152
152
  - !ruby/object:Gem::Version
153
- version: '3.2'
153
+ version: '3.1'
154
154
  type: :development
155
155
  prerelease: false
156
156
  version_requirements: !ruby/object:Gem::Requirement
157
157
  requirements:
158
158
  - - "~>"
159
159
  - !ruby/object:Gem::Version
160
- version: '3.2'
160
+ version: '3.1'
161
161
  - !ruby/object:Gem::Dependency
162
- name: yard
162
+ name: rubocop
163
163
  requirement: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - "~>"
165
+ - - '='
166
166
  - !ruby/object:Gem::Version
167
- version: '0.8'
167
+ version: 0.32.1
168
168
  type: :development
169
169
  prerelease: false
170
170
  version_requirements: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - "~>"
172
+ - - '='
173
173
  - !ruby/object:Gem::Version
174
- version: '0.8'
174
+ version: 0.32.1
175
175
  - !ruby/object:Gem::Dependency
176
- name: pry
176
+ name: yard
177
177
  requirement: !ruby/object:Gem::Requirement
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: '0.10'
181
+ version: '0.8'
182
182
  type: :development
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
- version: '0.10'
188
+ version: '0.8'
189
189
  description: Sensu plugins for checking mesos
190
190
  email: "<sensu-users@googlegroups.com>"
191
191
  executables:
@@ -193,12 +193,14 @@ executables:
193
193
  - metrics-marathon.rb
194
194
  - check-mesos.rb
195
195
  - check-marathon.rb
196
+ - check-chronos.rb
196
197
  extensions: []
197
198
  extra_rdoc_files: []
198
199
  files:
199
200
  - CHANGELOG.md
200
201
  - LICENSE
201
202
  - README.md
203
+ - bin/check-chronos.rb
202
204
  - bin/check-marathon.rb
203
205
  - bin/check-mesos.rb
204
206
  - bin/metrics-marathon.rb
metadata.gz.sig CHANGED
Binary file