sensu-plugins-minio 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +28 -0
- data/Gemfile.lock +29 -32
- data/README.md +8 -1
- data/bin/check-minio-update.rb +12 -7
- data/lib/sensu/plugins/minio/version.rb +1 -1
- data/sensu-plugins-minio.gemspec +7 -4
- metadata +12 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f00a38420bc1ad65e8ccf268965ed75219a11eeafa60e80afbe50f22b5eae0bc
|
4
|
+
data.tar.gz: 0c669c47b834cb0fc51f3d64997937063a6fb335c00947835d3709ffd631ae3b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41c0d7299cb06bb497470c2b910483a7b73d49882939fa81d6d5cb6c9f761f0311b3b416858dfb7ce407b1853926065c8e877dd0170175d0dabc5696604fc4eb
|
7
|
+
data.tar.gz: e8fcab007df8927aad63a95a9c20d54dae664c75269d1de54edccaef6a7288881134c09db39a5a1f44ef990b2023227a8d2974c2d3d4789ee5a49277ec916c4e
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
|
4
|
+
Lint/RaiseException:
|
5
|
+
Enabled: true
|
6
|
+
|
7
|
+
Lint/StructNewOverride:
|
8
|
+
Enabled: true
|
9
|
+
|
10
|
+
|
11
|
+
Metrics:
|
12
|
+
Enabled: false
|
13
|
+
|
14
|
+
|
15
|
+
Style/FrozenStringLiteralComment:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Style/Documentation:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Style/HashEachMethods:
|
22
|
+
Enabled: true
|
23
|
+
|
24
|
+
Style/HashTransformKeys:
|
25
|
+
Enabled: true
|
26
|
+
|
27
|
+
Style/HashTransformValues:
|
28
|
+
Enabled: true
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
sensu-plugins-minio (0.0.
|
4
|
+
sensu-plugins-minio (0.0.6)
|
5
5
|
sensu-plugin (~> 2.1)
|
6
6
|
|
7
7
|
GEM
|
@@ -12,62 +12,59 @@ GEM
|
|
12
12
|
ast (2.4.2)
|
13
13
|
crack (0.4.5)
|
14
14
|
rexml
|
15
|
-
diff-lcs (1.
|
15
|
+
diff-lcs (1.5.0)
|
16
16
|
hashdiff (1.0.1)
|
17
|
-
|
17
|
+
jaro_winkler (1.5.4)
|
18
|
+
json (2.6.2)
|
18
19
|
mixlib-cli (1.7.0)
|
19
|
-
parallel (1.
|
20
|
-
parser (3.
|
20
|
+
parallel (1.22.1)
|
21
|
+
parser (3.1.2.0)
|
21
22
|
ast (~> 2.4.1)
|
22
|
-
public_suffix (4.0.
|
23
|
-
rainbow (3.
|
23
|
+
public_suffix (4.0.7)
|
24
|
+
rainbow (3.1.1)
|
24
25
|
rake (13.0.6)
|
25
|
-
regexp_parser (2.1.1)
|
26
26
|
rexml (3.2.5)
|
27
|
-
rspec (3.
|
28
|
-
rspec-core (~> 3.
|
29
|
-
rspec-expectations (~> 3.
|
30
|
-
rspec-mocks (~> 3.
|
31
|
-
rspec-core (3.
|
32
|
-
rspec-support (~> 3.
|
33
|
-
rspec-expectations (3.
|
27
|
+
rspec (3.11.0)
|
28
|
+
rspec-core (~> 3.11.0)
|
29
|
+
rspec-expectations (~> 3.11.0)
|
30
|
+
rspec-mocks (~> 3.11.0)
|
31
|
+
rspec-core (3.11.0)
|
32
|
+
rspec-support (~> 3.11.0)
|
33
|
+
rspec-expectations (3.11.0)
|
34
34
|
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
-
rspec-support (~> 3.
|
36
|
-
rspec-mocks (3.
|
35
|
+
rspec-support (~> 3.11.0)
|
36
|
+
rspec-mocks (3.11.1)
|
37
37
|
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
-
rspec-support (~> 3.
|
39
|
-
rspec-support (3.
|
40
|
-
rubocop (0.
|
38
|
+
rspec-support (~> 3.11.0)
|
39
|
+
rspec-support (3.11.0)
|
40
|
+
rubocop (0.81.0)
|
41
|
+
jaro_winkler (~> 1.5.1)
|
41
42
|
parallel (~> 1.10)
|
42
|
-
parser (>= 2.7.1
|
43
|
+
parser (>= 2.7.0.1)
|
43
44
|
rainbow (>= 2.2.2, < 4.0)
|
44
|
-
regexp_parser (>= 1.8)
|
45
45
|
rexml
|
46
|
-
rubocop-ast (>= 0.6.0)
|
47
46
|
ruby-progressbar (~> 1.7)
|
48
47
|
unicode-display_width (>= 1.4.0, < 2.0)
|
49
|
-
rubocop-ast (1.8.0)
|
50
|
-
parser (>= 3.0.1.1)
|
51
48
|
ruby-progressbar (1.11.0)
|
52
49
|
sensu-plugin (2.7.1)
|
53
50
|
json (< 3.0.0)
|
54
51
|
mixlib-cli (~> 1.5)
|
55
|
-
unicode-display_width (1.
|
56
|
-
webmock (3.
|
57
|
-
addressable (>= 2.
|
52
|
+
unicode-display_width (1.8.0)
|
53
|
+
webmock (3.14.0)
|
54
|
+
addressable (>= 2.8.0)
|
58
55
|
crack (>= 0.3.2)
|
59
56
|
hashdiff (>= 0.4.0, < 2.0.0)
|
60
57
|
|
61
58
|
PLATFORMS
|
62
|
-
|
59
|
+
ruby
|
63
60
|
|
64
61
|
DEPENDENCIES
|
65
|
-
bundler (~> 2.
|
62
|
+
bundler (~> 2.1)
|
66
63
|
rake (~> 13.0)
|
67
64
|
rspec (~> 3.10)
|
68
|
-
rubocop (~> 0.54)
|
65
|
+
rubocop (~> 0.54, <= 0.81)
|
69
66
|
sensu-plugins-minio!
|
70
67
|
webmock (~> 3.3)
|
71
68
|
|
72
69
|
BUNDLED WITH
|
73
|
-
2.
|
70
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Sensu check for minio updates
|
2
2
|
|
3
|
+
Translates the presence of an outdated minio server instance into sensu check
|
4
|
+
results to reduce the time-to-patch for minio systems.
|
5
|
+
|
3
6
|
## Installation
|
4
7
|
|
5
8
|
Add this line to your application's Gemfile:
|
@@ -24,7 +27,7 @@ Check if a the local minio version is in the most recent version
|
|
24
27
|
Checks will check the default URL https://dl.min.io/server/minio/release
|
25
28
|
and the default Platform linux-amd64 for updates. Adjust these optional
|
26
29
|
parameters if you want to check a different platform or for whatever
|
27
|
-
reason need to check a
|
30
|
+
reason need to check a different URL.
|
28
31
|
|
29
32
|
| Parameter | Description |
|
30
33
|
| ------------------ | ----------------------------------------------- |
|
@@ -57,3 +60,7 @@ Plugin follows the [rubocop ruby style guide](https://github.com/rubocop-hq/ruby
|
|
57
60
|
|
58
61
|
Bug reports and pull requests are welcome on GitHub at
|
59
62
|
https://github.com/aboutsource/sensu-plugins-minio.
|
63
|
+
|
64
|
+
## Security
|
65
|
+
|
66
|
+
* [Snyk](https://app.snyk.io/org/about-source/project/0a24cb05-4369-457c-8cca-7e4c395eb25e)
|
data/bin/check-minio-update.rb
CHANGED
@@ -46,7 +46,6 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
|
|
46
46
|
begin
|
47
47
|
Timeout.timeout(timeout) do
|
48
48
|
latest_version = get_latest_version(checkurl, platform)
|
49
|
-
local_version = get_local_version
|
50
49
|
|
51
50
|
if local_version == latest_version
|
52
51
|
ok 'No new minio version available'
|
@@ -55,12 +54,14 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
|
|
55
54
|
end
|
56
55
|
end
|
57
56
|
rescue IOError => e
|
58
|
-
unknown
|
57
|
+
unknown e.message.to_s
|
59
58
|
rescue Timeout::Error
|
60
59
|
unknown 'Connection timed out'
|
61
60
|
end
|
62
61
|
end
|
63
62
|
|
63
|
+
private
|
64
|
+
|
64
65
|
def get_latest_version(checkurl, platform)
|
65
66
|
uri = URI.parse("#{checkurl}/#{platform}/minio.shasum")
|
66
67
|
response = Net::HTTP.get_response(uri)
|
@@ -69,14 +70,18 @@ class CheckMinioUpdate < Sensu::Plugin::Check::CLI
|
|
69
70
|
raise IOError, "Unable to gather latest minio version: #{response.body}"
|
70
71
|
end
|
71
72
|
|
72
|
-
|
73
|
+
response.body.split.last.split('.', 2).last
|
73
74
|
end
|
74
75
|
|
75
|
-
def
|
76
|
-
stdout, stderr, status = Open3.capture3(
|
76
|
+
def local_version
|
77
|
+
stdout, stderr, status = Open3.capture3(
|
78
|
+
{ 'PATH' => ENV['PATH'] }, 'minio --version', unsetenv_others: true
|
79
|
+
)
|
77
80
|
|
78
|
-
|
81
|
+
unless status.success?
|
82
|
+
raise IOError, "Unable to gather local minio version: #{stderr}"
|
83
|
+
end
|
79
84
|
|
80
|
-
|
85
|
+
stdout.split.last
|
81
86
|
end
|
82
87
|
end
|
data/sensu-plugins-minio.gemspec
CHANGED
@@ -11,20 +11,23 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.authors = ['Hauke Altmann', 'Jonathan Schlue']
|
12
12
|
spec.email = ['info@aboutsource.net']
|
13
13
|
|
14
|
-
spec.summary = 'Check if there are updates for the local
|
14
|
+
spec.summary = 'Check if there are updates for the local '\
|
15
|
+
'minio server instance'
|
15
16
|
spec.description = 'Used to check for manual installed minio servers'
|
16
17
|
spec.homepage = 'https://github.com/aboutsource/sensu-plugins-minio'
|
17
18
|
spec.require_paths = ['lib']
|
18
19
|
|
19
|
-
spec.
|
20
|
+
spec.required_ruby_version = '>= 2.3.3'
|
21
|
+
|
22
|
+
spec.executables = Dir.glob('bin/**/*.rb').map { |f| File.basename(f) }
|
20
23
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
21
24
|
f.match(%r{^(test|spec|features)/})
|
22
25
|
end
|
23
26
|
|
24
27
|
spec.add_dependency 'sensu-plugin', '~> 2.1'
|
25
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
28
|
+
spec.add_development_dependency 'bundler', '~> 2.1'
|
26
29
|
spec.add_development_dependency 'rake', '~> 13.0'
|
27
30
|
spec.add_development_dependency 'rspec', '~> 3.10'
|
28
|
-
spec.add_development_dependency 'rubocop', '~> 0.54'
|
31
|
+
spec.add_development_dependency 'rubocop', '~> 0.54', '<= 0.81'
|
29
32
|
spec.add_development_dependency 'webmock', '~> 3.3'
|
30
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-minio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hauke Altmann
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sensu-plugin
|
@@ -31,14 +31,14 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version: '2.
|
34
|
+
version: '2.1'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version: '2.
|
41
|
+
version: '2.1'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
@@ -74,6 +74,9 @@ dependencies:
|
|
74
74
|
- - "~>"
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0.54'
|
77
|
+
- - "<="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0.81'
|
77
80
|
type: :development
|
78
81
|
prerelease: false
|
79
82
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -81,6 +84,9 @@ dependencies:
|
|
81
84
|
- - "~>"
|
82
85
|
- !ruby/object:Gem::Version
|
83
86
|
version: '0.54'
|
87
|
+
- - "<="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.81'
|
84
90
|
- !ruby/object:Gem::Dependency
|
85
91
|
name: webmock
|
86
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -104,6 +110,7 @@ extensions: []
|
|
104
110
|
extra_rdoc_files: []
|
105
111
|
files:
|
106
112
|
- ".gitignore"
|
113
|
+
- ".rubocop.yml"
|
107
114
|
- ".ruby-version"
|
108
115
|
- Gemfile
|
109
116
|
- Gemfile.lock
|
@@ -127,7 +134,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
127
134
|
requirements:
|
128
135
|
- - ">="
|
129
136
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
137
|
+
version: 2.3.3
|
131
138
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
139
|
requirements:
|
133
140
|
- - ">="
|