sensu-plugins-zfs 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/check-zpool.rb +13 -12
- data/bin/metric-zfs-arc.rb +2 -0
- data/lib/sensu-plugins-zfs.rb +2 -0
- data/lib/sensu-plugins-zfs/version.rb +3 -1
- data/lib/sensu-plugins-zfs/zpool.rb +3 -0
- metadata +24 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c08cc9c7c0e0538c5f164abff8aeda2ffe5dd8d3ec758ef1bbd1a9ce302d12f
|
4
|
+
data.tar.gz: 0e5e54f2e8752dbb3fead90678e796cc2dab46493f0ef694267a333b457eb8c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53f4f96ced956b05f5b08a805561f49309e46ce351efb18c267592b243e63b8862054a7712045ed08adf03ac22860b836863df96d1a5194926263fb49d77830a
|
7
|
+
data.tar.gz: 5f67bb568307ffaceffd0237600ef6fc476dbf1942878defd735d856b4c4bb91e2bcfc516c9a85dd82ff28f495f2c84a13745b403d6c3e66f7416e7893ef2f05
|
data/bin/check-zpool.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
4
|
require 'sensu-plugin/check/cli'
|
4
5
|
require 'sensu-plugins-zfs'
|
@@ -54,30 +55,30 @@ class CheckZPool < Sensu::Plugin::Check::CLI
|
|
54
55
|
|
55
56
|
private
|
56
57
|
|
57
|
-
def check_state(
|
58
|
-
@criticals << "zpool #{
|
58
|
+
def check_state(zpool)
|
59
|
+
@criticals << "zpool #{zpool.name} has state #{zpool.state}" unless zpool.ok?
|
59
60
|
end
|
60
61
|
|
61
|
-
def check_vdevs(
|
62
|
-
|
62
|
+
def check_vdevs(zpool)
|
63
|
+
zpool.vdevs.each do |vd|
|
63
64
|
unless vd.ok?
|
64
65
|
@warnings << "vdev #{vd.name} of zpool #{vd.zpool.name} has errors"
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
68
69
|
|
69
|
-
def check_capacity(
|
70
|
-
if
|
71
|
-
@criticals << "capacity for zpool #{
|
72
|
-
elsif
|
73
|
-
@warnings << "capacity for zpool #{
|
70
|
+
def check_capacity(zpool)
|
71
|
+
if zpool.capacity > config[:cap_crit].to_i
|
72
|
+
@criticals << "capacity for zpool #{zpool.name} is above #{config[:cap_crit]}% (currently #{zpool.capacity}%)"
|
73
|
+
elsif zpool.capacity > config[:cap_warn].to_i
|
74
|
+
@warnings << "capacity for zpool #{zpool.name} is above #{config[:cap_warn]}% (currently #{zpool.capacity}%)"
|
74
75
|
end
|
75
76
|
end
|
76
77
|
|
77
|
-
def check_recently_scrubbed(
|
78
|
-
last_scrub =
|
78
|
+
def check_recently_scrubbed(zpool)
|
79
|
+
last_scrub = zpool.scrubbed_at
|
79
80
|
if last_scrub < Time.now - 60 * 60 * 24 * config[:scrubbing_interval].to_i # rubocop:disable Style/GuardClause
|
80
|
-
@warnings << "It is more than #{config[:scrubbing_interval]} days since zpool #{
|
81
|
+
@warnings << "It is more than #{config[:scrubbing_interval]} days since zpool #{zpool.name} was scrubbed. Last scrubbed #{last_scrub}"
|
81
82
|
end
|
82
83
|
end
|
83
84
|
end
|
data/bin/metric-zfs-arc.rb
CHANGED
data/lib/sensu-plugins-zfs.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'time'
|
2
4
|
|
3
5
|
module SensuPluginsZFS
|
@@ -26,6 +28,7 @@ module SensuPluginsZFS
|
|
26
28
|
def scrubbed_at
|
27
29
|
return Time.at(0) if never_scrubbed?
|
28
30
|
return Time.now if scrub_in_progress?
|
31
|
+
|
29
32
|
Time.parse `sudo zpool status #{@name} | grep '^ scan: scrub' | awk '{print $11" "$12" "$13" "$14" "$15}'`.strip # rubocop:disable
|
30
33
|
end
|
31
34
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-zfs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Nørgaard
|
@@ -9,36 +9,42 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-03-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sensu-plugin
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '4.0'
|
21
|
+
- - "<"
|
19
22
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
23
|
+
version: '5.0'
|
21
24
|
type: :runtime
|
22
25
|
prerelease: false
|
23
26
|
version_requirements: !ruby/object:Gem::Requirement
|
24
27
|
requirements:
|
25
|
-
- - "
|
28
|
+
- - ">="
|
26
29
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
30
|
+
version: '4.0'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '5.0'
|
28
34
|
- !ruby/object:Gem::Dependency
|
29
35
|
name: bundler
|
30
36
|
requirement: !ruby/object:Gem::Requirement
|
31
37
|
requirements:
|
32
38
|
- - "~>"
|
33
39
|
- !ruby/object:Gem::Version
|
34
|
-
version: '1
|
40
|
+
version: '2.1'
|
35
41
|
type: :development
|
36
42
|
prerelease: false
|
37
43
|
version_requirements: !ruby/object:Gem::Requirement
|
38
44
|
requirements:
|
39
45
|
- - "~>"
|
40
46
|
- !ruby/object:Gem::Version
|
41
|
-
version: '1
|
47
|
+
version: '2.1'
|
42
48
|
- !ruby/object:Gem::Dependency
|
43
49
|
name: github-markup
|
44
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,14 +79,14 @@ dependencies:
|
|
73
79
|
requirements:
|
74
80
|
- - "~>"
|
75
81
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
82
|
+
version: '13.0'
|
77
83
|
type: :development
|
78
84
|
prerelease: false
|
79
85
|
version_requirements: !ruby/object:Gem::Requirement
|
80
86
|
requirements:
|
81
87
|
- - "~>"
|
82
88
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
89
|
+
version: '13.0'
|
84
90
|
- !ruby/object:Gem::Dependency
|
85
91
|
name: redcarpet
|
86
92
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,28 +107,28 @@ dependencies:
|
|
101
107
|
requirements:
|
102
108
|
- - "~>"
|
103
109
|
- !ruby/object:Gem::Version
|
104
|
-
version: '3.
|
110
|
+
version: '3.4'
|
105
111
|
type: :development
|
106
112
|
prerelease: false
|
107
113
|
version_requirements: !ruby/object:Gem::Requirement
|
108
114
|
requirements:
|
109
115
|
- - "~>"
|
110
116
|
- !ruby/object:Gem::Version
|
111
|
-
version: '3.
|
117
|
+
version: '3.4'
|
112
118
|
- !ruby/object:Gem::Dependency
|
113
119
|
name: rubocop
|
114
120
|
requirement: !ruby/object:Gem::Requirement
|
115
121
|
requirements:
|
116
122
|
- - "~>"
|
117
123
|
- !ruby/object:Gem::Version
|
118
|
-
version: 0.
|
124
|
+
version: 0.80.1
|
119
125
|
type: :development
|
120
126
|
prerelease: false
|
121
127
|
version_requirements: !ruby/object:Gem::Requirement
|
122
128
|
requirements:
|
123
129
|
- - "~>"
|
124
130
|
- !ruby/object:Gem::Version
|
125
|
-
version: 0.
|
131
|
+
version: 0.80.1
|
126
132
|
- !ruby/object:Gem::Dependency
|
127
133
|
name: yard
|
128
134
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,8 +148,8 @@ email:
|
|
142
148
|
- b@noergaard.dk
|
143
149
|
- "<sensu-users@googlegroups.com>"
|
144
150
|
executables:
|
145
|
-
- check-zpool.rb
|
146
151
|
- metric-zfs-arc.rb
|
152
|
+
- check-zpool.rb
|
147
153
|
extensions: []
|
148
154
|
extra_rdoc_files: []
|
149
155
|
files:
|
@@ -172,14 +178,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
172
178
|
requirements:
|
173
179
|
- - ">="
|
174
180
|
- !ruby/object:Gem::Version
|
175
|
-
version: 2.
|
181
|
+
version: 2.3.0
|
176
182
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
183
|
requirements:
|
178
184
|
- - ">="
|
179
185
|
- !ruby/object:Gem::Version
|
180
186
|
version: '0'
|
181
187
|
requirements: []
|
182
|
-
|
188
|
+
rubyforge_project:
|
189
|
+
rubygems_version: 2.7.7
|
183
190
|
signing_key:
|
184
191
|
specification_version: 4
|
185
192
|
summary: Sensu plugin for zfs
|